diff options
| author | Mike Williams | 2002-04-03 12:13:29 +0000 |
|---|---|---|
| committer | Mike Williams | 2002-04-03 12:13:29 +0000 |
| commit | 2cfd19d446d143510dc149da777d9f06c44e4bc0 (patch) | |
| tree | ca86741b5ae242dc7c4820fa730087fd0d0f1e46 | |
| parent | e3280efba0279f5ecc92a28b50058145dbc28b5e (diff) | |
| download | emacs-2cfd19d446d143510dc149da777d9f06c44e4bc0.tar.gz emacs-2cfd19d446d143510dc149da777d9f06c44e4bc0.zip | |
(sgml-lexical-context)
(sgml-parse-tag-backward): Extend support for CDATA to include
conditional sections.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/textmodes/sgml-mode.el | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6a8ff77e20b..2acf3fafcdf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2002-04-03 Mike Williams <mdub@bigfoot.com> | ||
| 2 | |||
| 3 | * textmodes/sgml-mode.el (sgml-lexical-context) | ||
| 4 | (sgml-parse-tag-backward): Extend support for CDATA to include | ||
| 5 | conditional sections. | ||
| 6 | |||
| 1 | 2002-04-03 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 7 | 2002-04-03 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 2 | 8 | ||
| 3 | * cus-start.el: Rename `autoselect-window' to | 9 | * cus-start.el: Rename `autoselect-window' to |
diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 74f3f50d328..49201f5a893 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el | |||
| @@ -864,7 +864,7 @@ and move to the line in the SGML document that caused it." | |||
| 864 | (defun sgml-lexical-context (&optional limit) | 864 | (defun sgml-lexical-context (&optional limit) |
| 865 | "Return the lexical context at point as (TYPE . START). | 865 | "Return the lexical context at point as (TYPE . START). |
| 866 | START is the location of the start of the lexical element. | 866 | START is the location of the start of the lexical element. |
| 867 | TYPE is one of `string', `comment', `tag', or `text'. | 867 | TYPE is one of `string', `comment', `tag', `cdata', or `text'. |
| 868 | 868 | ||
| 869 | If non-nil LIMIT is a nearby position before point outside of any tag." | 869 | If non-nil LIMIT is a nearby position before point outside of any tag." |
| 870 | ;; As usual, it's difficult to get a reliable answer without parsing the | 870 | ;; 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." | |||
| 883 | ;; When entering this loop we're inside text. | 883 | ;; When entering this loop we're inside text. |
| 884 | (setq text-start (point)) | 884 | (setq text-start (point)) |
| 885 | (skip-chars-forward "^<" pos) | 885 | (skip-chars-forward "^<" pos) |
| 886 | (setq cdata-start (if (looking-at "<!\\[CDATA\\[") (point))) | 886 | (setq cdata-start (if (looking-at "<!\\[[A-Z]+\\[") (point))) |
| 887 | ;; We skipped text and reached a tag. Parse it. | 887 | ;; We skipped text and reached a tag. Parse it. |
| 888 | ;; FIXME: Handle net-enabling start-tags | 888 | ;; FIXME: Handle net-enabling start-tags |
| 889 | (if cdata-start | 889 | (if cdata-start |
| 890 | (search-forward "]]>" pos 'limit) | 890 | (search-forward "]]>" pos 'move) |
| 891 | (setq state (parse-partial-sexp (point) pos 0)))) | 891 | (setq state (parse-partial-sexp (point) pos 0)))) |
| 892 | (cond | 892 | (cond |
| 893 | (cdata-start (cons 'cdata cdata-start)) | 893 | (cdata-start (cons 'cdata cdata-start)) |
| @@ -980,8 +980,8 @@ Leave point at the beginning of the tag." | |||
| 980 | (setq tag-type 'comment | 980 | (setq tag-type 'comment |
| 981 | tag-start (search-backward "<!--" nil t))) | 981 | tag-start (search-backward "<!--" nil t))) |
| 982 | ((sgml-looking-back-at "]]") ; cdata | 982 | ((sgml-looking-back-at "]]") ; cdata |
| 983 | (setq tag-type 'cdata | 983 | (setq tag-type 'cdata |
| 984 | tag-start (search-backward "<![CDATA[" nil t))) | 984 | tag-start (re-search-backward "<!\\[[A-Z]+\\[" nil t))) |
| 985 | (t | 985 | (t |
| 986 | (setq tag-start | 986 | (setq tag-start |
| 987 | (with-syntax-table sgml-tag-syntax-table | 987 | (with-syntax-table sgml-tag-syntax-table |