From a52152f859dbf91fe1890d62a626844b18aaf45e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 12 Feb 2006 20:30:28 +0000 Subject: [PATCH] (magic-mode-alist): Don't use `\\s ' in regexps. --- lisp/files.el | 11 ++++++----- 1 file 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'.") (defvar magic-mode-alist `(;; The < comes before the groups (but the first) to reduce backtracking. ;; TODO: UTF-16 \\s *<\\)"))) - (concat "\\(?:<\\?xml\\s +[^>]*>\\)?\\s *<" + (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)"))) + (concat "\\(?:<\\?xml[ \t\n]+[^>]*>\\)?[ \t\n]*<" comment-re "*" - "\\(?:!DOCTYPE\\s +[^>]*>\\s *<\\s *" comment-re "*\\)?" + "\\(?:!DOCTYPE[ \t\n]+[^>]*>[ \t\n]*<[ \t\n]*" comment-re "*\\)?" "[Hh][Tt][Mm][Ll]")) . html-mode) ;; These two must come after html, because they are more general: ("<\\?xml " . xml-mode) (,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)") - (comment-re (concat "\\(?:!--" incomment-re "*-->\\s *<\\)"))) - (concat "\\s *<" comment-re "*!DOCTYPE ")) + (comment-re (concat "\\(?:!--" incomment-re "*-->[ \t\n]*<\\)"))) + (concat "[ \t\n]*<" comment-re "*!DOCTYPE ")) . sgml-mode) ("%![^V]" . ps-mode) ("# xmcd " . conf-unix-mode)) -- 2.11.4.GIT