# HG changeset patch # User Stefan Monnier # Date 1179331635 0 # Node ID 2f4cc000e4dea83e88079082546b3816969d1014 # Parent 5dcc9b2e094716c69df34b2d1c095fd878c31258 (magic-fallback-mode-alist): Rename from file-start-mode-alist. diff -r 5dcc9b2e0947 -r 2f4cc000e4de admin/FOR-RELEASE --- a/admin/FOR-RELEASE Wed May 16 15:37:45 2007 +0000 +++ b/admin/FOR-RELEASE Wed May 16 16:07:15 2007 +0000 @@ -52,7 +52,7 @@ ** 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 -r 5dcc9b2e0947 -r 2f4cc000e4de etc/NEWS --- a/etc/NEWS Wed May 16 15:37:45 2007 +0000 +++ b/etc/NEWS Wed May 16 16:07:15 2007 +0000 @@ -5013,7 +5013,7 @@ *** 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 -r 5dcc9b2e0947 -r 2f4cc000e4de lisp/ChangeLog --- a/lisp/ChangeLog Wed May 16 15:37:45 2007 +0000 +++ b/lisp/ChangeLog Wed May 16 16:07:15 2007 +0000 @@ -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 -r 5dcc9b2e0947 -r 2f4cc000e4de lisp/files.el --- a/lisp/files.el Wed May 16 15:37:45 2007 +0000 +++ b/lisp/files.el Wed May 16 16:07:15 2007 +0000 @@ -2151,7 +2151,7 @@ \"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 @@ 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 @@ (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 @@ (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 -r 5dcc9b2e0947 -r 2f4cc000e4de lispref/modes.texi --- a/lispref/modes.texi Wed May 16 15:37:45 2007 +0000 +++ b/lispref/modes.texi Wed May 16 16:07:15 2007 +0000 @@ -616,7 +616,7 @@ @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