Previous: , Up: Files   [Contents][Index]


3.3.3 Type Hooks and File Options

When a file is read either by Find File or Visit File, Hemlock attempts to guess the correct mode in which to put the buffer, based on the file’s type (the part of the filename after the last dot). Any default action may be overridden by specifying the mode in the file’s file options.

The user specifies file options with a special syntax on the first line of a file. If the first line contains the string "-*-", then Hemlock interprets the text between the first such occurrence and the second, which must be contained in one line , as a list of "option: value" pairs separated by semicolons. The following is a typical example:

;;; -*- Mode: Lisp, Editor; Package: Hemlock -*-

These options are currently defined:

Dictionary

The argument is the filename of a spelling dictionary associated with this file. The handler for this option merges the argument with the name of this file. See Set Buffer Spelling Dictionary.

Log

The argument is the name of the change log file associated with this file (see page log-files). The handler for this option merges the argument with the name of this file.

Mode

The argument is a comma-separated list of the names of modes to turn on in the buffer that the file is read into.

Package

The argument is the name of the package to be used for reading code in the file. This is only meaningful for Lisp code (see page lisp-package.)

Editor

The handler for this option ignores its argument and turns on Editor mode (see Editor Mode).

If the option list contains no ":" then the entire string is used as the name of the major mode for the buffer.

Command: Process File Options

This command processes the file options in the current buffer as described above. This is useful when the options have been changed or when a file is created.


Previous: Filename Defaulting and Merging, Up: Files   [Contents][Index]