diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-02-03 13:58:41 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-02-03 13:58:41 +0000 |
commit | 0a7114a4e535e70b237b15817988344a03fe7ab1 (patch) | |
tree | 62203ebf84b3070c638cbea265d25fe542514cc0 /lisp/replace.el | |
parent | eb2bfdae0a1b6579908f072ab57aec0d80d6c6ec (diff) | |
parent | c36f1e67800423383832447c45e6125bf46efc7a (diff) | |
download | emacs-0a7114a4e535e70b237b15817988344a03fe7ab1.tar.gz |
Merged from
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-32
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-33
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-34
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-35
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-36
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-37
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-8
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-9
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-10
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-11
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-12
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-13
Merge from emacs--devo--0
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-504
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 46f672a8d1a..92b4be7fd7b 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -973,7 +973,8 @@ the matching is case-sensitive." (defun multi-occur (bufs regexp &optional nlines) "Show all lines in buffers BUFS containing a match for REGEXP. This function acts on multiple buffers; otherwise, it is exactly like -`occur'." +`occur'. When you invoke this command interactively, you must specify +the buffer names that you want, one by one." (interactive (cons (let* ((bufs (list (read-buffer "First buffer to search: " @@ -993,15 +994,19 @@ This function acts on multiple buffers; otherwise, it is exactly like (occur-read-primary-args))) (occur-1 regexp nlines bufs)) -(defun multi-occur-by-filename-regexp (bufregexp regexp &optional nlines) - "Show all lines matching REGEXP in buffers named by BUFREGEXP. +(defun multi-occur-in-matching-buffers (bufregexp regexp &optional allbufs) + "Show all lines matching REGEXP in buffers specified by BUFREGEXP. +Normally BUFREGEXP matches against each buffer's visited file name, +but if you specify a prefix argument, it matches against the buffer name. See also `multi-occur'." (interactive (cons (let* ((default (car regexp-history)) (input (read-from-minibuffer - "List lines in buffers whose filename matches regexp: " + (if current-prefix-arg + "List lines in buffers whose names match regexp: " + "List lines in buffers whose filenames match regexp: ") nil nil nil @@ -1011,12 +1016,15 @@ See also `multi-occur'." input)) (occur-read-primary-args))) (when bufregexp - (occur-1 regexp nlines + (occur-1 regexp nil (delq nil (mapcar (lambda (buf) - (when (and (buffer-file-name buf) - (string-match bufregexp - (buffer-file-name buf))) + (when (if allbufs + (string-match bufregexp + (buffer-name buf)) + (and (buffer-file-name buf) + (string-match bufregexp + (buffer-file-name buf)))) buf)) (buffer-list)))))) |