]> git.eshelyaron.com Git - emacs.git/commitdiff
verilog-mode.el: Don't bind `inhibit-point-motion-hooks`
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Oct 2022 17:54:36 +0000 (13:54 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 7 Oct 2022 17:54:36 +0000 (13:54 -0400)
Keep binding it in Emacs<25 but not in Emacs≥25 (where such bindings
are redundant and the var is declared obsolete).

* lisp/progmodes/verilog-mode.el (verilog-save-buffer-state):
Don't bind `inhibit-point-motion-hooks` if Emacs≥25.
(verilog-save-font-no-change-functions): Same, and refrain from
binding `before/after-change-functions` as well while we're at it,
since `inhibit-modification-hooks` already covers it in Emacs≥25.

lisp/progmodes/verilog-mode.el

index fa799a0fb37e1c0f3342aa6000200098f5ca2877..d6b8edaa365c3f447f071885fb0e1f966f504491 100644 (file)
@@ -3409,7 +3409,8 @@ A change is considered significant if it affects the buffer text
 in any way that isn't completely restored again.  Any
 user-visible changes to the buffer must not be within a
 `verilog-save-buffer-state'."
-  `(let ((inhibit-point-motion-hooks t)
+  `(let (,@(unless (>= emacs-major-version 25)
+             '((inhibit-point-motion-hooks t)))
          (verilog-no-change-functions t))
      ,(if (fboundp 'with-silent-modifications)
           `(with-silent-modifications ,@body)
@@ -3455,11 +3456,13 @@ For insignificant changes, see instead `verilog-save-buffer-state'."
       (run-hook-with-args 'before-change-functions (point-min) (point-max))
       (unwind-protect
           ;; Must inhibit and restore hooks before restoring font-lock
-          (let* ((inhibit-point-motion-hooks t)
+          (let* (,@(unless (>= emacs-major-version 25)
+                     '((inhibit-point-motion-hooks t) ;Obsolete since 25.1
+                       ;; XEmacs and pre-Emacs 21 ignore
+                       ;; `inhibit-modification-hooks'.
+                       before-change-functions after-change-functions))
                  (inhibit-modification-hooks t)
-                 (verilog-no-change-functions t)
-                 ;; XEmacs and pre-Emacs 21 ignore inhibit-modification-hooks.
-                 before-change-functions after-change-functions)
+                 (verilog-no-change-functions t))
             (progn ,@body))
         ;; Unwind forms
         (run-hook-with-args 'after-change-functions (point-min) (point-max)