Commit 92228a10 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(magic-fallback-mode-alist): Rename from file-start-mode-alist.

parent 7dbf4670
......@@ -52,7 +52,7 @@ http://lists.gnu.org/archive/html/emacs-devel/2007-04/msg01113.html
** Install vc-hooks.el patch from trunk.
** Move some items from magic-mode-alist to file-start-mode-alist.
** Move some items from magic-mode-alist to magic-fallback-mode-alist.
** cloos@jhcloos.com, May 11: A redisplay bug in 22.0.99
......
......@@ -5013,7 +5013,7 @@ of multiline constructs so that such constructs get properly recognized.
*** New variable `magic-mode-alist' determines major mode for a file by
looking at the file contents. It takes precedence over `auto-mode-alist'.
*** New variable `file-start-mode-alist' determines major mode for a file by
*** New variable `magic-fallback-mode-alist' determines major mode for a file by
looking at the file contents. It is handled after `auto-mode-alist',
only if `auto-mode-alist' (and `magic-mode-alist') says nothing about the file.
......
2007-05-16 Stefan Monnier <monnier@iro.umontreal.ca>
* files.el (magic-fallback-mode-alist):
Rename from file-start-mode-alist.
2007-05-16 Nikolaj Schumacher <n_schumacher@web.de> (tiny change)
 
* progmodes/compile.el (compilation-handle-exit): Quote first
......@@ -2151,7 +2151,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying
\"allow `auto-mode-alist' to decide for these files.\")")
(put 'magic-mode-alist 'risky-local-variable t)
(defvar file-start-mode-alist
(defvar magic-fallback-mode-alist
nil
"Like `magic-mode-alist' but has lower priority than `auto-mode-alist'.
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'
have not specified a mode for this file.
If FUNCTION is nil, then it is not called.")
(put 'file-start-mode-alist 'risky-local-variable t)
(put 'magic-fallback-mode-alist 'risky-local-variable t)
(defvar magic-mode-regexp-match-limit 4000
"Upper limit on `magic-mode-alist' regexp matches.
Also applies to `file-start-mode-alist'.")
Also applies to `magic-fallback-mode-alist'.")
(defun set-auto-mode (&optional keep-mode-if-same)
"Select major mode appropriate for current buffer.
......@@ -2284,7 +2284,7 @@ only set the major mode, if that would change it."
(when mode
(set-auto-mode-0 mode keep-mode-if-same)
(setq done t))))))
;; Next try matching the buffer beginning against file-start-mode-alist.
;; Next try matching the buffer beginning against magic-fallback-mode-alist.
(unless done
(if (setq done (save-excursion
(goto-char (point-min))
......@@ -2292,7 +2292,7 @@ only set the major mode, if that would change it."
(narrow-to-region (point-min)
(min (point-max)
(+ (point-min) magic-mode-regexp-match-limit)))
(assoc-default nil file-start-mode-alist
(assoc-default nil magic-fallback-mode-alist
(lambda (re dummy)
(if (functionp re)
(funcall re)
......
......@@ -616,7 +616,7 @@ the text at the beginning of the buffer matches @var{regexp} and
@code{auto-mode-alist} gets to decide the mode.
@end defvar
@defvar file-start-mode-alist
@defvar magic-fallback-mode-alist
This works like @code{magic-mode-alist}, except that it is handled
only if @code{auto-mode-alist} does not specify a mode for this file.
@end defvar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment