unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* smarter isearch (was: Re: does emacs support incremental searching for partial matches?)
@ 2011-02-26 10:31 Le Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Le Wang @ 2011-02-26 10:31 UTC (permalink / raw)
  To: jpkotta; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]

On Sat, Feb 26, 2011 at 11:22 AM, jpkotta <jpkotta@gmail.com> wrote:

> On Feb 24, 8:43 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > >> (defconst my-isearch-re "[^\n\s\t]*?")
> > > or (defconst my-isearch-re "\\S *?")
> > > I'm not sure which is clearer.
> >
> > Many languages set \n to have syntax "close comment" rather than
> > "space", in which case \S- does not exclude \n.
> >
> >         Stefan
>
> I just added http://www.emacswiki.org/emacs/FlexIsearch to the wiki.
> It's something that I've been thinking about for a while, but I didn't
> know how to hook into isearch.  I think it's very close to what the OP
> wanted.
>

This looks interesting.  Maybe you can add an additional level of search
between word and flex - treat the search string as regexp.  This way I can
map C-s to flex search (right now it's mapped to isearch-forward-regexp).

That is:

start searching for input as string, when not found, search for input as
regexp, when not found, search for input as flex term


-- 
Le

[-- Attachment #2: Type: text/html, Size: 1736 bytes --]

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

* Re: smarter isearch (was: Re: does emacs support incremental searching for partial matches?)
       [not found] <mailman.20.1298716324.28733.help-gnu-emacs@gnu.org>
@ 2011-02-28 23:41 ` jpkotta
  2011-03-01  4:36   ` Le Wang
  0 siblings, 1 reply; 3+ messages in thread
From: jpkotta @ 2011-02-28 23:41 UTC (permalink / raw)
  To: help-gnu-emacs

On Feb 26, 4:31 am, Le Wang <l26w...@gmail.com> wrote:
> On Sat, Feb 26, 2011 at 11:22 AM, jpkotta <jpko...@gmail.com> wrote:
> > On Feb 24, 8:43 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > > >> (defconst my-isearch-re "[^\n\s\t]*?")
> > > > or (defconst my-isearch-re "\\S *?")
> > > > I'm not sure which is clearer.
>
> > > Many languages set \n to have syntax "close comment" rather than
> > > "space", in which case \S- does not exclude \n.
>
> > >         Stefan
>
> > I just addedhttp://www.emacswiki.org/emacs/FlexIsearchto the wiki.
> > It's something that I've been thinking about for a while, but I didn't
> > know how to hook into isearch.  I think it's very close to what the OP
> > wanted.
>
> This looks interesting.  Maybe you can add an additional level of search
> between word and flex - treat the search string as regexp.  This way I can
> map C-s to flex search (right now it's mapped to isearch-forward-regexp).
>
> That is:
>
> start searching for input as string, when not found, search for input as
> regexp, when not found, search for input as flex term
>
> --
> Le

I don't quite understand.  As in, you do C-s to search for "^a[ ]
+regexp", it doesn't match, so then it works as if you did C-M-s (or M-
r in isearch-mode) so it interprets the string as a regexp?  Why
wouldn't you just use C-M-s (or M-r from isearch-mode)?

I guess what I was going for with flex-isearch is to find similar
strings if I mistyped the search string, or make it a bit more
forgiving if I didn't know the exact string.  If I'm searching for a
regexp, then I know I'm searching for a regexp, and in my mind it's a
different operation than a simple string search.


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

* Re: smarter isearch (was: Re: does emacs support incremental searching for partial matches?)
  2011-02-28 23:41 ` jpkotta
@ 2011-03-01  4:36   ` Le Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Le Wang @ 2011-03-01  4:36 UTC (permalink / raw)
  To: jpkotta; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 415 bytes --]

On Tue, Mar 1, 2011 at 7:41 AM, jpkotta <jpkotta@gmail.com> wrote:

> I don't quite understand.  As in, you do C-s to search for "^a[ ]
> +regexp", it doesn't match, so then it works as if you did C-M-s (or M-
> r in isearch-mode) so it interprets the string as a regexp?  Why
> wouldn't you just use C-M-s (or M-r from isearch-mode)?
>

Simple:  I didn't know M-r switched between word and regexp search.


-- 
Le

[-- Attachment #2: Type: text/html, Size: 736 bytes --]

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

end of thread, other threads:[~2011-03-01  4:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-26 10:31 smarter isearch (was: Re: does emacs support incremental searching for partial matches?) Le Wang
     [not found] <mailman.20.1298716324.28733.help-gnu-emacs@gnu.org>
2011-02-28 23:41 ` jpkotta
2011-03-01  4:36   ` Le Wang

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