aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2006-12-19 09:14:00 +0000
committerKim F. Storm2006-12-19 09:14:00 +0000
commit5f3bef951920930c9c335c96dcd87cbbb3cf6d60 (patch)
treed936162a7e9426dba1d72a6c909320c30db71499
parent10ffa2a1cefca36dd67ef7cf4dfa1e7b143e87d3 (diff)
downloademacs-5f3bef951920930c9c335c96dcd87cbbb3cf6d60.tar.gz
emacs-5f3bef951920930c9c335c96dcd87cbbb3cf6d60.zip
(Choosing Modes): Describe match-function elements for
magic-mode-alist.
-rw-r--r--man/major.texi14
1 files changed, 9 insertions, 5 deletions
diff --git a/man/major.texi b/man/major.texi
index d1f3fbaeebf..e444965dd99 100644
--- a/man/major.texi
+++ b/man/major.texi
@@ -102,17 +102,21 @@ the element has the form @code{(@var{regexp} @var{mode-function}
102@vindex magic-mode-alist 102@vindex magic-mode-alist
103 Sometimes the major mode is determined from the way the file's text 103 Sometimes the major mode is determined from the way the file's text
104begins. The variable @code{magic-mode-alist} controls this. Its value 104begins. The variable @code{magic-mode-alist} controls this. Its value
105is a list of elements of this form: 105is a list of elements of these forms:
106 106
107@example 107@example
108(@var{regexp} . @var{mode-function}) 108(@var{regexp} . @var{mode-function})
109(@var{match-function} . @var{mode-function})
109@end example 110@end example
110 111
111@noindent 112@noindent
112This looks like an element of @code{auto-mode-alist}, but it doesn't work 113The first form looks like an element of @code{auto-mode-alist}, but it
113the same: this @var{regexp} is matched against the text at the start 114doesn't work the same: this @var{regexp} is matched against the text
114of the buffer, not against the file name. @code{magic-mode-alist} 115at the start of the buffer, not against the file name. Likewise, the
115takes priority over @code{auto-mode-alist}. 116second form calls @var{match-function} at the beginning of the buffer,
117and if the function returns non-@code{nil}, the @var{mode-function} is
118called. @code{magic-mode-alist} takes priority over
119@code{auto-mode-alist}.
116 120
117 You can specify the major mode to use for editing a certain file by 121 You can specify the major mode to use for editing a certain file by
118special text in the first nonblank line of the file. The 122special text in the first nonblank line of the file. The