From: Richard M. Stallman Date: Thu, 24 Nov 1994 08:39:41 +0000 (+0000) Subject: (occur): Put number of matches in the header line. X-Git-Tag: emacs-19.34~5786 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e6d63effab89e9d13dd47feb6bbce5f1b6fbd52f;p=emacs.git (occur): Put number of matches in the header line. --- 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. (with-output-to-temp-buffer "*Occur*" (save-excursion (set-buffer standard-output) - (insert "Lines matching ") + ;; We will insert the number of lines, and "lines", later. + (insert " matching ") (prin1 regexp) (insert " in buffer " (buffer-name buffer) ?. ?\n) (occur-mode) @@ -425,6 +426,10 @@ It serves as a menu to find any of the occurrences in this buffer. (set-buffer standard-output) ;; Put positions in increasing order to go with buffer. (setq occur-pos-list (nreverse occur-pos-list)) + (goto-char (point-min)) + (if (= (length occur-pos-list) 1) + (insert "1 line") + (insert (format "%d lines" (length occur-pos-list)))) (if (interactive-p) (message "%d matching lines." (length occur-pos-list)))))))