summaryrefslogtreecommitdiff
path: root/lisp/jit-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-08-30 15:57:42 +0200
committerStefan Monnier <monnier@iro.umontreal.ca>2010-08-30 15:57:42 +0200
commitd36b74ca27f877023620d33ca05f2b5b2ccb05cd (patch)
tree2320cbbc070586fbf342f47ec4bfefa156dbbd3f /lisp/jit-lock.el
parentf291fe60fb9ed250ded34b6b9ed26e085f119a4e (diff)
downloademacs-d36b74ca27f877023620d33ca05f2b5b2ccb05cd.tar.gz
Use with-silent-modifications.
* lisp/composite.el (save-buffer-state): Delete, unused. * lisp/font-lock.el (save-buffer-state): Use with-silent-modifications. (font-lock-default-fontify-region): Use with-syntax-table. * lisp/jit-lock.el (with-buffer-unmodified): Remove. (with-buffer-prepared-for-jit-lock): Use with-silent-modifications.
Diffstat (limited to 'lisp/jit-lock.el')
-rw-r--r--lisp/jit-lock.el26
1 files changed, 3 insertions, 23 deletions
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index 1bc61d8d9fc..cc250567ad8 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -32,33 +32,13 @@
(eval-when-compile
(require 'cl)
- (defmacro with-buffer-unmodified (&rest body)
- "Eval BODY, preserving the current buffer's modified state."
- (declare (debug t))
- (let ((modified (make-symbol "modified")))
- `(let ((,modified (buffer-modified-p)))
- (unwind-protect
- (progn ,@body)
- (unless ,modified
- (restore-buffer-modified-p nil))))))
-
(defmacro with-buffer-prepared-for-jit-lock (&rest body)
"Execute BODY in current buffer, overriding several variables.
Preserves the `buffer-modified-p' state of the current buffer."
(declare (debug t))
- `(let ((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)
- ;; Do reset the modification status from within the let, since
- ;; otherwise set-buffer-modified-p may try to unlock the file.
- (with-buffer-unmodified
- ,@body))))
-
-
+ `(let ((inhibit-point-motion-hooks t))
+ (with-silent-modifications
+ ,@body))))
;;; Customization.