]> git.eshelyaron.com Git - emacs.git/commitdiff
(occur-1): Do not set the `buffer-read-only' and modified flags for the occur
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 30 Jun 2005 13:04:04 +0000 (13:04 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 30 Jun 2005 13:04:04 +0000 (13:04 +0000)
buffer when no matches are found, because the buffer has already been deleted.

lisp/ChangeLog
lisp/replace.el

index 5b8a790f36d0db28e8465c27ce1d16811e7af50c..aa34f19b6bf8c0a47db052dbe58b44a02bc11e86 100644 (file)
@@ -1,5 +1,9 @@
 2005-06-30  Juanma Barranquero  <lekktu@gmail.com>
 
+       * replace.el (occur-1): When no matches are found, do not set the
+       `buffer-read-only' and modified flags for the occur buffer,
+       because it is deleted.
+
        * emulation/cua-base.el (cua-check-pending-input)
        (cua-repeat-replace-region, cua-mode, cua-debug)
        (cua-auto-tabify-rectangles, cua-inhibit-cua-keys):
index 0b19d72178f3b600d681ec635970acbf80613315..c3c5dd263d59fb6df2e8b78e6e15bc2f579d9d79 100644 (file)
@@ -1045,10 +1045,10 @@ See also `multi-occur'."
          (if (> count 0)
              (progn
                (display-buffer occur-buf)
-               (setq next-error-last-buffer occur-buf))
+               (setq next-error-last-buffer occur-buf)
+                (setq buffer-read-only t)
+                (set-buffer-modified-p nil))
            (kill-buffer occur-buf)))
-        (setq buffer-read-only t)
-        (set-buffer-modified-p nil)
        (run-hooks 'occur-hook)))))
 
 (defun occur-engine-add-prefix (lines)