diff lisp/textmodes/sgml-mode.el @ 106435:9e1a89d804c8

* textmodes/sgml-mode.el (sgml-lexical-context): Recognise comment-start-skip to comment-end-skip as comment (Bug#4781).
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 05 Dec 2009 20:23:25 +0000
parents 18698b6aca31
children 1d1d5d9bd884
line wrap: on
line diff
--- a/lisp/textmodes/sgml-mode.el	Sat Dec 05 20:16:42 2009 +0000
+++ b/lisp/textmodes/sgml-mode.el	Sat Dec 05 20:23:25 2009 +0000
@@ -1066,6 +1066,12 @@
                   (let ((cdata-start (point)))
                     (unless (search-forward "]]>" pos 'move)
                       (list 0 nil nil 'cdata nil nil nil nil cdata-start))))
+		 ((looking-at comment-start-skip)
+		  ;; parse-partial-sexp doesn't handle <!-- comments -->,
+		  ;; or only if ?- is in sgml-specials, so match explicitly
+		  (let ((start (point)))
+		    (unless (re-search-forward comment-end-skip pos 'move)
+		      (list 0 nil nil nil t nil nil nil start))))
                  ((and sgml-xml-mode (looking-at "<\\?"))
                   ;; Processing Instructions.
                   ;; In SGML, it's basically a normal tag of the form