# HG changeset patch # User Mike Williams # Date 1017835979 0 # Node ID 2480de7648c8a9541a81c1fea03c7d87aff78806 # Parent bb4d8a7cff31342022d03db29444ce4929bc1055 (sgml-lexical-context) (sgml-parse-tag-backward): Extend support for CDATA to include conditional sections. diff -r bb4d8a7cff31 -r 2480de7648c8 lisp/textmodes/sgml-mode.el --- a/lisp/textmodes/sgml-mode.el Wed Apr 03 09:37:48 2002 +0000 +++ b/lisp/textmodes/sgml-mode.el Wed Apr 03 12:12:59 2002 +0000 @@ -864,7 +864,7 @@ (defun sgml-lexical-context (&optional limit) "Return the lexical context at point as (TYPE . START). START is the location of the start of the lexical element. -TYPE is one of `string', `comment', `tag', or `text'. +TYPE is one of `string', `comment', `tag', `cdata', or `text'. If non-nil LIMIT is a nearby position before point outside of any tag." ;; As usual, it's difficult to get a reliable answer without parsing the @@ -883,11 +883,11 @@ ;; When entering this loop we're inside text. (setq text-start (point)) (skip-chars-forward "^<" pos) - (setq cdata-start (if (looking-at "" pos 'limit) + (search-forward "]]>" pos 'move) (setq state (parse-partial-sexp (point) pos 0)))) (cond (cdata-start (cons 'cdata cdata-start)) @@ -980,8 +980,8 @@ (setq tag-type 'comment tag-start (search-backward "