unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* regex search - easy keystroke for next?
@ 2011-05-03 16:06 AngusC
  2011-05-03 16:33 ` Deniz Dogan
  0 siblings, 1 reply; 7+ messages in thread
From: AngusC @ 2011-05-03 16:06 UTC (permalink / raw)
  To: Help-gnu-emacs


Hello

Am I correct in thinking that if you use a regex search ie C-M-s, if you are
on first instance found, you have to type same keystroke AGAIN to get to
next instance?  But that is quite a keystroke.  Is there not a next key?  n
or something similar?

Couldn't find on internet search.  Let me know.

Thanks.

Angus

-- 
View this message in context: http://old.nabble.com/regex-search---easy-keystroke-for-next--tp31533940p31533940.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: regex search - easy keystroke for next?
  2011-05-03 16:06 regex search - easy keystroke for next? AngusC
@ 2011-05-03 16:33 ` Deniz Dogan
  2011-05-03 16:39   ` AngusC
  0 siblings, 1 reply; 7+ messages in thread
From: Deniz Dogan @ 2011-05-03 16:33 UTC (permalink / raw)
  To: AngusC; +Cc: Help-gnu-emacs

2011/5/3 AngusC <anguscomber@gmail.com>:
>
> Hello
>
> Am I correct in thinking that if you use a regex search ie C-M-s, if you are
> on first instance found, you have to type same keystroke AGAIN to get to
> next instance?  But that is quite a keystroke.  Is there not a next key?  n
> or something similar?
>
> Couldn't find on internet search.  Let me know.
>
> Thanks.
>
> Angus
>

Actually, you can just use C-s and C-r to go to the next or previous
match as long as you've used C-M-s the first time. If you want other
keys than that you'd have to modify isearch-mode-map.



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

* Re: regex search - easy keystroke for next?
  2011-05-03 16:33 ` Deniz Dogan
@ 2011-05-03 16:39   ` AngusC
  2011-05-03 16:42     ` Deniz Dogan
  0 siblings, 1 reply; 7+ messages in thread
From: AngusC @ 2011-05-03 16:39 UTC (permalink / raw)
  To: Help-gnu-emacs



Deniz Dogan-3 wrote:
> 
> 2011/5/3 AngusC <anguscomber@gmail.com>:
>>
>> Hello
>>
>> Am I correct in thinking that if you use a regex search ie C-M-s, if you
>> are
>> on first instance found, you have to type same keystroke AGAIN to get to
>> next instance?  But that is quite a keystroke.  Is there not a next key?
>>  n
>> or something similar?
>>
>> Couldn't find on internet search.  Let me know.
>>
>> Thanks.
>>
>> Angus
>>
> 
> Actually, you can just use C-s and C-r to go to the next or previous
> match as long as you've used C-M-s the first time. If you want other
> keys than that you'd have to modify isearch-mode-map.
> 
> 
> Great, thanks.  It is so much less awkward than spanning the three keys :)
> 
> 

-- 
View this message in context: http://old.nabble.com/regex-search---easy-keystroke-for-next--tp31533940p31534241.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: regex search - easy keystroke for next?
  2011-05-03 16:39   ` AngusC
@ 2011-05-03 16:42     ` Deniz Dogan
  2011-05-03 17:07       ` AngusC
  2011-05-06  3:22       ` Le Wang
  0 siblings, 2 replies; 7+ messages in thread
From: Deniz Dogan @ 2011-05-03 16:42 UTC (permalink / raw)
  To: AngusC; +Cc: Help-gnu-emacs

2011/5/3 AngusC <anguscomber@gmail.com>:
>
>
> Deniz Dogan-3 wrote:
>>
>> 2011/5/3 AngusC <anguscomber@gmail.com>:
>>>
>>> Hello
>>>
>>> Am I correct in thinking that if you use a regex search ie C-M-s, if you
>>> are
>>> on first instance found, you have to type same keystroke AGAIN to get to
>>> next instance?  But that is quite a keystroke.  Is there not a next key?
>>>  n
>>> or something similar?
>>>
>>> Couldn't find on internet search.  Let me know.
>>>
>>> Thanks.
>>>
>>> Angus
>>>
>>
>> Actually, you can just use C-s and C-r to go to the next or previous
>> match as long as you've used C-M-s the first time. If you want other
>> keys than that you'd have to modify isearch-mode-map.
>>
>>
> Great, thanks.  It is so much less awkward than spanning the three keys :)
>

Since I'm bored, I wrote something for you:

