mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-05-31 01:32:00 -07:00
Fix 'sgml-parse-tag-backward' to handle tags in comments
* lisp/textmodes/sgml-mode.el (sgml--find-<>-backward): Ignore SGML tags that happen to occur within comments. This also means that the contents of comments are not indented, but also do not affect the indentation of tags following the comments as well. (Bug#80841)
This commit is contained in:
parent
09dc864b0b
commit
7eab6ef3ce
1 changed files with 7 additions and 1 deletions
|
|
@ -1397,7 +1397,13 @@ Returns t if found, nil otherwise."
|
||||||
(while (re-search-backward "[<>]" limit 'move)
|
(while (re-search-backward "[<>]" limit 'move)
|
||||||
;; If this character has "open" or "close" syntax, then we've
|
;; If this character has "open" or "close" syntax, then we've
|
||||||
;; found the one we want.
|
;; found the one we want.
|
||||||
(when (memq (syntax-class (syntax-after (point))) '(4 5))
|
(when (and (memq (syntax-class (syntax-after (point))) '(4 5))
|
||||||
|
;; We want to ignore tags in comments. We could also
|
||||||
|
;; check `syntax-ppss', but that can become expensive
|
||||||
|
;; in a busy loop, so we re-use the face instead.
|
||||||
|
(not (memq (get-text-property (point) 'face)
|
||||||
|
'(font-lock-comment-delimiter-face
|
||||||
|
font-lock-comment-face))))
|
||||||
(throw 'found t)))))
|
(throw 'found t)))))
|
||||||
|
|
||||||
(defun sgml-parse-tag-backward (&optional limit)
|
(defun sgml-parse-tag-backward (&optional limit)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue