From: Juanma Barranquero Date: Thu, 30 Jun 2005 13:04:04 +0000 (+0000) Subject: (occur-1): Do not set the `buffer-read-only' and modified flags for the occur X-Git-Tag: emacs-pretest-22.0.90~8549 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=426674a851eec23cb8ac65e69399c36e740caf83;p=emacs.git (occur-1): Do not set the `buffer-read-only' and modified flags for the occur buffer when no matches are found, because the buffer has already been deleted. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b8a790f36d..aa34f19b6bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2005-06-30 Juanma Barranquero + * 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): diff --git a/lisp/replace.el b/lisp/replace.el index 0b19d72178f..c3c5dd263d5 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -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)