Commit c7d2f2cc authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(occur-hook): Doc fix.

(occur-1): Don't call `occur-hook' if there are no matches.
parent ed214edf
...@@ -719,7 +719,7 @@ See `occur-revert-function'.") ...@@ -719,7 +719,7 @@ See `occur-revert-function'.")
:group 'matching) :group 'matching)
(defcustom occur-hook nil (defcustom occur-hook nil
"Hook run when `occur' is called." "Hook run by Occur when there are any matches."
:type 'hook :type 'hook
:group 'matching) :group 'matching)
...@@ -1042,14 +1042,13 @@ See also `multi-occur'." ...@@ -1042,14 +1042,13 @@ See also `multi-occur'."
(if (= count 1) "" "es") (if (= count 1) "" "es")
regexp)) regexp))
(setq occur-revert-arguments (list regexp nlines bufs)) (setq occur-revert-arguments (list regexp nlines bufs))
(if (> count 0) (if (= count 0)
(progn (kill-buffer occur-buf)
(display-buffer occur-buf) (display-buffer occur-buf)
(setq next-error-last-buffer occur-buf) (setq next-error-last-buffer occur-buf)
(setq buffer-read-only t) (setq buffer-read-only t)
(set-buffer-modified-p nil)) (set-buffer-modified-p nil)
(kill-buffer occur-buf))) (run-hooks 'occur-hook)))))))
(run-hooks 'occur-hook)))))
(defun occur-engine-add-prefix (lines) (defun occur-engine-add-prefix (lines)
(mapcar (mapcar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment