The Computer Oracle

Tell emacs what mode to use in file header

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Cosmic Puzzle

--

Chapters
00:00 Tell Emacs What Mode To Use In File Header
00:24 Accepted Answer Score 16
00:54 Thank you

--

Full question
https://superuser.com/questions/258690/t...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#emacs

#avk47



ACCEPTED ANSWER

Score 16


You mean like this:

-*- mode: outline -*-

There are two methods of doing this. In the first one, Emacs reads the first line of the file, looking for file variables to set. One of them is the mode to use for the file (in this case outline-mode). The line can start with anything, so a comment character can be used.

The page Specifying File Variables gives more information on how to use them.