help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: Interactively finding file in a list of directories


From: Drew Adams
Subject: RE: Interactively finding file in a list of directories
Date: Fri, 9 Mar 2007 08:20:18 -0800

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





reply via email to

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