Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The default wrapping for HTML files in Aquamacs (Options -> Line Wrapping) is set to Break Lines (AutoFill) at 70. I can change it, e.g. to Wrap, per buffer (file). But this doesn't change it for all HTML files that are to be open in the next session. Adopt as default changes it for the other open files, but still does not change it for HTML files that are to be open during next sessions.

This is for Aquamacs 2.4 on OS X Lion, if that makes any difference.

How to permanently change Line Wrapping (to Wrap) for all HTML files, so that I don't have to change it every time?

share|improve this question
up vote 4 down vote accepted

The feature you are encountering is called "auto fill mode". You can toggled it's state by hitting META-x auto-fill-mode<enter>. (ESC x can be substituted for the META-x.)

Putting the following code in your .emacs file will cause auto fill mode to be turned off for a every html buffer you open. To get the code to work, you must restart emacs as the .emacs file is only evaluated during startup.

(defun my-html-mode-hooks ()
  "Set ups for how I like html mode."
  (auto-fill-mode 0)                    ; auto fill mode disabled
(add-hook 'html-mode-hook 'my-html-mode-hooks)
share|improve this answer
Thanks, that worked, except for in Aquamacs they recommend to use ~/Library/Preferences/Aquamacs\ Emacs/Preferences.el rather than .emacs (but .emacs is also evaluated, so it would work there too). – lupincho Apr 10 '12 at 19:25
Apparently I have to wait until the bounty is 24 hrs old to award the bounty, but that's accepted answer. – lupincho Apr 10 '12 at 19:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .