From 92228a10a24cb72c55b228fb284ba2f6a2aa98c3 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 16 May 2007 16:07:15 +0000 Subject: [PATCH] (magic-fallback-mode-alist): Rename from file-start-mode-alist. --- admin/FOR-RELEASE | 2 +- etc/NEWS | 2 +- lisp/ChangeLog | 5 +++++ lisp/files.el | 10 +++++----- 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 ** 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 diff --git a/etc/NEWS b/etc/NEWS index 412f5bc928c..84c7b3b3bf1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7268a63fe29..13e5bf4f9a7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-05-16 Stefan Monnier + + * files.el (magic-fallback-mode-alist): + Rename from file-start-mode-alist. + 2007-05-16 Nikolaj Schumacher (tiny change) * 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 \"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) 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 @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 -- 2.39.2