* incremental search
@ 2006-10-25 5:32 Gary Wessle
2006-10-25 6:06 ` Barry Margolin
0 siblings, 1 reply; 7+ messages in thread
From: Gary Wessle @ 2006-10-25 5:32 UTC (permalink / raw)
Hi
C-s turns on incremental search but it is not doing what I am
expecting which is;
when I want to find "man" it high finds "woman", how can I limit it to
the word "man", do I need to regex incremental search?
thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 5:32 incremental search Gary Wessle
@ 2006-10-25 6:06 ` Barry Margolin
2006-10-25 7:20 ` Malte Spiess
0 siblings, 1 reply; 7+ messages in thread
From: Barry Margolin @ 2006-10-25 6:06 UTC (permalink / raw)
In article <m38xj5rmdd.fsf@localhost.localdomain>,
Gary Wessle <phddas@yahoo.com> wrote:
> Hi
> C-s turns on incremental search but it is not doing what I am
> expecting which is;
> when I want to find "man" it high finds "woman", how can I limit it to
> the word "man", do I need to regex incremental search?
If you don't mind a non-interactive search, you can use M-x
word-search-forward.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 6:06 ` Barry Margolin
@ 2006-10-25 7:20 ` Malte Spiess
2006-10-25 7:37 ` Barry Margolin
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Malte Spiess @ 2006-10-25 7:20 UTC (permalink / raw)
Barry Margolin <barmar@alum.mit.edu> writes:
> In article <m38xj5rmdd.fsf@localhost.localdomain>,
> Gary Wessle <phddas@yahoo.com> wrote:
>
>> Hi
>> C-s turns on incremental search but it is not doing what I am
>> expecting which is;
>> when I want to find "man" it high finds "woman", how can I limit it to
>> the word "man", do I need to regex incremental search?
>
> If you don't mind a non-interactive search, you can use M-x
> word-search-forward.
You can also type C-s RET C-w for word-search. But this somehow only
finds one occurance.
It is always possible to redefine a key, but if you're just a beginner I
would probably rather recommand making a regexp-search with the
beginning and the end of the word.
I personally wouldn't want to have the behaviour you describe, maybe you
should think it over if it's really a fortune to have it generally (of
course sometimes it's helpful).
Malte
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 7:20 ` Malte Spiess
@ 2006-10-25 7:37 ` Barry Margolin
2006-11-23 19:25 ` Stefan Monnier
2006-10-25 14:01 ` Johan Bockgård
2006-10-27 18:57 ` Dieter Wilhelm
2 siblings, 1 reply; 7+ messages in thread
From: Barry Margolin @ 2006-10-25 7:37 UTC (permalink / raw)
In article <87ods07tes.fsf@trick.ulm.malte.spiess>,
Malte Spiess <i1tnews@arcor.de> wrote:
> Barry Margolin <barmar@alum.mit.edu> writes:
>
> > In article <m38xj5rmdd.fsf@localhost.localdomain>,
> > Gary Wessle <phddas@yahoo.com> wrote:
> >
> >> Hi
> >> C-s turns on incremental search but it is not doing what I am
> >> expecting which is;
> >> when I want to find "man" it high finds "woman", how can I limit it to
> >> the word "man", do I need to regex incremental search?
> >
> > If you don't mind a non-interactive search, you can use M-x
> > word-search-forward.
>
> You can also type C-s RET C-w for word-search. But this somehow only
> finds one occurance.
If you mean that you can't just type C-s to go to the next one, that's
what I meant about it being a non-interactive search.
>
> It is always possible to redefine a key, but if you're just a beginner I
> would probably rather recommand making a regexp-search with the
> beginning and the end of the word.
>
> I personally wouldn't want to have the behaviour you describe, maybe you
> should think it over if it's really a fortune to have it generally (of
> course sometimes it's helpful).
It depends on what you're searching for. I've often been in the same
situation as the OP, where the word I want is frequently found as a
substring of unrelated words, so there are lots of spurious matches.
I usually switch to regexp incremental search when this happens.
C-s \<man\>
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 7:37 ` Barry Margolin
@ 2006-11-23 19:25 ` Stefan Monnier
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2006-11-23 19:25 UTC (permalink / raw)
> I usually switch to regexp incremental search when this happens.
> C-s \<man\>
Interestingly enough, isearch.el does have support for word search (via the
isearch-word variable), but I don't see any command that makes it available
to the user.
The code below allows you to toggle this state with M-w while in isearch.
(defun isearch-toggle-word ()
"Toggle word searching on or off."
;; The status stack is left unchanged.
(interactive)
(setq isearch-word (not isearch-word))
(if isearch-word (setq isearch-regexp nil))
(setq isearch-success t isearch-adjusted t)
(isearch-update))
(define-key isearch-mode-map "\M-w" 'isearch-toggle-word)
-- Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 7:20 ` Malte Spiess
2006-10-25 7:37 ` Barry Margolin
@ 2006-10-25 14:01 ` Johan Bockgård
2006-10-27 18:57 ` Dieter Wilhelm
2 siblings, 0 replies; 7+ messages in thread
From: Johan Bockgård @ 2006-10-25 14:01 UTC (permalink / raw)
Malte Spiess <i1tnews@arcor.de> writes:
> You can also type C-s RET C-w for word-search. But this somehow only
> finds one occurance.
Juri Linkov discovered "half-incremental word search". See
http://lists.gnu.org/archive/html/emacs-devel/2005-02/msg01119.html
--
Johan Bockgård
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: incremental search
2006-10-25 7:20 ` Malte Spiess
2006-10-25 7:37 ` Barry Margolin
2006-10-25 14:01 ` Johan Bockgård
@ 2006-10-27 18:57 ` Dieter Wilhelm
2 siblings, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2006-10-27 18:57 UTC (permalink / raw)
Cc: help-gnu-emacs
Malte Spiess <i1tnews@arcor.de> writes:
> Barry Margolin <barmar@alum.mit.edu> writes:
>
>> In article <m38xj5rmdd.fsf@localhost.localdomain>,
>> Gary Wessle <phddas@yahoo.com> wrote:
>>
>>> Hi
>>> C-s turns on incremental search but it is not doing what I am
>>> expecting which is;
>>> when I want to find "man" it high finds "woman", how can I limit it to
>>> the word "man", do I need to regex incremental search?
>>
>> If you don't mind a non-interactive search, you can use M-x
>> word-search-forward.
This is really, really beautiful, thanks.
> You can also type C-s RET C-w for word-search. But this somehow only
> finds one occurance.
Yes, strange. Fortunately with the key combo C-s M-e M-w WORD C-s the
i-search for words works in the expected repetitive way (the hint
comes from Johan Bockgård, see the link below in case you haven't read
his message).
Juri Linkov discovered "half-incremental word search". See
http://lists.gnu.org/archive/html/emacs-devel/2005-02/msg01119.html
--
Best wishes
H. Dieter Wilhelm
Darmstadt, Germany
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2006-11-23 19:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 5:32 incremental search Gary Wessle
2006-10-25 6:06 ` Barry Margolin
2006-10-25 7:20 ` Malte Spiess
2006-10-25 7:37 ` Barry Margolin
2006-11-23 19:25 ` Stefan Monnier
2006-10-25 14:01 ` Johan Bockgård
2006-10-27 18:57 ` Dieter Wilhelm
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).