Commit 3f2bfe9a authored by Noam Postavsky's avatar Noam Postavsky

Keep nxml-prolog-end up to date (Bug#18871)

The change on 2016-01-16 "lisp/nxml: Use syntax-tables for comments"
removed the update of nxml-prolog-end, although it already failed to
work correctly after 2013-10-07 "* lisp/nxml/nxml-mode.el: Use
lexical-binding and syntax-propertize."
* lisp/nxml/nxml-rap.el: New function.
* lisp/nxml/nxml-mode.el (nxml-mode): Add it to
after-change-functions.
parent d414c93b
Pipeline #1891 failed with stage
in 5 seconds
......@@ -544,6 +544,7 @@ Many aspects this mode can be customized using
(setq-local syntax-ppss-table sgml-tag-syntax-table)
(setq-local syntax-propertize-function #'nxml-syntax-propertize)
(add-hook 'change-major-mode-hook #'nxml-cleanup nil t)
(add-hook 'after-change-functions #'nxml-maybe-rescan-prolog nil t)
;; Emacs 23 handles the encoding attribute on the xml declaration
;; transparently to nxml-mode, so there is no longer a need for the below
......
......@@ -108,6 +108,12 @@ Return nil if the character at POS is not inside."
(setq nxml-prolog-regions (xmltok-forward-prolog))
(setq nxml-prolog-end (point))))
(defun nxml-maybe-rescan-prolog (start _end _length)
"Reparse the prolog if START lies within it.
`nxml-mode' adds this function on `after-change-functions'."
(when (<= start nxml-prolog-end)
(save-excursion
(nxml-scan-prolog))))
;;; Random access parsing
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment