Function: verilog-save-buffer-state

verilog-save-buffer-state is a macro defined in verilog-mode.el.gz.

Signature

(verilog-save-buffer-state &rest BODY)

Documentation

Execute BODY forms, saving state around insignificant change.

Changes in text properties like face or syntax-table are considered insignificant. This macro allows text properties to be changed, even in a read-only buffer.

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.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/verilog-mode.el.gz
;;
;; Buffer state preservation

(defmacro verilog-save-buffer-state (&rest body)
  "Execute BODY forms, saving state around insignificant change.
Changes in text properties like `face' or `syntax-table' are
considered insignificant.  This macro allows text properties to
be changed, even in a read-only buffer.

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)
         (verilog-no-change-functions t))
     ,(if (fboundp 'with-silent-modifications)
          `(with-silent-modifications ,@body)
        ;; Backward compatible version of with-silent-modifications
        `(let* ((modified (buffer-modified-p))
                (buffer-undo-list t)
                (inhibit-read-only t)
                (inhibit-modification-hooks t)
                ;; XEmacs ignores inhibit-modification-hooks.
                before-change-functions after-change-functions
                deactivate-mark
                buffer-file-name        ; Prevent primitives checking
                buffer-file-truename)	; for file modification
           (unwind-protect
               (progn ,@body)
             (and (not modified)
                  (buffer-modified-p)
                  (verilog-restore-buffer-modified-p nil)))))))