all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* textmate like fuzzy matching file completion?
@ 2008-02-23 22:09 Unknown
  2008-02-24  3:19 ` William Xu
       [not found] ` <mailman.7841.1203823169.18990.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Unknown @ 2008-02-23 22:09 UTC (permalink / raw)
  To: help-gnu-emacs

Textmate has a very nice file-opening and switching command mapped to 
Apple-T which allows a "fuzzy" string to be entered to so the user can 
switch to a file which may or may not have been opened yet.  For example, 
type "elp" and files in the "project" such as "elephant" and "elope" will 
both show up as possible matches.  Is there something similar for emacs? I 
looked into Icicles which has a fuzzy matching mode, but emacswiki says it 
does NOT do filename completion.


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

* Re: textmate like fuzzy matching file completion?
  2008-02-23 22:09 textmate like fuzzy matching file completion? Unknown
@ 2008-02-24  3:19 ` William Xu
       [not found] ` <mailman.7841.1203823169.18990.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 5+ messages in thread
From: William Xu @ 2008-02-24  3:19 UTC (permalink / raw)
  To: help-gnu-emacs

Unknown <unknown@unknown.invalid> writes:

> Textmate has a very nice file-opening and switching command mapped to
> Apple-T which allows a "fuzzy" string to be entered to so the user can
> switch to a file which may or may not have been opened yet.  For
> example, type "elp" and files in the "project" such as "elephant" and
> "elope" will both show up as possible matches.  Is there something
> similar for emacs? 

Sure! Try ido-mode. Also, you may like to enable flex matching for your
purpose:

,----[ C-h v ido-enable-flex-matching RET ]
| ido-enable-flex-matching is a variable defined in `ido.el'.
| Its value is nil
| 
| 
| Documentation:
| *Non-nil means that `ido' will do flexible string matching.
| Flexible matching means that if the entered string does not
| match any item, any item containing the entered characters
| in the given sequence will match.
| 
| You can customize this variable.
| 
| [back]
`----

-- 
William

http://williamxu.net9.org





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

* Re: textmate like fuzzy matching file completion?
       [not found] ` <mailman.7841.1203823169.18990.help-gnu-emacs@gnu.org>
@ 2008-02-24 10:50   ` Unknown
  2008-02-25  2:45     ` William Xu
  2008-02-25  3:18     ` Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: Unknown @ 2008-02-24 10:50 UTC (permalink / raw)
  To: help-gnu-emacs

ido-enable-flex-matching is great.  However, it does not seem to match 
filenames in "projects".  Is there such a functionality in ido-mode or in 
some other mode?

To be more clear about the functionality I'm talking about, suppose you 
have a project rooted in the "project" directory:

project/
|
+--- subdir1/
|           |
|           blah.txt
|
|--- subdir2/
|           |
|           blah.txt
|
|--- subdir3/
             |
             blah.txt

In textmate, if you are currently working with a file in any directory in 
the project, matches will occur on any file in that project.  So if you 
are currently working on the blah.txt file in subdir1/, typing in 'blah' 
will bring up as choices the blah file in subdir2/ in addition to the one 
in subdir3/.


William Xu wrote:
> Unknown <unknown@unknown.invalid> writes:
> 
>> Textmate has a very nice file-opening and switching command mapped to
>> Apple-T which allows a "fuzzy" string to be entered to so the user can
>> switch to a file which may or may not have been opened yet.  For
>> example, type "elp" and files in the "project" such as "elephant" and
>> "elope" will both show up as possible matches.  Is there something
>> similar for emacs? 
> 
> Sure! Try ido-mode. Also, you may like to enable flex matching for your
> purpose:
> 
> ,----[ C-h v ido-enable-flex-matching RET ]
> | ido-enable-flex-matching is a variable defined in `ido.el'.
> | Its value is nil
> | 
> | 
> | Documentation:
> | *Non-nil means that `ido' will do flexible string matching.
> | Flexible matching means that if the entered string does not
> | match any item, any item containing the entered characters
> | in the given sequence will match.
> | 
> | You can customize this variable.
> | 
> | [back]
> `----
> 


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

* Re: textmate like fuzzy matching file completion?
  2008-02-24 10:50   ` Unknown
@ 2008-02-25  2:45     ` William Xu
  2008-02-25  3:18     ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: William Xu @ 2008-02-25  2:45 UTC (permalink / raw)
  To: help-gnu-emacs

Unknown <unknown@unknown.invalid> writes:

> So if
> you are currently working on the blah.txt file in subdir1/, typing in
> blah' will bring up as choices the blah file in subdir2/ in addition to
> the one in subdir3/.

Ah, looks like it is mixed of matching against opened files and
not-opened files. For that, you may take a look at anything.el, which is
kind of quicksilver implemented in elisp. 

-- 
William

http://williamxu.net9.org





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

* RE: textmate like fuzzy matching file completion?
  2008-02-24 10:50   ` Unknown
  2008-02-25  2:45     ` William Xu
@ 2008-02-25  3:18     ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2008-02-25  3:18 UTC (permalink / raw)
  To: 've macs', help-gnu-emacs

> ido-enable-flex-matching is great.  However, it does not seem 
> to match filenames in "projects".  Is there such a
> functionality in ido-mode or in some other mode?
> 
> To be more clear about the functionality I'm talking about, 
> suppose you have a project rooted in the "project" directory:
> 
> project/
> |
> +--- subdir1/
> |           |
> |           blah.txt
> |
> |--- subdir2/
> |           |
> |           blah.txt
> |
> |--- subdir3/
>              |
>              blah.txt
> 
> In textmate, if you are currently working with a file in any 
> directory in the project, matches will occur on any file in
> that project. So if you are currently working on the blah.txt
> file in subdir1/, typing in 'blah' will bring up as choices
> the blah file in subdir2/ in addition to the one in subdir3/.

1. See command `icicle-locate-file'.
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_File-Name_Input

And if your project has files scattered all over your file system, instead
of under a single directory, you can define the project as containing just
those files.
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Support_for_Projects


2. Wrt your original query: Icicles has the same thing as Ido's "flex"
matching and TextMate's unnamed fuzzy file-name matching. I call it
"scatter" matching, because your input characters can be scattered (but kept
in order) to match a completion candidate. You can use it in Icicles to
complete any type of input, including file names.

Icicles also has a more sophisticated kind of fuzzy matching, provided by
Simon Marshall's library fuzzy-match.el. It is that kind of fuzzy matching
that is not available for file-name completion.

You can change the matching method at any time by hitting a key from the
minibuffer.

http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Fuzzy_Completion


HTH.






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

end of thread, other threads:[~2008-02-25  3:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-23 22:09 textmate like fuzzy matching file completion? Unknown
2008-02-24  3:19 ` William Xu
     [not found] ` <mailman.7841.1203823169.18990.help-gnu-emacs@gnu.org>
2008-02-24 10:50   ` Unknown
2008-02-25  2:45     ` William Xu
2008-02-25  3:18     ` Drew Adams

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.