]> git.eshelyaron.com Git - emacs.git/commitdiff
(sgml-lexical-context)
authorMike Williams <mdub@bigfoot.com>
Wed, 3 Apr 2002 12:13:29 +0000 (12:13 +0000)
committerMike Williams <mdub@bigfoot.com>
Wed, 3 Apr 2002 12:13:29 +0000 (12:13 +0000)
(sgml-parse-tag-backward): Extend support for CDATA to include
conditional sections.

lisp/ChangeLog
lisp/textmodes/sgml-mode.el

index 6a8ff77e20b36d7be774b5edc0cc95fc491ec687..2acf3fafcdf897cab8b996ca8388c26f03e03b51 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-03  Mike Williams  <mdub@bigfoot.com>
+
+       * textmodes/sgml-mode.el (sgml-lexical-context)
+       (sgml-parse-tag-backward): Extend support for CDATA to include
+       conditional sections.
+
 2002-04-03  Pavel Jan\e,Bm\e(Bk  <Pavel@Janik.cz>
 
        * cus-start.el: Rename `autoselect-window' to
index 74f3f50d328030950339a66789e39e93ef9de6ac..49201f5a8939e7b888f13098b400f75d7955df35 100644 (file)
@@ -864,7 +864,7 @@ and move to the line in the SGML document that caused it."
 (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 @@ If non-nil LIMIT is a nearby position before point outside of any tag."
          ;; When entering this loop we're inside text.
          (setq text-start (point))
          (skip-chars-forward "^<" pos)
-          (setq cdata-start (if (looking-at "<!\\[CDATA\\[") (point)))
+          (setq cdata-start (if (looking-at "<!\\[[A-Z]+\\[") (point)))
           ;; We skipped text and reached a tag.  Parse it.
           ;; FIXME: Handle net-enabling start-tags
           (if cdata-start
-              (search-forward "]]>" 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 @@ Leave point at the beginning of the tag."
       (setq tag-type 'comment
             tag-start (search-backward "<!--" nil t)))
      ((sgml-looking-back-at "]]")   ; cdata
-      (setq tag-type 'cdata
-            tag-start (search-backward "<![CDATA[" nil t)))
+      (setq tag-type 'cdata 
+            tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t)))
      (t
       (setq tag-start
             (with-syntax-table sgml-tag-syntax-table