]> git.eshelyaron.com Git - emacs.git/commitdiff
(occur-1): Set `buffer-read-only' and the buffer-modified flag before running
authorJuanma Barranquero <lekktu@gmail.com>
Fri, 24 Jun 2005 02:41:36 +0000 (02:41 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Fri, 24 Jun 2005 02:41:36 +0000 (02:41 +0000)
`occur-hook' to protect against unintentional buffer switches that can lead to
data loss.

lisp/ChangeLog
lisp/replace.el

index d850358c01e1d83d76b12689e07e139bd8e7b0f7..f15073167a2563e27ee3c4c6df26fad3179d06e8 100644 (file)
@@ -1,13 +1,19 @@
+2005-06-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * 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  <nickrob@snap.net.nz>
 
        * 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  <teirllm@auburn.edu>
 
        * emacs-lisp/ring.el (ring-elements): Make it return a list of the
 
        * 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.
index d5ccd8723c239f77bef65cb0e5fc07f881a472d6..2896ce133de93538684d11facef00ceb677e0601 100644 (file)
@@ -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