Tell emacs what mode to use in file header

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>

Solution 1:

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.