how to permanently change the default wrapping for HTML files in Aquamacs?

1

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?

lupincho

Posted 2012-04-08T08:28:04.070

Reputation: 1 630

Answers

4

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)

jwernerny

Posted 2012-04-08T08:28:04.070

Reputation: 951

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 – 2012-04-10T19:25:26.010

Apparently I have to wait until the bounty is 24 hrs old to award the bounty, but that's accepted answer. – lupincho – 2012-04-10T19:28:41.523