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'.")
: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")
(setq occur-revert-arguments (list regexp nlines bufs))
(if (> count 0)
(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))
(kill-buffer occur-buf)))
(run-hooks 'occur-hook)))))
(set-buffer-modified-p nil)
(run-hooks 'occur-hook)))))))
(defun occur-engine-add-prefix (lines)
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