Function: verilog-save-font-no-change-functions

verilog-save-font-no-change-functions is a macro defined in verilog-mode.el.gz.

Signature

(verilog-save-font-no-change-functions &rest BODY)

Documentation

Execute BODY forms, disabling all change hooks in BODY.

Includes temporary disabling of font-lock to restore the buffer to full text form for parsing. Additional actions may be specified with verilog-before-save-font-hook and verilog-after-save-font-hook. For insignificant changes, see instead verilog-save-buffer-state.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
(defmacro verilog-save-font-no-change-functions (&rest body)
 "Execute BODY forms, disabling all change hooks in BODY.
Includes temporary disabling of `font-lock' to restore the buffer
to full text form for parsing.  Additional actions may be specified with
`verilog-before-save-font-hook' and `verilog-after-save-font-hook'.
For insignificant changes, see instead `verilog-save-buffer-state'."
 `(if verilog-save-font-mod-hooked ; Short-circuit a recursive call
      (progn ,@body)
    ;; Before version 20, match-string with font-lock returns a
    ;; vector that is not equal to the string.  IE if on "input"
    ;; nil==(equal "input" (progn (looking-at "input") (match-string 0)))
    ;; Therefore we must remove and restore font-lock mode
    (verilog-run-hooks 'verilog-before-save-font-hook)
    (let* ((verilog-save-font-mod-hooked (- (point-max) (point-min)))
           ;; Significant speed savings with no font-lock properties
           (fontlocked (when font-lock-mode
                         (font-lock-mode 0)
                         t)))
      (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)
                 (inhibit-modification-hooks t)
                 (verilog-no-change-functions t)
                 ;; XEmacs and pre-Emacs 21 ignore inhibit-modification-hooks.
                 before-change-functions after-change-functions)
            (progn ,@body))
        ;; Unwind forms
        (run-hook-with-args 'after-change-functions (point-min) (point-max)
                            verilog-save-font-mod-hooked) ; old length
        (when fontlocked (font-lock-mode t))
        (verilog-run-hooks 'verilog-after-save-font-hook)))))