diff options
| author | Stefan Monnier | 2007-05-16 16:13:12 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-05-16 16:13:12 +0000 |
| commit | c11781dedcfa5fff0d9d811fbafded6fc14c95f5 (patch) | |
| tree | 53697db302b5d4eacf0e93b2f59bbd4f023494be | |
| parent | 92228a10a24cb72c55b228fb284ba2f6a2aa98c3 (diff) | |
| download | emacs-c11781dedcfa5fff0d9d811fbafded6fc14c95f5.tar.gz emacs-c11781dedcfa5fff0d9d811fbafded6fc14c95f5.zip | |
(magic-mode-alist, magic-fallback-mode-alist):
Move the *ml, Postscript, and XmCD entries to the fallback part.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/files.el | 29 |
2 files changed, 17 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 13e5bf4f9a7..3ad1b5daa0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * files.el (magic-mode-alist, magic-fallback-mode-alist): | ||
| 4 | Move the *ml, Postscript, and XmCD entries to the fallback part. | ||
| 5 | |||
| 3 | * files.el (magic-fallback-mode-alist): | 6 | * files.el (magic-fallback-mode-alist): |
| 4 | Rename from file-start-mode-alist. | 7 | Rename from file-start-mode-alist. |
| 5 | 8 | ||
diff --git a/lisp/files.el b/lisp/files.el index d022baad9a0..322b28f293e 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2120,8 +2120,20 @@ of the regular expression. The mode is then determined as the mode | |||
| 2120 | associated with that interpreter in `interpreter-mode-alist'.") | 2120 | associated with that interpreter in `interpreter-mode-alist'.") |
| 2121 | 2121 | ||
| 2122 | (defvar magic-mode-alist | 2122 | (defvar magic-mode-alist |
| 2123 | `((image-type-auto-detected-p . image-mode) | 2123 | `((image-type-auto-detected-p . image-mode)) |
| 2124 | ;; The < comes before the groups (but the first) to reduce backtracking. | 2124 | "Alist of buffer beginnings vs. corresponding major mode functions. |
| 2125 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | ||
| 2126 | After visiting a file, if REGEXP matches the text at the beginning of the | ||
| 2127 | buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will | ||
| 2128 | call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's | ||
| 2129 | major mode. | ||
| 2130 | |||
| 2131 | If FUNCTION is nil, then it is not called. (That is a way of saying | ||
| 2132 | \"allow `auto-mode-alist' to decide for these files.\")") | ||
| 2133 | (put 'magic-mode-alist 'risky-local-variable t) | ||
| 2134 | |||
| 2135 | (defvar magic-fallback-mode-alist | ||
| 2136 | `(;; The < comes before the groups (but the first) to reduce backtracking. | ||
| 2125 | ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. | 2137 | ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. |
| 2126 | ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely. | 2138 | ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely. |
| 2127 | (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") | 2139 | (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") |
| @@ -2140,19 +2152,6 @@ associated with that interpreter in `interpreter-mode-alist'.") | |||
| 2140 | . sgml-mode) | 2152 | . sgml-mode) |
| 2141 | ("%!PS" . ps-mode) | 2153 | ("%!PS" . ps-mode) |
| 2142 | ("# xmcd " . conf-unix-mode)) | 2154 | ("# xmcd " . conf-unix-mode)) |
| 2143 | "Alist of buffer beginnings vs. corresponding major mode functions. | ||
| 2144 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | ||
| 2145 | After visiting a file, if REGEXP matches the text at the beginning of the | ||
| 2146 | buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will | ||
| 2147 | call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's | ||
| 2148 | major mode. | ||
| 2149 | |||
| 2150 | If FUNCTION is nil, then it is not called. (That is a way of saying | ||
| 2151 | \"allow `auto-mode-alist' to decide for these files.\")") | ||
| 2152 | (put 'magic-mode-alist 'risky-local-variable t) | ||
| 2153 | |||
| 2154 | (defvar magic-fallback-mode-alist | ||
| 2155 | nil | ||
| 2156 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. | 2155 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. |
| 2157 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | 2156 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). |
| 2158 | After visiting a file, if REGEXP matches the text at the beginning of the | 2157 | After visiting a file, if REGEXP matches the text at the beginning of the |