comparison lisp/textmodes/xml-lite.el @ 44189:ee2adfa7e248

(xml-lite-in-string-p): Simplify.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 27 Mar 2002 22:27:44 +0000
parents 65437de0940f
children 2eeb8d7f1161
comparison
equal deleted inserted replaced
44188:dcccdfe56268 44189:ee2adfa7e248
93 (save-excursion 93 (save-excursion
94 (skip-chars-backward " \t") 94 (skip-chars-backward " \t")
95 (bolp))) 95 (bolp)))
96 96
97 (defun xml-lite-in-string-p (&optional limit) 97 (defun xml-lite-in-string-p (&optional limit)
98 "Determine whether point is inside a string." 98 "Determine whether point is inside a string.
99
100 Parse begins from LIMIT, which defaults to the preceding occurence of a tag
101 at the beginning of a line."
99 (let (syntax-info) 102 (let (syntax-info)
100 (or limit 103 (or limit
101 (setq limit (or (save-excursion 104 (setq limit (or (save-excursion
102 (re-search-backward "^[ \t]*<" nil t)) 105 (re-search-backward "^[ \t]*<" nil t))
103 (point-min)))) 106 (point-min))))
104 (setq syntax-info (parse-partial-sexp limit (point))) 107 (setq syntax-info (parse-partial-sexp limit (point)))
105 (if (nth 3 syntax-info) 108 (if (nth 3 syntax-info) (nth 8 syntax-info))))
106 (list (nth 3 syntax-info) (nth 8 syntax-info)))))
107 109
108 110
109 ;; Parsing 111 ;; Parsing
110 (defstruct (xml-lite-tag 112 (defstruct (xml-lite-tag
111 (:constructor xml-lite-make-tag (type start end name name-end))) 113 (:constructor xml-lite-make-tag (type start end name name-end)))