(define-key isearch-mode-map (kbd "n") 'isearch-repeat-forward)
(define-key isearch-mode-map (kbd "p") 'isearch-repeat-backward)

Put that in your ~/.emacs and you will be able to use 'n' to repeat
the search forward and 'p' for backward.

-- 
Deniz Dogan



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

* Re: regex search - easy keystroke for next?
  2011-05-03 16:42     ` Deniz Dogan
@ 2011-05-03 17:07       ` AngusC
  2011-05-06  3:22       ` Le Wang
  1 sibling, 0 replies; 7+ messages in thread
From: AngusC @ 2011-05-03 17:07 UTC (permalink / raw)
  To: Help-gnu-emacs



Deniz Dogan-3 wrote:
> 
> 2011/5/3 AngusC <anguscomber@gmail.com>:
>>
>>
>> Deniz Dogan-3 wrote:
>>>
>>> 2011/5/3 AngusC <anguscomber@gmail.com>:
>>>>
>>>> Hello
>>>>
>>>> Am I correct in thinking that if you use a regex search ie C-M-s, if
>>>> you
>>>> are
>>>> on first instance found, you have to type same keystroke AGAIN to get
>>>> to
>>>> next instance?  But that is quite a keystroke.  Is there not a next
>>>> key?
>>>>  n
>>>> or something similar?
>>>>
>>>> Couldn't find on internet search.  Let me know.
>>>>
>>>> Thanks.
>>>>
>>>> Angus
>>>>
>>>
>>> Actually, you can just use C-s and C-r to go to the next or previous
>>> match as long as you've used C-M-s the first time. If you want other
>>> keys than that you'd have to modify isearch-mode-map.
>>>
>>>
>> Great, thanks.  It is so much less awkward than spanning the three keys
>> :)
>>
> 
> Since I'm bored, I wrote something for you:
> 
> (define-key isearch-mode-map (kbd "n") 'isearch-repeat-forward)
> (define-key isearch-mode-map (kbd "p") 'isearch-repeat-backward)
> 
> Put that in your ~/.emacs and you will be able to use 'n' to repeat
> the search forward and 'p' for backward.
> 
> -- 
> Deniz Dogan
> 

Hey, glad you were bored :)  Thanks.

I must also learn some lisp.



-- 
View this message in context: http://old.nabble.com/regex-search---easy-keystroke-for-next--tp31533940p31534512.html
Sent from the Emacs - Help mailing list archive at Nabble.com.




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

* Re: regex search - easy keystroke for next?
  2011-05-03 16:42     ` Deniz Dogan
  2011-05-03 17:07       ` AngusC
@ 2011-05-06  3:22       ` Le Wang
  2011-05-06  5:08         ` Deniz Dogan
  1 sibling, 1 reply; 7+ messages in thread
From: Le Wang @ 2011-05-06  3:22 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: AngusC, Help-gnu-emacs

On Wed, May 4, 2011 at 12:42 AM, Deniz Dogan <deniz.a.m.dogan@gmail.com> wrote:
> Since I'm bored, I wrote something for you:
>
> (define-key isearch-mode-map (kbd "n") 'isearch-repeat-forward)
> (define-key isearch-mode-map (kbd "p") 'isearch-repeat-backward)

This is a nice example of the power of Emacs.  However, the letters n
and p might be more useful to you in entering your search string.  :)


-- 
Le



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

* Re: regex search - easy keystroke for next?
  2011-05-06  3:22       ` Le Wang
@ 2011-05-06  5:08         ` Deniz Dogan
  0 siblings, 0 replies; 7+ messages in thread
From: Deniz Dogan @ 2011-05-06  5:08 UTC (permalink / raw)
  To: Le Wang; +Cc: AngusC, Help-gnu-emacs

2011/5/6 Le Wang <l26wang@gmail.com>:
> On Wed, May 4, 2011 at 12:42 AM, Deniz Dogan <deniz.a.m.dogan@gmail.com> wrote:
>> Since I'm bored, I wrote something for you:
>>
>> (define-key isearch-mode-map (kbd "n") 'isearch-repeat-forward)
>> (define-key isearch-mode-map (kbd "p") 'isearch-repeat-backward)
>
> This is a nice example of the power of Emacs.  However, the letters n
> and p might be more useful to you in entering your search string.  :)
>

Yes, of course! :) But I gave the man what he asked for.



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

end of thread, other threads:[~2011-05-06  5:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-03 16:06 regex search - easy keystroke for next? AngusC
2011-05-03 16:33 ` Deniz Dogan
2011-05-03 16:39   ` AngusC
2011-05-03 16:42     ` Deniz Dogan
2011-05-03 17:07       ` AngusC
2011-05-06  3:22       ` Le Wang
2011-05-06  5:08         ` Deniz Dogan

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