Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable auto-fill mode in Emacs?

Today I got my new PC (Windows 7, 32 bit) and installed Vincelt Goulets Emacs. The only other thing I did was updating Org-mode.

Now, I am stuck with auto-fill-mode on every time I start Emacs new, which I hate. I would like to turn auto-fill-mode off, for now and forever. I even deleted my .emacs file, but auto-fill-mode was still turned on.

The only solution that worked was (a) a nasty workaround or (b) always typing M-x auto-fill-mode every time I start Emacs anew.

Is there a solution?


To be clear, the only thing the current .emacs file contains is: '(inhibit-startup-screen t)

like image 626
Henrik Avatar asked Mar 26 '12 19:03

Henrik


People also ask

What is Auto Fill mode in Emacs?

Auto Fill mode is a minor mode which is enabled or disabled for each buffer individually. See section Minor Modes. In Auto Fill mode, lines are broken automatically at spaces when they get longer than the desired width. Line breaking and rearrangement takes place only when you type SPC or RET .

What is Auto Fill mode?

Auto Fill mode is a buffer-local minor mode (see Minor Modes) in which lines are broken automatically when the line becomes too wide and you type SPC or RET . M-x auto-fill-mode. Enable or disable Auto Fill mode.


1 Answers

Add to your .emacs,

(auto-fill-mode -1) 

If there are hooks for specific modes, you will need to zap those as well. My suspicion is that you do not actually have auto-fill-mode on by default in all modes, but with the information you have supplied, at least this should be a starting point.

A reasonable safeguard would be to also disable auto-fill mode from `text-mode-hook':

(remove-hook 'text-mode-hook #'turn-on-auto-fill) 

You may need something similar for other modes as well.

like image 145
tripleee Avatar answered Sep 29 '22 00:09

tripleee