From: Juanma Barranquero Date: Sun, 3 Jul 2005 22:49:00 +0000 (+0000) Subject: (occur-hook): Doc fix. X-Git-Tag: emacs-pretest-22.0.90~8469 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c7d2f2cc466edb01728256900b6cf92b5e6906e5;p=emacs.git (occur-hook): Doc fix. (occur-1): Don't call `occur-hook' if there are no matches. --- diff --git a/lisp/replace.el b/lisp/replace.el index 7e3dd984150..3b93761a0cc 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -719,7 +719,7 @@ See `occur-revert-function'.") :group 'matching) (defcustom occur-hook nil - "Hook run when `occur' is called." + "Hook run by Occur when there are any matches." :type 'hook :group 'matching) @@ -1042,14 +1042,13 @@ See also `multi-occur'." (if (= count 1) "" "es") regexp)) (setq occur-revert-arguments (list regexp nlines bufs)) - (if (> count 0) - (progn - (display-buffer occur-buf) - (setq next-error-last-buffer occur-buf) - (setq buffer-read-only t) - (set-buffer-modified-p nil)) - (kill-buffer occur-buf))) - (run-hooks 'occur-hook))))) + (if (= count 0) + (kill-buffer occur-buf) + (display-buffer occur-buf) + (setq next-error-last-buffer occur-buf) + (setq buffer-read-only t) + (set-buffer-modified-p nil) + (run-hooks 'occur-hook))))))) (defun occur-engine-add-prefix (lines) (mapcar