comparison lisp/files.el @ 81014:947265eed15c

(magic-mode-alist): Remove image-type-auto-detected-p. (magic-fallback-mode-alist): Add image-type-auto-detected-p.
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 21 May 2007 16:43:27 +0000
parents cac6ac03dcf0
children 4e63146a7097 7489e9d44b85
comparison
equal deleted inserted replaced
81013:b808e2e86f98 81014:947265eed15c
2117 to determine the file's mode in `set-auto-mode'. If it matches, the file 2117 to determine the file's mode in `set-auto-mode'. If it matches, the file
2118 is assumed to be interpreted by the interpreter matched by the second group 2118 is assumed to be interpreted by the interpreter matched by the second group
2119 of the regular expression. The mode is then determined as the mode 2119 of the regular expression. The mode is then determined as the mode
2120 associated with that interpreter in `interpreter-mode-alist'.") 2120 associated with that interpreter in `interpreter-mode-alist'.")
2121 2121
2122 (defvar magic-mode-alist 2122 (defvar magic-mode-alist nil
2123 `((image-type-auto-detected-p . image-mode))
2124 "Alist of buffer beginnings vs. corresponding major mode functions. 2123 "Alist of buffer beginnings vs. corresponding major mode functions.
2125 Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION). 2124 Each element looks like (REGEXP . FUNCTION) or (MATCH-FUNCTION . FUNCTION).
2126 After visiting a file, if REGEXP matches the text at the beginning of the 2125 After visiting a file, if REGEXP matches the text at the beginning of the
2127 buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will 2126 buffer, or calling MATCH-FUNCTION returns non-nil, `normal-mode' will
2128 call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's 2127 call FUNCTION rather than allowing `auto-mode-alist' to decide the buffer's
2131 If FUNCTION is nil, then it is not called. (That is a way of saying 2130 If FUNCTION is nil, then it is not called. (That is a way of saying
2132 \"allow `auto-mode-alist' to decide for these files.\")") 2131 \"allow `auto-mode-alist' to decide for these files.\")")
2133 (put 'magic-mode-alist 'risky-local-variable t) 2132 (put 'magic-mode-alist 'risky-local-variable t)
2134 2133
2135 (defvar magic-fallback-mode-alist 2134 (defvar magic-fallback-mode-alist
2136 `(;; The < comes before the groups (but the first) to reduce backtracking. 2135 `((image-type-auto-detected-p . image-mode)
2136 ;; The < comes before the groups (but the first) to reduce backtracking.
2137 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. 2137 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
2138 ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely. 2138 ;; We use [ \t\r\n] instead of `\\s ' to make regex overflow less likely.
2139 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 2139 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
2140 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)"))) 2140 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\r\n]*<\\)")))
2141 (concat "\\(?:<\\?xml[ \t\r\n]+[^>]*>\\)?[ \t\r\n]*<" 2141 (concat "\\(?:<\\?xml[ \t\r\n]+[^>]*>\\)?[ \t\r\n]*<"