620 |
;; We use this to preserve or protect things when modifying text properties. |
;; We use this to preserve or protect things when modifying text properties. |
621 |
(defmacro save-buffer-state (varlist &rest body) |
(defmacro save-buffer-state (varlist &rest body) |
622 |
"Bind variables according to VARLIST and eval BODY restoring buffer state." |
"Bind variables according to VARLIST and eval BODY restoring buffer state." |
623 |
|
(declare (indent 1) (debug let)) |
624 |
(let ((modified (make-symbol "modified"))) |
(let ((modified (make-symbol "modified"))) |
625 |
`(let* ,(append varlist |
`(let* ,(append varlist |
626 |
`((,modified (buffer-modified-p)) |
`((,modified (buffer-modified-p)) |
635 |
,@body) |
,@body) |
636 |
(unless ,modified |
(unless ,modified |
637 |
(restore-buffer-modified-p nil))))) |
(restore-buffer-modified-p nil))))) |
|
(put 'save-buffer-state 'lisp-indent-function 1) |
|
|
(def-edebug-spec save-buffer-state let) |
|
638 |
;; |
;; |
639 |
;; Shut up the byte compiler. |
;; Shut up the byte compiler. |
640 |
(defvar font-lock-face-attributes)) ; Obsolete but respected if set. |
(defvar font-lock-face-attributes)) ; Obsolete but respected if set. |