diff options
| author | Juanma Barranquero | 2005-07-03 22:49:00 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2005-07-03 22:49:00 +0000 |
| commit | c7d2f2cc466edb01728256900b6cf92b5e6906e5 (patch) | |
| tree | feb9afe725fc68906b17093972b8af55e28c1df2 /lisp/replace.el | |
| parent | ed214edf5002369e4f5249a93e625a24890387e3 (diff) | |
| download | emacs-c7d2f2cc466edb01728256900b6cf92b5e6906e5.tar.gz emacs-c7d2f2cc466edb01728256900b6cf92b5e6906e5.zip | |
(occur-hook): Doc fix.
(occur-1): Don't call `occur-hook' if there are no matches.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 17 |
1 files changed, 8 insertions, 9 deletions
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'.") | |||
| 719 | :group 'matching) | 719 | :group 'matching) |
| 720 | 720 | ||
| 721 | (defcustom occur-hook nil | 721 | (defcustom occur-hook nil |
| 722 | "Hook run when `occur' is called." | 722 | "Hook run by Occur when there are any matches." |
| 723 | :type 'hook | 723 | :type 'hook |
| 724 | :group 'matching) | 724 | :group 'matching) |
| 725 | 725 | ||
| @@ -1042,14 +1042,13 @@ See also `multi-occur'." | |||
| 1042 | (if (= count 1) "" "es") | 1042 | (if (= count 1) "" "es") |
| 1043 | regexp)) | 1043 | regexp)) |
| 1044 | (setq occur-revert-arguments (list regexp nlines bufs)) | 1044 | (setq occur-revert-arguments (list regexp nlines bufs)) |
| 1045 | (if (> count 0) | 1045 | (if (= count 0) |
| 1046 | (progn | 1046 | (kill-buffer occur-buf) |
| 1047 | (display-buffer occur-buf) | 1047 | (display-buffer occur-buf) |
| 1048 | (setq next-error-last-buffer occur-buf) | 1048 | (setq next-error-last-buffer occur-buf) |
| 1049 | (setq buffer-read-only t) | 1049 | (setq buffer-read-only t) |
| 1050 | (set-buffer-modified-p nil)) | 1050 | (set-buffer-modified-p nil) |
| 1051 | (kill-buffer occur-buf))) | 1051 | (run-hooks 'occur-hook))))))) |
| 1052 | (run-hooks 'occur-hook))))) | ||
| 1053 | 1052 | ||
| 1054 | (defun occur-engine-add-prefix (lines) | 1053 | (defun occur-engine-add-prefix (lines) |
| 1055 | (mapcar | 1054 | (mapcar |