Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Find File using partial filenames

21 views
Skip to first unread message

Chris Lott

unread,
Sep 27, 2011, 12:01:29 PM9/27/11
to
Is there a script (or a quicker way built-in) that allows one to use
partial file names in find-file ? For instance, if I C-x C-f and start
typing the beginning of a filename, then I can TAB to see possible
completions. But I'd like something similar when using a partial
filename that isn't the beginning... for instance, if I remember that
the filename includes blog but the file might be named edblog or
comblog, then these would show as completions?

Right now, the quickest method I have is to C-x C-f, nav to directory,
RET to go into DIRED and then CTRL-S to search for the partial... not
exactly speedy :)

qyp

unread,
Sep 27, 2011, 12:13:06 PM9/27/11
to
try ido-mode :)

Stefan Monnier

unread,
Sep 27, 2011, 9:38:12 PM9/27/11
to
> Is there a script (or a quicker way built-in) that allows one to use
> partial file names in find-file ? For instance, if I C-x C-f and start
> typing the beginning of a filename, then I can TAB to see possible
> completions. But I'd like something similar when using a partial
> filename that isn't the beginning... for instance, if I remember that
> the filename includes blog but the file might be named edblog or
> comblog, then these would show as completions?

Since Emacs-23, the default completion includes so-called
"partial-completion", which lets you do C-x C-f ~/e/e/e TAB and have it
expand to ~/etc/emacs/emacs.el (for example).

It also lets you add "globbing stars", e.g. C-x C-f ~/src/*glob TAB will
complete to any file in ~/src whose name includes "glob".


Stefan

unfrostedpoptart

unread,
Sep 27, 2011, 10:43:20 PM9/27/11
to
Yeah - I recently found out about this by accident. It's extremely useful!

David

ps - I've been seeing stuff about emacs 24. Is there a good summary of major changes and new features? And any estimate of when it will be released?

Colin S. Miller

unread,
Oct 4, 2011, 2:04:40 PM10/4/11
to
On 27/09/11 17:01, Chris Lott wrote:
> Is there a script (or a quicker way built-in) that allows one to use
> partial file names in find-file ?

Chris,
Probably not exactly what you want, but the package "find-recursive",
will let you search a directory and its sub-directories for a file matching
a regexp (not a glob). A list of matching files is show, with tab-completion,
to pick which file you were after.



HTH,
Colin S. Miller


--
Replace the obvious in my email address with the first three letters of the hostname to reply.
0 new messages