changeset 63736:c11482ba7b96

(occur-1): Set `buffer-read-only' and the buffer-modified flag before running `occur-hook' to protect against unintentional buffer switches that can lead to data loss.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 24 Jun 2005 02:39:59 +0000
parents cad79f2ac120
children bb1e4cc9c7e9
files lisp/replace.el
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/replace.el	Fri Jun 24 01:49:25 2005 +0000
+++ b/lisp/replace.el	Fri Jun 24 02:39:59 2005 +0000
@@ -1001,9 +1001,9 @@
 		(display-buffer occur-buf)
 		(setq next-error-last-buffer occur-buf))
 	    (kill-buffer occur-buf)))
-	(run-hooks 'occur-hook))
-      (setq buffer-read-only t)
-      (set-buffer-modified-p nil))))
+        (setq buffer-read-only t)
+        (set-buffer-modified-p nil)
+	(run-hooks 'occur-hook)))))
 
 (defun occur-engine-add-prefix (lines)
   (mapcar