From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.help Subject: Re: Opening a Dired buffer with an arbitrary list of files. Date: Mon, 22 May 2006 22:48:23 +0900 Message-ID: <87odxqjhlk.fsf@catnip.gol.com> References: <68816b4c0605190734r52b29978w7d41ef5393e43246@mail.gmail.com> Reply-To: Miles Bader NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1148305853 1233 80.91.229.2 (22 May 2006 13:50:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 May 2006 13:50:53 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon May 22 15:50:50 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FiAnI-0008Kv-N9 for geh-help-gnu-emacs@m.gmane.org; Mon, 22 May 2006 15:50:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FiAnI-0002As-AG for geh-help-gnu-emacs@m.gmane.org; Mon, 22 May 2006 09:50:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FiAlu-0001Ua-Fb for help-gnu-emacs@gnu.org; Mon, 22 May 2006 09:48:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FiAls-0001Tb-68 for help-gnu-emacs@gnu.org; Mon, 22 May 2006 09:48:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FiAlr-0001TV-Vs for help-gnu-emacs@gnu.org; Mon, 22 May 2006 09:48:32 -0400 Original-Received: from [203.216.5.72] (helo=smtp02.dentaku.gol.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FiApq-0008Fa-CK; Mon, 22 May 2006 09:52:38 -0400 Original-Received: from 203-216-101-054.dsl.gol.ne.jp ([203.216.101.54] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1FiAlm-0008IU-OQ; Mon, 22 May 2006 22:48:26 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id A2EA92F56; Mon, 22 May 2006 22:48:24 +0900 (JST) Original-To: help-gnu-emacs@gnu.org System-Type: i686-pc-linux-gnu In-Reply-To: (Mathias Dahl's message of "Mon, 22 May 2006 08:42:40 +0200") Original-Lines: 22 X-Abuse-Complaints: abuse@gol.com 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:35206 Archived-At: Mathias Dahl writes: > (defun gds-dired-2 () > "Use Google Desktop Search to find files and list them in dired. > It generates a result like `find-dired' does, but uses Google > Desktop Search to find matching files." > (interactive) > (let ((dir (read-directory-name "Set current directory: ")) > (search (read-string "Search string: "))) > (dired (cons dir (gds-get-matching-files > search gds-dired-number-of-hits))))) A bit shorter still (and demonstrating the typical use of `interactive'): (defun gds-dired-3 (dir pattern) "Use Google Desktop Search to find files in DIR matching PATTERN and list them in dired." (interactive "DSearch directory: \nsSearch pattern: ") (dired (cons dir (gds-get-matching-files pattern gds-dired-number-of-hits)))) -miles -- .Numeric stability is probably not all that important when you're guessing.