Wednesday, December 15, 2010

Finding Emacs - Customising Automatically per File

psst ..... listen verryy carefully ... I shall say this only once ...

The secret search term is  "emacs file variables"

To set modes and variables for an individual file, place a line such as that below on the FIRST line of the file.

-*- mode:org ; mode:visual-line; mode:predictive -*-

What this line means is to set the file for orgmode, word-wrap and predictive text typing.  Saves having to enter keystrokes to set the environment how you want.

There is an alternative syntax that can be used at the end of the file, however I'll leave you to read the reference for that.

Update 17Jan11

Placing the particular comment character for the source file you are using in front of the customisation line will render it invisible in the output, so for orgmode, it would look like this:

# -*- mode:org ; mode:visual-line; mode:predictive -*-

more later ...



I'll leave you to spot the errors ..... :)

No comments:

Post a Comment