[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/files.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/files.el |
Date: |
Sun, 12 Feb 2006 20:30:28 +0000 |
Index: emacs/lisp/files.el
diff -u emacs/lisp/files.el:1.805 emacs/lisp/files.el:1.806
--- emacs/lisp/files.el:1.805 Sat Feb 11 18:42:23 2006
+++ emacs/lisp/files.el Sun Feb 12 20:30:28 2006
@@ -2024,18 +2024,19 @@
(defvar magic-mode-alist
`(;; The < comes before the groups (but the first) to reduce backtracking.
;; TODO: UTF-16 <?xml may be preceded by a BOM 0xff 0xfe or 0xfe 0xff.
+ ;; We use [ \t\n] instead of `\\s ' to make regex overflow less likely.
(,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
- (comment-re (concat "\\(?:!--" incomment-re "*-->\\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))
- [Emacs-diffs] Changes to emacs/lisp/files.el, Kim F. Storm, 2006/02/04
- [Emacs-diffs] Changes to emacs/lisp/files.el, Thien-Thi Nguyen, 2006/02/06
- [Emacs-diffs] Changes to emacs/lisp/files.el, Eli Zaretskii, 2006/02/11
- [Emacs-diffs] Changes to emacs/lisp/files.el,
Richard M. Stallman <=
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/13
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/13
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/14
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/14
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/14
- [Emacs-diffs] Changes to emacs/lisp/files.el, Reiner Steib, 2006/02/17
- [Emacs-diffs] Changes to emacs/lisp/files.el, Chong Yidong, 2006/02/17
- [Emacs-diffs] Changes to emacs/lisp/files.el, Richard M. Stallman, 2006/02/21