aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-02-12 20:30:28 +0000
committerRichard M. Stallman2006-02-12 20:30:28 +0000
commita52152f859dbf91fe1890d62a626844b18aaf45e (patch)
tree64b0522c9fbe16fe0b9cb947d973d93c03f94414
parent9012c084ef3009a99c5bac01b0169202f54e66b0 (diff)
downloademacs-a52152f859dbf91fe1890d62a626844b18aaf45e.tar.gz
emacs-a52152f859dbf91fe1890d62a626844b18aaf45e.zip
(magic-mode-alist): Don't use `\\s ' in regexps.
-rw-r--r--lisp/files.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 59a032759e4..16229cfda1c 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2024,18 +2024,19 @@ associated with that interpreter in `interpreter-mode-alist'.")
2024(defvar magic-mode-alist 2024(defvar magic-mode-alist
2025 `(;; The < comes before the groups (but the first) to reduce backtracking. 2025 `(;; The < comes before the groups (but the first) to reduce backtracking.
2026 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff. 2026 ;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
2027 ;; We use [ \t\n] instead of `\\s ' to make regex overflow less likely.
2027 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 2028 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
2028 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) 2029 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
2029 (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<" 2030 (concat "\\(?:<\\?xml[ \t\n]+[^>]*>\\)?[ \t\n]*<"
2030 comment-re "*" 2031 comment-re "*"
2031 "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?" 2032 "\\(?:!DOCTYPE[ \t\n]+[^>]*>[ \t\n]*<[ \t\n]*" comment-re "*\\)?"
2032 "[Hh][Tt][Mm][Ll]")) 2033 "[Hh][Tt][Mm][Ll]"))
2033 . html-mode) 2034 . html-mode)
2034 ;; These two must come after html, because they are more general: 2035 ;; These two must come after html, because they are more general:
2035 ("<\\?xml " . xml-mode) 2036 ("<\\?xml " . xml-mode)
2036 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") 2037 (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
2037 (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) 2038 (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)")))
2038 (concat "\\s *<" comment-re "*!DOCTYPE ")) 2039 (concat "[ \t\n]*<" comment-re "*!DOCTYPE "))
2039 . sgml-mode) 2040 . sgml-mode)
2040 ("%![^V]" . ps-mode) 2041 ("%![^V]" . ps-mode)
2041 ("# xmcd " . conf-unix-mode)) 2042 ("# xmcd " . conf-unix-mode))