From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Interactively finding file in a list of directories Date: Fri, 9 Mar 2007 08:20:18 -0800 Message-ID: References: <6dbd4d000703090752q5067f8e3i69d74d07d9cb51fd@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173457313 22033 80.91.229.12 (9 Mar 2007 16:21:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2007 16:21:53 +0000 (UTC) To: "Denis Bueno" , "help-gnu-emacs" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 09 17:21:39 2007 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 1HPhqZ-00016l-FW for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Mar 2007 17:21:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPhqr-0003Af-23 for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Mar 2007 11:21:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPhqb-00031b-Rl for help-gnu-emacs@gnu.org; Fri, 09 Mar 2007 11:21:38 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPhqY-0002ug-VG for help-gnu-emacs@gnu.org; Fri, 09 Mar 2007 11:21:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPhqY-0002uL-Qg for help-gnu-emacs@gnu.org; Fri, 09 Mar 2007 11:21:34 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPhqC-0003Gf-9b for help-gnu-emacs@gnu.org; Fri, 09 Mar 2007 11:21:13 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l29GKq1M006018; Fri, 9 Mar 2007 10:20:52 -0600 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l29CKaB3008125; Fri, 9 Mar 2007 09:20:51 -0700 Original-Received: from dhcp-amer-csvpn-gw2-141-144-72-53.vpn.oracle.com by rcsmt251.oracle.com with ESMTP id 2514011511173457221; Fri, 09 Mar 2007 09:20:21 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <6dbd4d000703090752q5067f8e3i69d74d07d9cb51fd@mail.gmail.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= X-detected-kernel: Linux 2.4-2.6 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:41835 Archived-At: > I would like to be able to visit a file by its name > but search a set of default directories, rather than having to specify > the directory... > > For example, assume there are 4 different files all named "find.jsp" > in different directories, and I would like to find a particular one. I > would do M-x find-resource, type "find", hit TAB, it I would see a > list that looks something like: > > | foobar/find.jsp > | baz/find.jsp > | duh/find.jsp > | blah/find.jsp I don't have a suggestion for your code, but you can do what you want with Icicles, if you like, using command `icicle-locate-file'. Just use a regexp that matches the directories and files you want to find. In this case, use `find.jsp' (or `/find.jsp$', to be sure not to match files, such as foofind.jsp or find.jsp2, whose names contain `find.jsp'). You will see exactly the list of 4 completion choices you show above. The search for matching files is limited to those under the current directory (and subdirs etc.) or, if you use `C-u', to those under a directory you name (which could be the root). See http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_File-Name_Input. Besides Icicles, there are other packages that let you do something similar. See http://www.emacswiki.org/cgi-bin/wiki/LocateFilesAnywhere.