Mercurial > emacs
comparison lisp/files.el @ 83626:7489e9d44b85
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 762-764)
- Update from CVS
- Merge from emacs--rel--22
* emacs--rel--22 (patch 22-23)
- Update from CVS
Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-15
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 24 May 2007 02:14:22 +0000 |
parents | 0a3247aa24a4 947265eed15c |
children | 422451dd396a |
comparison
equal
deleted
inserted
replaced
83625:188795a4ee84 | 83626:7489e9d44b85 |
---|---|
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]*<" |