Re: Turning emacs auto-fill off.

Top Page
Attachments:
Message as email
+ (text/plain)
+ PGP.sig (application/pgp-signature)
+ (text/plain)
Delete this message
Reply to this message
Author: June Tate
Date:  
To: Main PLUG discussion list
Subject: Re: Turning emacs auto-fill off.
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

http://www.theonelab.com



---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss