summaryrefslogtreecommitdiff
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2005-06-24 02:41:36 +0000
committerJuanma Barranquero <lekktu@gmail.com>2005-06-24 02:41:36 +0000
commit8346425e35da3b44d5b5f0607740453946b37ec3 (patch)
tree658308daf78b495addd6a4f58761b21b557e2019 /lisp/replace.el
parentb93e3c3ba1644f5e746c7486bd609ba9fc7ec583 (diff)
downloademacs-8346425e35da3b44d5b5f0607740453946b37ec3.tar.gz
(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.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index d5ccd8723c2..2896ce133de 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -1001,9 +1001,9 @@ See also `multi-occur'."
(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