From: Stefan Monnier <monnier@iro.umontreal.ca>
Date: Thu, 14 Feb 2008 02:42:45 +0000 (+0000)
Subject: (sgml-mode): Fix comment syntax.
X-Git-Tag: emacs-pretest-22.1.91~24
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c273429337771fd0318b4f45cbd21eed4bf48e4d;p=emacs.git

(sgml-mode): Fix comment syntax.
---

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9233db66710..a92d8d16c73 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-14  Stefan Monnier  <monnier@pastel.home>
+
+	* textmodes/sgml-mode.el (sgml-mode): Fix comment syntax.
+
 2008-02-13  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* hilit-chg.el (highlight-save-buffer-state): New macro.
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el
index ed7bd87237a..37531306aa6 100644
--- a/lisp/textmodes/sgml-mode.el
+++ b/lisp/textmodes/sgml-mode.el
@@ -469,8 +469,12 @@ Do \\[describe-key] on the following bindings to discover what they do.
          sgml-transformation-function))
   ;; This will allow existing comments within declarations to be
   ;; recognized.
-  (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*")
-  (set (make-local-variable 'comment-end-skip) "[ \t]*--\\([ \t\n]*>\\)?")
+  ;; I can't find a clear description of SGML/XML comments, but it seems that
+  ;; the only reliable ones are <!-- ... --> although it's not clear what
+  ;; "..." can contain.  It used to accept -- ... -- as well, but that was
+  ;; apparently a mistake.
+  (set (make-local-variable 'comment-start-skip) "<!--[ \t]*")
+  (set (make-local-variable 'comment-end-skip) "[ \t]*--[ \t\n]*>")
   ;; This definition has an HTML leaning but probably fits well for other modes.
   (setq imenu-generic-expression
 	`((nil