Question

Though I mostly hate auto-fill-mode, Org Mode makes a good case for using it, so I don't want to disable it for Org Mode by default. However, I do have some Org files where I absolutely do not want it, and am sick of typing M-x auto-etc every time I open them.

I know you can pass variable to Emacs from file headers, and after a bit of searching I came up with this document from which I deduced that I want something like this:

-*- mode: Org; auto-fill-mode 0 -*-

as the first line of my file. But not this exactly, because that gives me an error:

Malformed mode-line: "auto-fill-mode 0"

and auto-fill mode does not start up.

I am sure it is a simple error in syntax, but it would be nice to know the right way to do this.

Était-ce utile?

La solution

This is what I use:

# -*- mode: Org; eval: (auto-fill-mode 0) -*- #

Note that the # characters are optional, I just prefer them for style reasons.

$ info emacs

48.2.4.1 Specifying File Variables:

Do not use the `mode' keyword for minor modes.  To enable or disable 
a minor mode in a local variables list, use the `eval' keyword with a
Lisp expression that runs the mode command (*note Minor Modes::).`

Autres conseils

As per this part of the doc, append this to the end of your file:

# Local Variables:
# eval: (auto-fill-mode 0)
# End: 

You are missing a colon:

-*- mode: Org; auto-fill-mode: 0; -*-
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top