[ESS] Re: how to disable auto-fill-mode for editing R / S

Kiermeier, Andreas (PIRSA - SARDI) Kiermeier.Andreas at saugov.sa.gov.au
Tue Mar 29 10:10:08 CEST 2005


Martin,

wouldn't the following mode hook work?

(add-hook 'ess-mode-hook
          (lambda ()
	    (auto-fill-mode 0)))

In addition, I know how turn a mode on using a local variable, but could you
not use somthing similar to turn it off? Maybe the following (of course, you
should be careful with using eval as a local file variable and you require
enable-local-eval to be true or it probably won't work).

### Local Variables:
### comment-start: "## "
### eval: (auto-fill-mode 0)
### End:

I'm not quite sure whether they work as I currently can't try it out, but
Jing, you might like to experiment with it.

Cheers,

Andreas

-----Original Message-----
From: ess-help-bounces at stat.math.ethz.ch
[mailto:ess-help-bounces at stat.math.ethz.ch]On Behalf Of Martin Maechler
Sent: Tuesday, 29 March 2005 17:27
To: Jing Zhou
Cc: ESS-help at stat.math.ethz.ch
Subject: [ESS] Re: how to disable auto-fill-mode for editing R / S 


Dear Jing,

(You should have posed this question to the ESS-help mailing
 list; since the following should be of interest for other
 ESS-help subscribers, I'm cc-ing the mailing list.)

>>>>> "Jing" == Jing Zhou <usazhoujing at hotmail.com>
>>>>>     on Tue, 29 Mar 2005 02:05:00 -0500 writes:

    Jing> Dear Martin, I want to disable the auto-fill-mode in
    Jing> ess-5.2.6 when edition R codes. It seems that the
    Jing> auto-fill-mode is turned on automatically. How to turn
    Jing> it off in initial file? 

it is an Emacs concept, not at all particular to ESS.

    Jing> I googled the answer for several hours and didn't find
    Jing> the answer.

In Emacs
   C-h f auto-fill-mode

  (C-h := help;  C-h f := help on function )

will tell you ``all'' about it {well, it's not trivial to read
unless you are a bit familiar with emacs and maybe even emacs-lisp}.

However, as I just found, adding
  (auto-fill-mode 0)
in your ~/.emacs initialization file is not enough.
We currently turn on auto-fill mode for *.R buffers anyway.

You can quickly turn it off with   M-x auto-fill-mode 
(using command completion, you only need to type
  M-x au <ENTER> -f <ENTER>
)

and that's what I would use myself when for some rare reason, I
would not want auto-filling. 
Note that I'd very much recommend you not to use very long lines
in your source files, and then auto filling is very useful in my
experience.

OTOH, I wonder if ESS shouldn't have it's own configuration
option which would keep auto-filling the current default, but
easily allows turning it off.


    Jing> Is there any mailing list archive?

Yes: Doesn't the footer at the end of every ess-help message
contain a URL?  From there, you'll find the archives.
Even though they are not searchable directly,
you can use "mighty Google" specifying the "site:" and mailing
list name :

   site:stat.ethz.ch ess-help auto-fill


Regards,
Martin Maechler, ETH Zurich

______________________________________________
ESS-help at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help




More information about the ESS-help mailing list