# HG changeset patch # User Daniel Pfeiffer # Date 1099518289 0 # Node ID fc267b57656c4a13e4c00f1a139fe3f4b1dbdd25 # Parent 9afdfd21288dfcfa6666bc2bb392dc72a2a17705 (xml-based-modes): Delete var. (magic-mode-alist): New var. (set-auto-mode): Use it. diff -r 9afdfd21288d -r fc267b57656c lisp/files.el --- a/lisp/files.el Wed Nov 03 14:28:31 2004 +0000 +++ b/lisp/files.el Wed Nov 03 21:44:49 2004 +0000 @@ -1845,20 +1845,27 @@ regular expression. The mode is then determined as the mode associated with that interpreter in `interpreter-mode-alist'.") -(defvar xml-based-modes '(html-mode) - "Modes that override an XML declaration. -When `set-auto-mode' sees an ]*>\\)?\\s *<\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\)?\\s *\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*[Hh][Tt][Mm][Ll]" . html-mode) + ;; These two must come after html, because they are more general: + ("<\\?xml " . xml-mode) + ("\\s *<\\(?:!--\\(?:.\\|\n\\)*?-->\\s *<\\)*!DOCTYPE " . sgml-mode) + ("%![^V]" . ps-mode)) + "Alist of buffer beginnings vs corresponding major mode functions. +Each element looks like (REGEXP . FUNCTION). FUNCTION will be +called, unless it is nil.") (defun set-auto-mode (&optional keep-mode-if-same) "Select major mode appropriate for current buffer. + This checks for a -*- mode tag in the buffer's text, checks the interpreter that runs this file against `interpreter-mode-alist', -looks for an