diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-07 13:25:36 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-10-07 13:25:36 -0400 |
commit | 3c7f05133c80ccb48b5adeeed28a36a4039bfe45 (patch) | |
tree | 6151dc0db54db9658d54e62431f66d593e50e370 /lisp/nxml/rng-nxml.el | |
parent | 42fd433acabc97cec035748be0508234bda39750 (diff) | |
download | emacs-3c7f05133c80ccb48b5adeeed28a36a4039bfe45.tar.gz emacs-3c7f05133c80ccb48b5adeeed28a36a4039bfe45.tar.bz2 emacs-3c7f05133c80ccb48b5adeeed28a36a4039bfe45.zip |
(nxml-with-invisible-motion): Delete macro.
Don't use this macro any more since it doesn't do anything since Emacs-25
changed the default of `inhibit-point-motion-hooks` to t.
* lisp/nxml/nxml-util.el (nxml-with-invisible-motion): Delete macro.
* lisp/nxml/nxml-mode.el (nxml-mode, nxml-cleanup):
* lisp/nxml/rng-valid.el (rng-do-some-validation):
* lisp/nxml/rng-nxml.el (rng-set-state-after): Don't use it.
Diffstat (limited to 'lisp/nxml/rng-nxml.el')
-rw-r--r-- | lisp/nxml/rng-nxml.el | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el index ccbf4d8de2e..b1beb195032 100644 --- a/lisp/nxml/rng-nxml.el +++ b/lisp/nxml/rng-nxml.el @@ -366,45 +366,44 @@ set `xmltok-dtd'. Returns the position of the end of the token." (save-excursion (save-restriction (widen) - (nxml-with-invisible-motion - (if (= pos (point-min)) - (rng-set-initial-state) - (let ((state (get-text-property (1- pos) 'rng-state))) - (cond (state - (rng-restore-state state) - (goto-char pos)) - (t - (let ((start (previous-single-property-change pos - 'rng-state))) - (cond (start - (rng-restore-state (get-text-property (1- start) - 'rng-state)) - (goto-char start)) - (t (rng-set-initial-state)))))))) - (xmltok-save - (if (= (point) 1) - (xmltok-forward-prolog) - (setq xmltok-dtd rng-dtd)) - (cond ((and (< pos (point)) - ;; This handles the case where the prolog ends - ;; with a < without any following name-start - ;; character. This will be treated by the parser - ;; as part of the prolog, but we want to treat - ;; it as the start of the instance. - (eq (char-after pos) ?<) - (<= (point) - (save-excursion - (goto-char (1+ pos)) - (skip-chars-forward " \t\r\n") - (point)))) - pos) - ((< (point) pos) - (let ((rng-dt-namespace-context-getter - '(nxml-ns-get-context)) - (rng-parsing-for-state t)) - (rng-forward pos)) - (point)) - (t pos))))))) + (if (= pos (point-min)) + (rng-set-initial-state) + (let ((state (get-text-property (1- pos) 'rng-state))) + (cond (state + (rng-restore-state state) + (goto-char pos)) + (t + (let ((start (previous-single-property-change pos + 'rng-state))) + (cond (start + (rng-restore-state (get-text-property (1- start) + 'rng-state)) + (goto-char start)) + (t (rng-set-initial-state)))))))) + (xmltok-save + (if (= (point) 1) + (xmltok-forward-prolog) + (setq xmltok-dtd rng-dtd)) + (cond ((and (< pos (point)) + ;; This handles the case where the prolog ends + ;; with a < without any following name-start + ;; character. This will be treated by the parser + ;; as part of the prolog, but we want to treat + ;; it as the start of the instance. + (eq (char-after pos) ?<) + (<= (point) + (save-excursion + (goto-char (1+ pos)) + (skip-chars-forward " \t\r\n") + (point)))) + pos) + ((< (point) pos) + (let ((rng-dt-namespace-context-getter + '(nxml-ns-get-context)) + (rng-parsing-for-state t)) + (rng-forward pos)) + (point)) + (t pos)))))) (defun rng-adjust-state-for-attribute (lt-pos start) (xmltok-save |