aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Snyder2015-11-21 14:29:38 -0500
committerWilson Snyder2015-11-21 14:29:38 -0500
commitea78129522f428888607151e4f91ade1f4839f3f (patch)
tree14e719fcf0538c03c6cfd548fa8300c4e443d54c
parente53b310fdecd7e3f130295b85b15289046d7a430 (diff)
downloademacs-ea78129522f428888607151e4f91ade1f4839f3f.tar.gz
emacs-ea78129522f428888607151e4f91ade1f4839f3f.zip
verilog-mode.el: Commentary and fix pre-Emacs 21 behavior.
* verilog-mode.el (verilog-save-font-no-change-functions): Commentary and fix pre-Emacs 21 behavior.
-rw-r--r--lisp/progmodes/verilog-mode.el19
1 files changed, 7 insertions, 12 deletions
diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el
index 3081060f46a..4095d47b5a9 100644
--- a/lisp/progmodes/verilog-mode.el
+++ b/lisp/progmodes/verilog-mode.el
@@ -123,7 +123,7 @@
123;; 123;;
124 124
125;; This variable will always hold the version number of the mode 125;; This variable will always hold the version number of the mode
126(defconst verilog-mode-version "2015-11-09-b121d60-vpo-GNU" 126(defconst verilog-mode-version "2015-11-21-8112ca0-vpo-GNU"
127 "Version of this Verilog mode.") 127 "Version of this Verilog mode.")
128(defconst verilog-mode-release-emacs t 128(defconst verilog-mode-release-emacs t
129 "If non-nil, this version of Verilog mode was released with Emacs itself.") 129 "If non-nil, this version of Verilog mode was released with Emacs itself.")
@@ -3238,7 +3238,7 @@ user-visible changes to the buffer must not be within a
3238 (verilog-no-change-functions t)) 3238 (verilog-no-change-functions t))
3239 ,(if (fboundp 'with-silent-modifications) 3239 ,(if (fboundp 'with-silent-modifications)
3240 `(with-silent-modifications ,@body) 3240 `(with-silent-modifications ,@body)
3241 ;; From c-save-buffer-state 3241 ;; Backward compatible version of with-silent-modifications
3242 `(let* ((modified (buffer-modified-p)) 3242 `(let* ((modified (buffer-modified-p))
3243 (buffer-undo-list t) 3243 (buffer-undo-list t)
3244 (inhibit-read-only t) 3244 (inhibit-read-only t)
@@ -3252,9 +3252,7 @@ user-visible changes to the buffer must not be within a
3252 (progn ,@body) 3252 (progn ,@body)
3253 (and (not modified) 3253 (and (not modified)
3254 (buffer-modified-p) 3254 (buffer-modified-p)
3255 (if (fboundp 'restore-buffer-modified-p) 3255 (verilog-restore-buffer-modified-p nil)))))))
3256 (restore-buffer-modified-p nil)
3257 (set-buffer-modified-p nil))))))))
3258 3256
3259 3257
3260(defvar verilog-save-font-mod-hooked nil 3258(defvar verilog-save-font-mod-hooked nil
@@ -3267,7 +3265,7 @@ Includes temporary disabling of `font-lock' to restore the buffer
3267to full text form for parsing. Additional actions may be specified with 3265to full text form for parsing. Additional actions may be specified with
3268`verilog-before-save-font-hook' and `verilog-after-save-font-hook'. 3266`verilog-before-save-font-hook' and `verilog-after-save-font-hook'.
3269For insignificant changes, see instead `verilog-save-buffer-state'." 3267For insignificant changes, see instead `verilog-save-buffer-state'."
3270 `(if verilog-save-font-mod-hooked ; A recursive call? 3268 `(if verilog-save-font-mod-hooked ; Short-circuit a recursive call
3271 (progn ,@body) 3269 (progn ,@body)
3272 ;; Before version 20, match-string with font-lock returns a 3270 ;; Before version 20, match-string with font-lock returns a
3273 ;; vector that is not equal to the string. IE if on "input" 3271 ;; vector that is not equal to the string. IE if on "input"
@@ -3275,8 +3273,7 @@ For insignificant changes, see instead `verilog-save-buffer-state'."
3275 ;; Therefore we must remove and restore font-lock mode 3273 ;; Therefore we must remove and restore font-lock mode
3276 (verilog-run-hooks 'verilog-before-save-font-hook) 3274 (verilog-run-hooks 'verilog-before-save-font-hook)
3277 (let* ((verilog-save-font-mod-hooked (- (point-max) (point-min))) 3275 (let* ((verilog-save-font-mod-hooked (- (point-max) (point-min)))
3278 ;; FIXME: Doesn't the before/after-change-functions dance make this 3276 ;; Significant speed savings with no font-lock properties
3279 ;; font-lock-mode dance unnecessary?
3280 (fontlocked (when (and (boundp 'font-lock-mode) font-lock-mode) 3277 (fontlocked (when (and (boundp 'font-lock-mode) font-lock-mode)
3281 (font-lock-mode 0) 3278 (font-lock-mode 0)
3282 t))) 3279 t)))
@@ -3286,10 +3283,8 @@ For insignificant changes, see instead `verilog-save-buffer-state'."
3286 (let* ((inhibit-point-motion-hooks t) 3283 (let* ((inhibit-point-motion-hooks t)
3287 (inhibit-modification-hooks t) 3284 (inhibit-modification-hooks t)
3288 (verilog-no-change-functions t) 3285 (verilog-no-change-functions t)
3289 ,@(when (featurep 'xemacs) 3286 ;; XEmacs and pre-Emacs 21 ignore inhibit-modification-hooks.
3290 ;; XEmacs ignores inhibit-modification-hooks. 3287 before-change-functions after-change-functions)
3291 '(before-change-functions
3292 after-change-functions)))
3293 (progn ,@body)) 3288 (progn ,@body))
3294 ;; Unwind forms 3289 ;; Unwind forms
3295 (run-hook-with-args 'after-change-functions (point-min) (point-max) 3290 (run-hook-with-args 'after-change-functions (point-min) (point-max)