unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Looking for interactive `locate-file'
@ 2007-03-06  1:53 Denis Bueno
  2007-03-06  2:37 ` Stefan Monnier
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Denis Bueno @ 2007-03-06  1:53 UTC (permalink / raw)
  To: emacs-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-03-06 16:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06  1:53 Looking for interactive `locate-file' Denis Bueno
2007-03-06  2:37 ` Stefan Monnier
2007-03-06  3:32   ` Denis Bueno
2007-03-06 14:32     ` Stefan Monnier
2007-03-06 11:37 ` Johan Bockgård
2007-03-06 14:29 ` Drew Adams
2007-03-06 16:23 ` Stuart D. Herring

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).