From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Denis Bueno" Newsgroups: gmane.emacs.devel Subject: Looking for interactive `locate-file' Date: Mon, 5 Mar 2007 20:53:13 -0500 Message-ID: <6dbd4d000703051753j23014087ob8beb4edf1741458@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1173146017 26838 80.91.229.12 (6 Mar 2007 01:53:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 6 Mar 2007 01:53:37 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 06 02:53:31 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HOOrq-00027C-Jx for ged-emacs-devel@m.gmane.org; Tue, 06 Mar 2007 02:53:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOOrq-0001wh-Gt for ged-emacs-devel@m.gmane.org; Mon, 05 Mar 2007 20:53:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HOOrf-0001wc-CM for emacs-devel@gnu.org; Mon, 05 Mar 2007 20:53:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HOOrd-0001wP-1j for emacs-devel@gnu.org; Mon, 05 Mar 2007 20:53:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HOOrc-0001wM-Qu for emacs-devel@gnu.org; Mon, 05 Mar 2007 20:53:16 -0500 Original-Received: from wr-out-0506.google.com ([64.233.184.224]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HOOrc-00030O-GU for emacs-devel@gnu.org; Mon, 05 Mar 2007 20:53:16 -0500 Original-Received: by wr-out-0506.google.com with SMTP id i3so1752038wra for ; Mon, 05 Mar 2007 17:53:14 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lA4nTphyheje5g00TGo0ynjxh60fSwtWZhpfM8iuth6XOtRgJMYKgzEob4v4axX4TGTXJBgZDmoZXEUJAd31MQpz4YnmRk6apl7CWYe41t3UEivUc3Hwe3g1gSIRr7Xic1VWszlaSJPnjbu2iYHNb7K17gGghk5S79F9NH/E/ok= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mrLdXxdsy/EKRpghji/3LO4oAHr/jd2iH4pwsp0kLHXx+O5Ac9PkemBrFKvQJWJz2y0aWtsiUsOik4EHF80kJRizuTuIQHfubGwet4kCT+SAOW9rlesZtsZD9YJ31CKpsOrma8NZrour90eZAPRviXZD9hoWqxAwHhEYuOTjiPY= Original-Received: by 10.114.204.3 with SMTP id b3mr1517292wag.1173145993727; Mon, 05 Mar 2007 17:53:13 -0800 (PST) Original-Received: by 10.114.194.3 with HTTP; Mon, 5 Mar 2007 17:53:13 -0800 (PST) Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67391 Archived-At: Dear list- I would like to be able to interactive find a file inside a list of paths, interactively, and in a way that supports some basic pattern matching. (For reference, the reason I want this is that Eclipse has it, and I find it quite useful.) Currently, I have a first approximation [1], but, it sucks. All it does is ask for a (possibly non-existent) filename, then look for that in a default list of paths. I want to set up a list of directories pertaining to a particular project. Then when I M-x find-resource, I want it to ask for the filename and look in those paths for it -- interactively, listing all matches as I type. So if I were to type "type*.jsp", a results buffer would list all the files matching that pattern. Has anyone written something like what I'm looking for, before? -Denis [1] ;; make sure you put some directories in here: (defvar *project-paths* '()) (defun find-resource (filename) "Find `filename' in *project-paths*, if it can be found in any directory there. If not, returns nil." (interactive "FFilename: ") (let ((file (locate-file filename *project-paths*))) (if file (find-file file) (message (concat "`" filename "' not found.")))))