# HG changeset patch # User Richard M. Stallman # Date 785666381 0 # Node ID badc25c577804c67b5a9b1a0f2d5dab4b9171977 # Parent 1f0008bd7e46c5e310d665c7f499ac313253e9f4 (occur): Put number of matches in the header line. diff -r 1f0008bd7e46 -r badc25c57780 lisp/replace.el --- a/lisp/replace.el Thu Nov 24 01:44:59 1994 +0000 +++ b/lisp/replace.el Thu Nov 24 08:39:41 1994 +0000 @@ -352,7 +352,8 @@ (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 @@ (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)))))))