I have the following text:

Local Variables:
eval: (face-remap-add-relative 'default :family "AR PL KaitiM GB" :foundry "ARPH")

In my document as a code sample. However, whenever I open the document, Emacs reads these lines as file-local variables and tries to apply them... They are neither the first nor the last in the document.

Any trick to prevent Emacs from parsing them?

  • 1
    I have edited the terminology. The "mode line" is the information at the bottom of each window. These are "file-local variables". They need not be at the end of the file (they usually are, but only by convention). They can be in the first line of the file, but in a quite different format.
    – phils
    Jun 28, 2016 at 2:54
  • I've retracted my duplicate vote, as YoungFrog's answer provides a solution. How comment out a variable line in a local variable list is a related question, but not the same thing.
    – phils
    Jun 28, 2016 at 14:02

1 Answer 1


If the format of your file allows it, you can use a new page character (insert it with C-q C-l on its own line). Why it works is explained in the manual (info "(emacs) Specifying File Variables"). The relevant bit is quoted here:

Apart from using a ‘-*-’ line, you can define file local variables using a “local variables list” near the end of the file. The start of the local variables list should be no more than 3000 characters from the end of the file, and must be on the last page if the file is divided into pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.