aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-03-18 04:29:13 +0000
committerRichard M. Stallman2002-03-18 04:29:13 +0000
commitda4f2a4d78d238cd8df172d3877c8728d88b8d93 (patch)
tree9f3f8853a4fc20b5a7b4638b41b1a0727f54ea94
parent9fb980fc3d7a37623511b388a5a999e1abd6b2d0 (diff)
downloademacs-da4f2a4d78d238cd8df172d3877c8728d88b8d93.tar.gz
emacs-da4f2a4d78d238cd8df172d3877c8728d88b8d93.zip
(save-buffer-state):
Bind inhibit-modification-hooks and buffer-file-truename instead of before-change-functions and after-change-functions.
-rw-r--r--lisp/lazy-lock.el14
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/lazy-lock.el b/lisp/lazy-lock.el
index 60cb125960a..11303dfbd92 100644
--- a/lisp/lazy-lock.el
+++ b/lisp/lazy-lock.el
@@ -278,13 +278,17 @@
278 (defmacro save-buffer-state (varlist &rest body) 278 (defmacro save-buffer-state (varlist &rest body)
279 "Bind variables according to VARLIST and eval BODY restoring buffer state." 279 "Bind variables according to VARLIST and eval BODY restoring buffer state."
280 `(let* (,@(append varlist 280 `(let* (,@(append varlist
281 '((modified (buffer-modified-p)) (buffer-undo-list t) 281 '((modified (buffer-modified-p))
282 (inhibit-read-only t) (inhibit-point-motion-hooks t) 282 (buffer-undo-list t)
283 before-change-functions after-change-functions 283 (inhibit-read-only t)
284 deactivate-mark buffer-file-name buffer-file-truename))) 284 (inhibit-point-motion-hooks t)
285 (inhibit-modification-hooks t)
286 deactivate-mark
287 buffer-file-name
288 buffer-file-truename)))
285 ,@body 289 ,@body
286 (when (and (not modified) (buffer-modified-p)) 290 (when (and (not modified) (buffer-modified-p))
287 (set-buffer-modified-p nil)))) 291 (restore-buffer-modified-p nil))))
288 (put 'save-buffer-state 'lisp-indent-function 1) 292 (put 'save-buffer-state 'lisp-indent-function 1)
289 ;; 293 ;;
290 ;; We use this for clarity and speed. Naughty but nice. 294 ;; We use this for clarity and speed. Naughty but nice.