* customize isearch-repeat-forward
@ 2007-09-14 2:03 peter hodgson
2007-09-14 6:36 ` Mathias Megyei
[not found] ` <mailman.840.1189751796.18990.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 5+ messages in thread
From: peter hodgson @ 2007-09-14 2:03 UTC (permalink / raw)
To: help-gnu-emacs
'M-x version' yields:
GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.10.11) of 2007-08-14
on palmer, modified by Ubuntu
---------------------
fellow emaculates; the pleasure of your company these past weeks has
prompted me to refine some of my customizations;
here's what my .emacs used to say about isearch:
(global-set-key "\ee" 'isearch-forward)
(global-set-key "\C-f" 'isearch-repeat-forward)
(global-set-key "\e'" 'isearch-exit)
(global-set-key "\e3" 'isearch-backward)
(global-set-key "\e2" 'isearch-repeat-backward)
everything worked fine; then i changed one line:
(global-set-key "\er" 'isearch-repeat-forward)
and now all hell's broken loose;
it starts out fine:
when i press <M-e>, i get "I-search:", so i type "key"; all occurences
of 'key' are highlighted, and the cursor is at the end of the first
occurence;
then i press <M-r>;
instead of having the cursor move to the next occurence of 'key', it
stays where it was, and i get this message:
"Pending regexp I-search: key"
when i press <M-r> again, i get:
"Pending I-search: key"
and there's still no cursor movement; further pressing <M-r> toggles
between this two 'Pending...' messages;
BUT IF i press <Enter> after i type in "key", or after i get either of
the 'Pending...' messages, THEN when i press <M-r> it moves the cursor
through the occurences of 'key', in other words, isearch-repeat-forward;
i've been eating lots of steak lately, to facilitate healing a wound;
does this .emacs difficulty suggest my karma been compromised? or is
there a lisp solution?
thanks, imputerate
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: customize isearch-repeat-forward
2007-09-14 2:03 customize isearch-repeat-forward peter hodgson
@ 2007-09-14 6:36 ` Mathias Megyei
2007-09-14 7:10 ` imputerate
[not found] ` <mailman.840.1189751796.18990.help-gnu-emacs@gnu.org>
1 sibling, 1 reply; 5+ messages in thread
From: Mathias Megyei @ 2007-09-14 6:36 UTC (permalink / raw)
To: peter hodgson; +Cc: help-gnu-emacs
On Thu, 2007-09-13 at 21:03 -0500, peter hodgson wrote:
> 'M-x version' yields:
> GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.10.11) of 2007-08-14
> on palmer, modified by Ubuntu
> ---------------------
>
> fellow emaculates; the pleasure of your company these past weeks has
> prompted me to refine some of my customizations;
>
> here's what my .emacs used to say about isearch:
>
> (global-set-key "\ee" 'isearch-forward)
isearch-forward is already bound to C-s. Do you need a different
binding too? Did you look the output of C-h k C-s?
> (global-set-key "\C-f" 'isearch-repeat-forward)
Default binding for that is: C-s C-s
> (global-set-key "\e'" 'isearch-exit)
> (global-set-key "\e3" 'isearch-backward)
> (global-set-key "\e2" 'isearch-repeat-backward)
>
> everything worked fine; then i changed one line:
>
> (global-set-key "\er" 'isearch-repeat-forward)
>
> and now all hell's broken loose;
>
> it starts out fine:
>
> when i press <M-e>, i get "I-search:", so i type "key"; all occurences
> of 'key' are highlighted, and the cursor is at the end of the first
> occurence;
With <M-e> you have switched to isearch mode. (You should
see the string "Isearch" in the mode line.)
In isearch mode the key bindings from isearch-mode-map will
overwrite the global bindings.
> then i press <M-r>;
>
> instead of having the cursor move to the next occurence of 'key', it
> stays where it was, and i get this message:
>
> "Pending regexp I-search: key"
>
> when i press <M-r> again, i get:
>
> "Pending I-search: key"
In isearch-mode-map <M-r> is bound to (quoted from C-h k C-s):
...
Type M-r to toggle regular-expression mode.
...
> BUT IF i press <Enter> after i type in "key", or after i get either of
> the 'Pending...' messages, THEN
Pressing <Enter> you exited from isearch mode. Hence ...
> when i press <M-r> it moves the cursor
> through the occurences of 'key', in other words, isearch-repeat-forward;
... your key binding from global-map is working as expected.
> i've been eating lots of steak lately, to facilitate healing a wound;
> does this .emacs difficulty suggest my karma been compromised? or is
> there a lisp solution?
The latter I think. If you would like to change the key bindings
for isearch mode you have to change isearch-mode-map instead of
the global map.
Regards,
Mathias
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: customize isearch-repeat-forward
2007-09-14 6:36 ` Mathias Megyei
@ 2007-09-14 7:10 ` imputerate
2007-09-14 7:16 ` Mathias Megyei
0 siblings, 1 reply; 5+ messages in thread
From: imputerate @ 2007-09-14 7:10 UTC (permalink / raw)
To: Help-gnu-emacs
thanks, Mathias; that was lightning fast and crystal clear;
so, isearch is a mode; guess i should have known that; but how come my
customized global binding 'C-f' has worked all along?
--
View this message in context: http://www.nabble.com/customize-isearch-repeat-forward-tf4439691.html#a12669804
Sent from the Emacs - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: customize isearch-repeat-forward
2007-09-14 7:10 ` imputerate
@ 2007-09-14 7:16 ` Mathias Megyei
0 siblings, 0 replies; 5+ messages in thread
From: Mathias Megyei @ 2007-09-14 7:16 UTC (permalink / raw)
To: imputerate; +Cc: Help-gnu-emacs
Hi Peter,
On Fri, 2007-09-14 at 00:10 -0700, imputerate wrote:
> thanks, Mathias; that was lightning fast and crystal clear;
>
> so, isearch is a mode; guess i should have known that; but how come my
> customized global binding 'C-f' has worked all along?
because isearch-mode-map don't have a binding for 'C-f'.
so the binding from global-map is still valid in isearch-mode.
Regards,
Mathias
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: customize isearch-repeat-forward
[not found] ` <mailman.840.1189751796.18990.help-gnu-emacs@gnu.org>
@ 2007-09-14 8:15 ` imputerate
0 siblings, 0 replies; 5+ messages in thread
From: imputerate @ 2007-09-14 8:15 UTC (permalink / raw)
To: help-gnu-emacs
so, for those of you listening in, this is the solution; works like a
charm;
thanks again; imputerate
(global-set-key "\ee" 'isearch-
forward)
(global-set-key "\er" 'isearch-repeat-
forward)
(global-set-key "\e'" 'isearch-
exit)
(global-set-key "\e3" 'isearch-
backward)
(global-set-key "\e2" 'isearch-repeat-
backward)
(eval-after-load
"isearch"
'(define-key isearch-mode-map "\er" 'isearch-repeat-
forward))
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-09-14 8:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-14 2:03 customize isearch-repeat-forward peter hodgson
2007-09-14 6:36 ` Mathias Megyei
2007-09-14 7:10 ` imputerate
2007-09-14 7:16 ` Mathias Megyei
[not found] ` <mailman.840.1189751796.18990.help-gnu-emacs@gnu.org>
2007-09-14 8:15 ` imputerate
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).