changeset 80120:09b5c9664c42

(sgml-mode): Fix comment syntax.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 14 Feb 2008 02:42:45 +0000
parents b9d0c39f9ece
children 288a07952e03
files lisp/ChangeLog lisp/textmodes/sgml-mode.el
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Thu Feb 14 00:48:20 2008 +0000
+++ b/lisp/ChangeLog	Thu Feb 14 02:42:45 2008 +0000
@@ -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.
--- a/lisp/textmodes/sgml-mode.el	Thu Feb 14 00:48:20 2008 +0000
+++ b/lisp/textmodes/sgml-mode.el	Thu Feb 14 02:42:45 2008 +0000
@@ -469,8 +469,12 @@
          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