emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Looking for interactive `locate-file'


From: Denis Bueno
Subject: Looking for interactive `locate-file'
Date: Mon, 5 Mar 2007 20:53:13 -0500

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.")))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]