diff options
| author | Stefan Monnier | 2007-05-16 16:07:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-05-16 16:07:15 +0000 |
| commit | 92228a10a24cb72c55b228fb284ba2f6a2aa98c3 (patch) | |
| tree | d1b35352c85dafb4360d6bb157a9e1296d99ae37 | |
| parent | 7dbf4670d9ac3f8438d65d015baf77e9d6585bb3 (diff) | |
| download | emacs-92228a10a24cb72c55b228fb284ba2f6a2aa98c3.tar.gz emacs-92228a10a24cb72c55b228fb284ba2f6a2aa98c3.zip | |
(magic-fallback-mode-alist): Rename from file-start-mode-alist.
| -rw-r--r-- | admin/FOR-RELEASE | 2 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 10 | ||||
| -rw-r--r-- | lispref/modes.texi | 2 |
5 files changed, 13 insertions, 8 deletions
diff --git a/admin/FOR-RELEASE b/admin/FOR-RELEASE index ca6723a2766..66c82595b3e 100644 --- a/admin/FOR-RELEASE +++ b/admin/FOR-RELEASE | |||
| @@ -52,7 +52,7 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html | |||
| 52 | 52 | ||
| 53 | ** Install vc-hooks.el patch from trunk. | 53 | ** Install vc-hooks.el patch from trunk. |
| 54 | 54 | ||
| 55 | ** Move some items from magic-mode-alist to file-start-mode-alist. | 55 | ** Move some items from magic-mode-alist to magic-fallback-mode-alist. |
| 56 | 56 | ||
| 57 | ** cloos@jhcloos.com, May 11: A redisplay bug in 22.0.99 | 57 | ** cloos@jhcloos.com, May 11: A redisplay bug in 22.0.99 |
| 58 | 58 | ||
| @@ -5013,7 +5013,7 @@ of multiline constructs so that such constructs get properly recognized. | |||
| 5013 | *** New variable `magic-mode-alist' determines major mode for a file by | 5013 | *** New variable `magic-mode-alist' determines major mode for a file by |
| 5014 | looking at the file contents. It takes precedence over `auto-mode-alist'. | 5014 | looking at the file contents. It takes precedence over `auto-mode-alist'. |
| 5015 | 5015 | ||
| 5016 | *** New variable `file-start-mode-alist' determines major mode for a file by | 5016 | *** New variable `magic-fallback-mode-alist' determines major mode for a file by |
| 5017 | looking at the file contents. It is handled after `auto-mode-alist', | 5017 | looking at the file contents. It is handled after `auto-mode-alist', |
| 5018 | only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file. | 5018 | only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file. |
| 5019 | 5019 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7268a63fe29..13e5bf4f9a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * files.el (magic-fallback-mode-alist): | ||
| 4 | Rename from file-start-mode-alist. | ||
| 5 | |||
| 1 | 2007-05-16 Nikolaj Schumacher <n_schumacher@web.de> (tiny change) | 6 | 2007-05-16 Nikolaj Schumacher <n_schumacher@web.de> (tiny change) |
| 2 | 7 | ||
| 3 | * progmodes/compile.el (compilation-handle-exit): Quote first | 8 | * progmodes/compile.el (compilation-handle-exit): Quote first |
diff --git a/lisp/files.el b/lisp/files.el index a2d9192246a..d022baad9a0 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2151,7 +2151,7 @@ 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.\")") | 2151 | \"allow `auto-mode-alist' to decide for these files.\")") |
| 2152 | (put 'magic-mode-alist 'risky-local-variable t) | 2152 | (put 'magic-mode-alist 'risky-local-variable t) |
| 2153 | 2153 | ||
| 2154 | (defvar file-start-mode-alist | 2154 | (defvar magic-fallback-mode-alist |
| 2155 | nil | 2155 | nil |
| 2156 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. | 2156 | "Like `magic-mode-alist' but has lower priority than `auto-mode-alist'. |
| 2157 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). | 2157 | Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). |
| @@ -2161,11 +2161,11 @@ call FUNCTION, provided that `magic-mode-alist' and `auto-mode-alist' | |||
| 2161 | have not specified a mode for this file. | 2161 | have not specified a mode for this file. |
| 2162 | 2162 | ||
| 2163 | If FUNCTION is nil, then it is not called.") | 2163 | If FUNCTION is nil, then it is not called.") |
| 2164 | (put 'file-start-mode-alist 'risky-local-variable t) | 2164 | (put 'magic-fallback-mode-alist 'risky-local-variable t) |
| 2165 | 2165 | ||
| 2166 | (defvar magic-mode-regexp-match-limit 4000 | 2166 | (defvar magic-mode-regexp-match-limit 4000 |
| 2167 | "Upper limit on `magic-mode-alist' regexp matches. | 2167 | "Upper limit on `magic-mode-alist' regexp matches. |
| 2168 | Also applies to `file-start-mode-alist'.") | 2168 | Also applies to `magic-fallback-mode-alist'.") |
| 2169 | 2169 | ||
| 2170 | (defun set-auto-mode (&optional keep-mode-if-same) | 2170 | (defun set-auto-mode (&optional keep-mode-if-same) |
| 2171 | "Select major mode appropriate for current buffer. | 2171 | "Select major mode appropriate for current buffer. |
| @@ -2284,7 +2284,7 @@ only set the major mode, if that would change it." | |||
| 2284 | (when mode | 2284 | (when mode |
| 2285 | (set-auto-mode-0 mode keep-mode-if-same) | 2285 | (set-auto-mode-0 mode keep-mode-if-same) |
| 2286 | (setq done t)))))) | 2286 | (setq done t)))))) |
| 2287 | ;; Next try matching the buffer beginning against file-start-mode-alist. | 2287 | ;; Next try matching the buffer beginning against magic-fallback-mode-alist. |
| 2288 | (unless done | 2288 | (unless done |
| 2289 | (if (setq done (save-excursion | 2289 | (if (setq done (save-excursion |
| 2290 | (goto-char (point-min)) | 2290 | (goto-char (point-min)) |
| @@ -2292,7 +2292,7 @@ only set the major mode, if that would change it." | |||
| 2292 | (narrow-to-region (point-min) | 2292 | (narrow-to-region (point-min) |
| 2293 | (min (point-max) | 2293 | (min (point-max) |
| 2294 | (+ (point-min) magic-mode-regexp-match-limit))) | 2294 | (+ (point-min) magic-mode-regexp-match-limit))) |
| 2295 | (assoc-default nil file-start-mode-alist | 2295 | (assoc-default nil magic-fallback-mode-alist |
| 2296 | (lambda (re dummy) | 2296 | (lambda (re dummy) |
| 2297 | (if (functionp re) | 2297 | (if (functionp re) |
| 2298 | (funcall re) | 2298 | (funcall re) |
diff --git a/lispref/modes.texi b/lispref/modes.texi index 6d9aabefbe8..95fbe6a292f 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi | |||
| @@ -616,7 +616,7 @@ the text at the beginning of the buffer matches @var{regexp} and | |||
| 616 | @code{auto-mode-alist} gets to decide the mode. | 616 | @code{auto-mode-alist} gets to decide the mode. |
| 617 | @end defvar | 617 | @end defvar |
| 618 | 618 | ||
| 619 | @defvar file-start-mode-alist | 619 | @defvar magic-fallback-mode-alist |
| 620 | This works like @code{magic-mode-alist}, except that it is handled | 620 | This works like @code{magic-mode-alist}, except that it is handled |
| 621 | only if @code{auto-mode-alist} does not specify a mode for this file. | 621 | only if @code{auto-mode-alist} does not specify a mode for this file. |
| 622 | @end defvar | 622 | @end defvar |