]> code.delx.au - gnu-emacs/blobdiff - lisp/jit-lock.el
Fix typos in docstrings.
[gnu-emacs] / lisp / jit-lock.el
index 384771e4f25a1a212bd9dc79daf7a8634d216ca4..dbe1cbe23e1b54e75a5865a8e64b352185a6852c 100644 (file)
@@ -1,7 +1,7 @@
 ;;; jit-lock.el --- just-in-time fontification
 
 ;; Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
 ;; Keywords: faces files
     "Execute BODY in current buffer, overriding several variables.
 Preserves the `buffer-modified-p' state of the current buffer."
     (declare (debug t))
-    `(with-buffer-unmodified
-      (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)
-       ,@body))))
+    `(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))))
 
 
 \f
@@ -414,7 +416,7 @@ Defaults to the whole buffer.  END can be out of bounds."
 ;;; Stealth fontification.
 
 (defsubst jit-lock-stealth-chunk-start (around)
-  "Return the start of the next chunk to fontify around position AROUND..
+  "Return the start of the next chunk to fontify around position AROUND.
 Value is nil if there is nothing more to fontify."
   (if (zerop (buffer-size))
       nil