emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 3c7f05133c: (nxml-with-invisible-motion): Delete macro.


From: Stefan Monnier
Subject: master 3c7f05133c: (nxml-with-invisible-motion): Delete macro.
Date: Fri, 7 Oct 2022 13:26:21 -0400 (EDT)

branch: master
commit 3c7f05133c80ccb48b5adeeed28a36a4039bfe45
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    (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.
---
 lisp/nxml/nxml-mode.el |  6 ++--
 lisp/nxml/nxml-util.el |  6 ----
 lisp/nxml/rng-nxml.el  | 77 +++++++++++++++++++++++++-------------------------
 lisp/nxml/rng-valid.el | 37 ++++++++++++------------
 4 files changed, 58 insertions(+), 68 deletions(-)

diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index dfe5c369e2..9cbab29504 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -536,8 +536,7 @@ Many aspects this mode can be customized using
     (save-restriction
       (widen)
       (with-silent-modifications
-       (nxml-with-invisible-motion
-         (nxml-scan-prolog)))))
+       (nxml-scan-prolog))))
   (setq-local syntax-ppss-table sgml-tag-syntax-table)
   (setq-local syntax-propertize-function #'nxml-syntax-propertize)
   (add-function :filter-return (local 'filter-buffer-substring-function)
@@ -584,8 +583,7 @@ Many aspects this mode can be customized using
   (save-excursion
     (widen)
     (with-silent-modifications
-      (nxml-with-invisible-motion
-       (remove-text-properties (point-min) (point-max) '(face nil)))))
+      (remove-text-properties (point-min) (point-max) '(face nil))))
   (remove-hook 'change-major-mode-hook #'nxml-cleanup t))
 
 (defun nxml-degrade (context err)
diff --git a/lisp/nxml/nxml-util.el b/lisp/nxml/nxml-util.el
index 662d43842e..241c54488f 100644
--- a/lisp/nxml/nxml-util.el
+++ b/lisp/nxml/nxml-util.el
@@ -65,12 +65,6 @@ This is the inverse of `nxml-make-namespace'."
             (nxml-degrade ,context ,error-symbol))))
     `(progn ,@body)))
 
-(defmacro nxml-with-invisible-motion (&rest body)
-  "Evaluate body without calling any point motion hooks."
-  (declare (indent 0) (debug t))
-  `(let ((inhibit-point-motion-hooks t))
-     ,@body))
-
 (defun nxml-display-file-parse-error (err)
   (let* ((filename (nth 1 err))
         (buffer (find-file-noselect filename))
diff --git a/lisp/nxml/rng-nxml.el b/lisp/nxml/rng-nxml.el
index ccbf4d8de2..b1beb19503 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
diff --git a/lisp/nxml/rng-valid.el b/lisp/nxml/rng-valid.el
index ad5c9c7a15..d82c8470d7 100644
--- a/lisp/nxml/rng-valid.el
+++ b/lisp/nxml/rng-valid.el
@@ -441,25 +441,24 @@ The schema is set like `rng-auto-set-schema'."
   (save-excursion
     (save-restriction
       (widen)
-      (nxml-with-invisible-motion
-       (condition-case-unless-debug err
-           (and (rng-validate-prepare)
-                (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context)))
-                  (with-silent-modifications
-                    (rng-do-some-validation-1 continue-p-function))))
-         ;; errors signaled from a function run by an idle timer
-         ;; are ignored; if we don't catch them, validation
-         ;; will get mysteriously stuck at a single place
-         (rng-compile-error
-          (message "Incorrect schema. %s" (nth 1 err))
-          (rng-validate-mode 0)
-          nil)
-         (error
-          (message "Internal error in rng-validate-mode triggered at buffer 
position %d. %s"
-                   (point)
-                   (error-message-string err))
-          (rng-validate-mode 0)
-          nil))))))
+      (condition-case-unless-debug err
+         (and (rng-validate-prepare)
+              (let ((rng-dt-namespace-context-getter '(nxml-ns-get-context)))
+                (with-silent-modifications
+                  (rng-do-some-validation-1 continue-p-function))))
+       ;; errors signaled from a function run by an idle timer
+       ;; are ignored; if we don't catch them, validation
+       ;; will get mysteriously stuck at a single place
+       (rng-compile-error
+        (message "Incorrect schema. %s" (nth 1 err))
+        (rng-validate-mode 0)
+        nil)
+       (error
+        (message "Internal error in rng-validate-mode triggered at buffer 
position %d. %s"
+                 (point)
+                 (error-message-string err))
+        (rng-validate-mode 0)
+        nil)))))
 
 (defun rng-validate-prepare ()
   "Prepare to do some validation, initializing point and the state.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]