Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a built in way in emacs to to suggest what mode it should use? I have lots of properties files that doesn't have a file endings to guide emacs.

Ideally I'd like to be able to put somthing like this in the file header

# Emacs-Mode: <name of mode wanted>
share|improve this question
up vote 8 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .