From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dirk80 Newsgroups: gmane.emacs.help Subject: dired and multi-occur Date: Fri, 4 Dec 2009 07:30:13 -0800 (PST) Message-ID: <26635922.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1259940657 9489 80.91.229.12 (4 Dec 2009 15:30:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Dec 2009 15:30:57 +0000 (UTC) To: Help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 04 16:30:51 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NGa7N-0004hj-1S for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Dec 2009 16:30:49 +0100 Original-Received: from localhost ([127.0.0.1]:58009 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGa7M-0004fB-NH for geh-help-gnu-emacs@m.gmane.org; Fri, 04 Dec 2009 10:30:48 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGa6w-0004dO-03 for help-gnu-emacs@gnu.org; Fri, 04 Dec 2009 10:30:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGa6q-0004aJ-4b for Help-gnu-emacs@gnu.org; Fri, 04 Dec 2009 10:30:20 -0500 Original-Received: from [199.232.76.173] (port=57305 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGa6p-0004Zx-Um for Help-gnu-emacs@gnu.org; Fri, 04 Dec 2009 10:30:15 -0500 Original-Received: from kuber.nabble.com ([216.139.236.158]:46795) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGa6p-00050K-Mm for Help-gnu-emacs@gnu.org; Fri, 04 Dec 2009 10:30:15 -0500 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NGa6n-0003kE-Aq for Help-gnu-emacs@gnu.org; Fri, 04 Dec 2009 07:30:13 -0800 X-Nabble-From: dirk@dirkundsari.de X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70394 Archived-At: 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.