Function: hfy-save-buffer-state

hfy-save-buffer-state is a macro defined in htmlfontify.el.gz.

Signature

(hfy-save-buffer-state VARLIST &rest BODY)

Documentation

Bind variables according to VARLIST and eval BODY restoring buffer state.

Do not record undo information during evaluation of BODY.

Source Code

;; Defined in /usr/src/emacs/lisp/htmlfontify.el.gz
;; Borrowed from font-lock.el
(defmacro hfy-save-buffer-state (varlist &rest body)
  "Bind variables according to VARLIST and eval BODY restoring buffer state.
Do not record undo information during evaluation of BODY."
  (declare (indent 1) (debug let))
  (let ((modified (make-symbol "modified")))
    `(let* ,(append varlist
                    `((,modified (buffer-modified-p))
                      (buffer-undo-list t)
                      (inhibit-read-only t)
                      (inhibit-point-motion-hooks t)
                      (inhibit-modification-hooks t)
                      deactivate-mark
                      buffer-file-name
                      buffer-file-truename))
       (progn
         ,@body)
       (unless ,modified
         (restore-buffer-modified-p nil)))))