Turning emacs auto-fill off.

June Tate june at theonelab.com
Tue Mar 21 09:24:20 MST 2006


On Mar 21, 2006, at 9:14 AM, Vaughn Treude wrote:

> Hello everyone:
>
> I want to set my .emacs file so that emacs always comes up with
> auto-fill (that is, word wrap) OFF.  First of all, there was this
> paragraph, from which I deleted the line that said turn-on-auto-fill.
>
> ;; By default we starting in text mode.
> (setq initial-major-mode
>       (lambda ()
>         (text-mode)
>         (turn-on-auto-fill)
> 	(font-lock-mode)
> 	))

Did you try this instead?

   (setq initial-major-mode
         (lambda ()
           (text-mode)
           (auto-fill-mode 0)
           (font-lock-mode)))

If that doesn't work, try pressing C-h v text-mode-hook to see if  
there's a mode-hook setup to turn on auto-fill after text-mode is  
turned on. If there is, running the following elisp code...

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

...should add another hook to the end of the list that turns off auto- 
fill-mode. Granted, the ideal solution would be to figure out what's  
turning on auto-fill mode in the first place and remove that instead,  
but this should be a viable workaround in the meantime. You might  
also examine your .emacs file for any customize settings relating to  
auto-fill-mode and either remove them entirely, or change them to nil  
or 0.

> That didn't work.  Apparently auto-fill is on by default for my  
> version
> of emacs, 23.3.2.

I'm running a hand-built-from-CVS GNU Emacs, and it's only up to  
revision 22.0.5 -- are you running a heavily patched version, a  
branch, or perhaps XEmacs instead of GNU Emacs?

>> From my limited knowledge it seems that the following statement  
>> should
> do it:
>
> (setq auto-fill-mode nil)

In my CVS build and the standard version that comes with MacOS X  
(21.2.1) auto-fill-mode isn't a defvar for auto-fill, so setting that  
variable will have no effect. Instead, try calling the function like  
this:

   (auto-fill-mode 0)

That should effectively turn off auto-fill for the current buffer.

--
June Tate
june at theonelab.com
http://www.theonelab.com



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.plug.phoenix.az.us/pipermail/plug-discuss/attachments/20060321/16b57f82/PGP.pgp


More information about the PLUG-discuss mailing list