diff options
| author | Richard M. Stallman | 2005-04-11 16:39:49 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-04-11 16:39:49 +0000 |
| commit | 80ccc95f36342b5c840c0ce9cb4196094230668d (patch) | |
| tree | 67d21fdafd89568a58e30ef866635d3ec2ea51cc | |
| parent | 6a748edaab770d2d454208c85cabdc962c58a5b5 (diff) | |
| download | emacs-80ccc95f36342b5c840c0ce9cb4196094230668d.tar.gz emacs-80ccc95f36342b5c840c0ce9cb4196094230668d.zip | |
(Choosing Modes): Document magic-mode-alist.
| -rw-r--r-- | man/major.texi | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/man/major.texi b/man/major.texi index fa44b873031..28f0ff0f32f 100644 --- a/man/major.texi +++ b/man/major.texi | |||
| @@ -98,6 +98,21 @@ the element has the form @code{(@var{regexp} @var{mode-function} | |||
| 98 | @var{mode-function}, Emacs discards the suffix that matched | 98 | @var{mode-function}, Emacs discards the suffix that matched |
| 99 | @var{regexp} and searches the list again for another match. | 99 | @var{regexp} and searches the list again for another match. |
| 100 | 100 | ||
| 101 | @vindex magic-mode-alist | ||
| 102 | Sometimes the major mode is determined from the way the file's text | ||
| 103 | begins. The variable @code{magic-mode-alist} controls this. Its value | ||
| 104 | is a list of elements of this form: | ||
| 105 | |||
| 106 | @example | ||
| 107 | (@var{regexp} . @var{mode-function}) | ||
| 108 | @end example | ||
| 109 | |||
| 110 | @noindent | ||
| 111 | This looks like an element of @code{auto-mode-alist}, but it doesn't work | ||
| 112 | the same: this @var{regexp} is matched against the text at the start | ||
| 113 | of the buffer, not against the file name. @code{magic-mode-alist} | ||
| 114 | takes priority over @code{auto-mode-alist}. | ||
| 115 | |||
| 101 | You can specify the major mode to use for editing a certain file by | 116 | You can specify the major mode to use for editing a certain file by |
| 102 | special text in the first nonblank line of the file. The | 117 | special text in the first nonblank line of the file. The |
| 103 | mode name should appear in this line both preceded and followed by | 118 | mode name should appear in this line both preceded and followed by |