help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to set a file major mode in elisp


From: Sebastian Tennant
Subject: Re: How to set a file major mode in elisp
Date: Fri, 02 Nov 2007 15:58:53 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Quoth Mirko <mvukovic@nycap.rr.com>:
> In a piece of elisp, I would like to open an existing file and set its
> major mode for later editing.

Local variables are designed for this purpose.

You may either use this form as the first line of your file:

 -*- mode: text; fill-column: 120 -*-

or this form at the end of the file:

 Local Variables:
 mode: text
 fill-column: 120
 End:

Now each time you visit these files, Emacs will act accordingly.

Hope this helps.

Sebastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]