# HG changeset patch # User Juanma Barranquero # Date 1119580799 0 # Node ID c11482ba7b966153a1893244b12cc5b8da2a2eb2 # Parent cad79f2ac120514aaf50206b4de2c6f8ea4b503e (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. diff -r cad79f2ac120 -r c11482ba7b96 lisp/replace.el --- 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