all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dired and multi-occur
@ 2009-12-04 15:30 Dirk80
  2009-12-04 18:21 ` Andreas Politz
  2009-12-05  7:59 ` Kevin Rodgers
  0 siblings, 2 replies; 6+ messages in thread
From: Dirk80 @ 2009-12-04 15:30 UTC (permalink / raw)
  To: Help-gnu-emacs


Hi,

I would like to search a string through multiple files. I like multi-occur a
lot. It would be great if it is possible to combine dired and multi-occur. I
want that multi-occur is applied to all marked files.

Let's say the name of the interactive function to do this is
"my-dired-multi-occur". If the user invokes this function via M-x
my-dired-multi-occur the user shall be asked for a search string. All marked
files shall be searched via dired. If the file does not contain the
search-string it shall be closed again.

I tried to write a function doing this. But I'm an elisp newbie and don't
get it.

(defun my-dired-multi-occur (string)
  "Search string in files marked in dired."
  (interactive "MSearch-String:")
  (require 'dired)
  (multi-occur (mapc 'find-file (dired-get-marked-files)) string))

I get the following result, when I'm invoking this function when I have
opened dired and marked three files: M-x my-dired-multi-occur
Search-String: init

Searched 0 buffers (3 killed); no matches for `init'

---
My problem seems to be that multi-occur is not getting a list of buffers.
The other problem I have: How can I close all files which do not contain the
search-string.

Thank you very much for your help in advance.

Dirk
-- 
View this message in context: http://old.nabble.com/dired-and-multi-occur-tp26635922p26635922.html
Sent from the Emacs - Help mailing list archive at Nabble.com.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-09  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.12194.1259940624.2239.help-gnu-emacs@gnu.org>
2009-12-05 14:03 ` dired and multi-occur Michael Heerdegen
2009-12-04 15:30 Dirk80
2009-12-04 18:21 ` Andreas Politz
2009-12-09  9:14   ` Dirk80
2009-12-05  7:59 ` Kevin Rodgers
2009-12-05 10:20   ` Thierry Volpiatto

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.