From: Stefan Monnier Date: Wed, 16 May 2007 16:13:12 +0000 (+0000) Subject: (magic-mode-alist, magic-fallback-mode-alist): X-Git-Tag: emacs-pretest-22.0.990~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c11781dedcfa5fff0d9d811fbafded6fc14c95f5;p=emacs.git (magic-mode-alist, magic-fallback-mode-alist): Move the *ml, Postscript, and XmCD entries to the fallback part. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 13e5bf4f9a7..3ad1b5daa0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2007-05-16 Stefan Monnier + * files.el (magic-mode-alist, magic-fallback-mode-alist): + Move the *ml, Postscript, and XmCD entries to the fallback part. + * files.el (magic-fallback-mode-alist): Rename from file-start-mode-alist. 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 associated with that interpreter in `interpreter-mode-alist'.") (defvar magic-mode-alist - `((image-type-auto-detected-p . image-mode) - ;; The < comes before the groups (but the first) to reduce backtracking. + `((image-type-auto-detected-p . image-mode)) + "Alist of buffer beginnings vs. corresponding major mode functions. +Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). +After visiting a file, if REGEXP matches the text at the beginning of the +buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will +call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's +major mode. + +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 magic-fallback-mode-alist + `(;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16