From: Stefan Monnier Date: Fri, 7 Oct 2022 17:54:36 +0000 (-0400) Subject: verilog-mode.el: Don't bind `inhibit-point-motion-hooks` X-Git-Tag: emacs-29.0.90~1616^2~709 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c61010567f418e38dad2fcdc4e102c0561ce23c3;p=emacs.git verilog-mode.el: Don't bind `inhibit-point-motion-hooks` 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. --- diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index fa799a0fb37..d6b8edaa365 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -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)