From: "Drew Adams" <drew.adams@oracle.com>
To: "'Leh CHAO'" <lehchao@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: RE: does emacs support incremental searching for partial matches?
Date: Tue, 22 Feb 2011 12:42:24 -0800 [thread overview]
Message-ID: <1D10AC79244C407F898F13F0F720FCC7@us.oracle.com> (raw)
In-Reply-To: <AANLkTimnRBo7hCSXWkOTgmAMBAhQg6AWCMyHqdVVZK0j@mail.gmail.com>
> >> I'm wondering if emacs has built-in support for
> >> incremental searching for partial matches, such as searching
> >> for 'memcache' matches 'memorycache'.
> >
> > You can use regexp search: `C-M-s mem.*cache'.
> > See `C-h r g regexp search RET'.
>
> Hi Drew, thank you for your help!
> Sometimes I would be able to know the .* part, for example, I want to
> match WindowsMemoryCacheManagement by using 'memcache'. With regular
> expression, I have to specify .*m.*e.*m.*c.*a.*c.*h.*e.*
I don't understand. Why would you have to specify that? You should be able to
match `WindowsMemoryCacheManagement' using just `C-M-s mem.*cache'. Or maybe
you meant that you do _not_ know where the possible skips are located?
> Is there any command or plugin I can use?
Do you mean something that lets you not need to include the `.*'?
I.e., to type only `memcache', not `mem.*cache'?
Again, IMHO it's not a big deal to type `.*'. But if that's what you're looking
for then yes, you can use Icicles search with scatter-match completion.
This kind of completion is the same as TextMate's file-name completion and Ido's
flex-match completion. It automatically inserts `.*' between every pair of
characters you type - nothing more. So you type only `memcache' and it thinks
`m.*e.*m.*c.*a.*c.*h.*e'.
In Icicles you can change the completion mode to scatter matching at any time by
hitting `M-(' in the minibuffer. `M-(' cycles the possible matching modes for
`S-TAB' completion: `apropos' (regexp), `scatter', `Levenshtein', `Levenshtein
strict', and `Jaro-Winkler'. (Apropos completion is the `S-TAB' default.)
Icicles search (an incremental search that uses completion):
http://www.emacswiki.org/emacs/Icicles_-_Search_Commands%2c_Overview
Scatter-match completion:
http://www.emacswiki.org/emacs/Icicles_-_Fuzzy_Completion
But I recommend that you just get used to using a regexp pattern, regardless of
the search tool you use. You won't regret it.
next prev parent reply other threads:[~2011-02-22 20:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-21 10:28 does emacs support incremental searching for partial matches? Leh CHAO
2011-02-22 14:21 ` Drew Adams
2011-02-22 19:33 ` Leh CHAO
2011-02-22 20:42 ` Drew Adams [this message]
[not found] ` <mailman.2.1298403193.16069.help-gnu-emacs@gnu.org>
2011-02-22 21:49 ` Tim X
2011-02-23 15:53 ` Stefan Monnier
2011-02-24 5:59 ` Le Wang
2011-02-24 14:43 ` Stefan Monnier
[not found] ` <mailman.1.1298558638.12984.help-gnu-emacs@gnu.org>
2011-02-26 3:22 ` jpkotta
[not found] <mailman.10.1298381786.4429.help-gnu-emacs@gnu.org>
2011-02-22 21:34 ` Tim X
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1D10AC79244C407F898F13F0F720FCC7@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=lehchao@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.