From: Juanma Barranquero Date: Fri, 24 Jun 2005 02:41:36 +0000 (+0000) Subject: (occur-1): Set `buffer-read-only' and the buffer-modified flag before running X-Git-Tag: emacs-pretest-22.0.90~8669 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8346425e35da3b44d5b5f0607740453946b37ec3;p=emacs.git (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 --git a/lisp/ChangeLog b/lisp/ChangeLog index d850358c01e..f15073167a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,13 +1,19 @@ +2005-06-24 Juanma Barranquero + + * replace.el (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. + 2005-06-24 Nick Roberts * progmodes/gud.el (gud-tooltip-print-command): Indent properly. (gud-gdb-marker-filter): Use font-lock-warning-face for any initial error. - + * progmodes/gdb-ui.el (gdb-send): Remove warning face from errors after fresh input. (gdb-var-create-handler): Put name of expression in quotes. - + 2005-06-23 Luc Teirlinck * emacs-lisp/ring.el (ring-elements): Make it return a list of the @@ -532,7 +538,7 @@ * progmodes/gdb-ui.el (menu): Re-order menu items. (gdb-tooltip-print): Respect tooltip-use-echo-area. - + * progmodes/gud.el (tooltip-use-echo-area): Remove alias. Define in tooltip.el. (gud-tooltip-process-output): Respect tooltip-use-echo-area. 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