diff options
| author | Richard M. Stallman | 1994-11-24 08:39:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-11-24 08:39:41 +0000 |
| commit | e6d63effab89e9d13dd47feb6bbce5f1b6fbd52f (patch) | |
| tree | 03237628e8f70368639eebd8bf73e44311d56b8b /lisp/replace.el | |
| parent | cab856b0854eefa8401544e0cc75ee38e914139e (diff) | |
| download | emacs-e6d63effab89e9d13dd47feb6bbce5f1b6fbd52f.tar.gz emacs-e6d63effab89e9d13dd47feb6bbce5f1b6fbd52f.zip | |
(occur): Put number of matches in the header line.
Diffstat (limited to 'lisp/replace.el')
| -rw-r--r-- | lisp/replace.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 10c41344006..886748d1713 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -352,7 +352,8 @@ It serves as a menu to find any of the occurrences in this buffer. | |||
| 352 | (with-output-to-temp-buffer "*Occur*" | 352 | (with-output-to-temp-buffer "*Occur*" |
| 353 | (save-excursion | 353 | (save-excursion |
| 354 | (set-buffer standard-output) | 354 | (set-buffer standard-output) |
| 355 | (insert "Lines matching ") | 355 | ;; We will insert the number of lines, and "lines", later. |
| 356 | (insert " matching ") | ||
| 356 | (prin1 regexp) | 357 | (prin1 regexp) |
| 357 | (insert " in buffer " (buffer-name buffer) ?. ?\n) | 358 | (insert " in buffer " (buffer-name buffer) ?. ?\n) |
| 358 | (occur-mode) | 359 | (occur-mode) |
| @@ -425,6 +426,10 @@ It serves as a menu to find any of the occurrences in this buffer. | |||
| 425 | (set-buffer standard-output) | 426 | (set-buffer standard-output) |
| 426 | ;; Put positions in increasing order to go with buffer. | 427 | ;; Put positions in increasing order to go with buffer. |
| 427 | (setq occur-pos-list (nreverse occur-pos-list)) | 428 | (setq occur-pos-list (nreverse occur-pos-list)) |
| 429 | (goto-char (point-min)) | ||
| 430 | (if (= (length occur-pos-list) 1) | ||
| 431 | (insert "1 line") | ||
| 432 | (insert (format "%d lines" (length occur-pos-list)))) | ||
| 428 | (if (interactive-p) | 433 | (if (interactive-p) |
| 429 | (message "%d matching lines." (length occur-pos-list))))))) | 434 | (message "%d matching lines." (length occur-pos-list))))))) |
| 430 | 435 | ||