aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2016-01-15 16:59:21 -0500
committerStefan Monnier2016-01-15 16:59:21 -0500
commit05988c0d527de99d54266cc3ef0688899761ba26 (patch)
tree4ba92926a612c4bbee489bc6a7989ebbbf87b9f5
parent984a14904658da42ca9dea50a811a901ddc56e60 (diff)
downloademacs-05988c0d527de99d54266cc3ef0688899761ba26.tar.gz
emacs-05988c0d527de99d54266cc3ef0688899761ba26.zip
* xmltok.el: Mark the "sole --" rather than the comment opener
* lisp/nxml/xmltok.el (xmltok-scan-after-comment-open): Put the error marker on the "sole --" rather than on the comment opener.
-rw-r--r--lisp/nxml/xmltok.el27
1 files changed, 9 insertions, 18 deletions
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 8fc66c99a45..93d47c195c0 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -262,11 +262,10 @@ and VALUE-END, otherwise a STRING giving the value."
262 (vector message start end)) 262 (vector message start end))
263 263
264(defun xmltok-add-error (message &optional start end) 264(defun xmltok-add-error (message &optional start end)
265 (setq xmltok-errors 265 (push (xmltok-make-error message
266 (cons (xmltok-make-error message 266 (or start xmltok-start)
267 (or start xmltok-start) 267 (or end (point)))
268 (or end (point))) 268 xmltok-errors))
269 xmltok-errors)))
270 269
271(defun xmltok-forward () 270(defun xmltok-forward ()
272 (setq xmltok-start (point)) 271 (setq xmltok-start (point))
@@ -739,19 +738,11 @@ Return the type of the token."
739 (setq xmltok-type 'processing-instruction)) 738 (setq xmltok-type 'processing-instruction))
740 739
741(defun xmltok-scan-after-comment-open () 740(defun xmltok-scan-after-comment-open ()
742 (let ((found-- (search-forward "--" nil 'move))) 741 (let (found--)
743 (setq xmltok-type 742 (while (and (setq found-- (re-search-forward "--\\(>\\)?" nil 'move))
744 (cond ((or (eq (char-after) ?>) (not found--)) 743 (not (match-end 1)))
745 (goto-char (1+ (point))) 744 (xmltok-add-error "`--' not followed by `>'" (match-beginning 0)))
746 'comment) 745 (setq xmltok-type 'comment)))
747 (t
748 ;; just include the <!-- in the token
749 (goto-char (+ xmltok-start 4))
750 ;; Need do this after the goto-char because
751 ;; marked error should just apply to <!--
752 (xmltok-add-error "First following `--' not followed by `>'")
753 (goto-char (point-max))
754 'comment)))))
755 746
756(defun xmltok-scan-attributes () 747(defun xmltok-scan-attributes ()
757 (let ((recovering nil) 748 (let ((recovering nil)