GNU bug report logs -
#3746
M-r in comint mode should use isearch
Previous Next
Reported by: Dan Nicolaescu <dann <at> ics.uci.edu>
Date: Fri, 3 Jul 2009 18:20:05 UTC
Severity: normal
Done: Juri Linkov <juri <at> jurta.org>
Bug is archived. No further changes may be made.
Full log
Message #49 received at 3746 <at> emacsbugs.donarmstrong.com (full text, mbox):
> > The general objection is rather Occam's razor: _Why_ add
> > such complexity? What is gained? Occasionally the added
> > convenience of having a single key to use makes a DWIM
> > command worth it. But usually not.
>
> This case is an exception.
I leave that to your judgment; I can't speak to that.
> C-r is the most frequent key I use in bash running in xterm because
> it is very convenient to search for old commands in the shell history.
> I suppose the same is true for other users.
>
> Using a different key in Emacs for the same functionality
> will cause too much trouble. Just imagine when you have a habit
> typing C-r to search on the shell history, typing it in the Emacs
> shell buffer will not do what you mean. This recalls that
> Emacs has a different key M-r. Then switching back to xterm
> and typing M-r: Ahh, that M-r is valid only in Emacs,
> but in xterm it is C-r. Arrrgh!
>
> I think having two different keys for the same functionality
> (C-r and M-r for Isearch on the history) is worse than having
> the same key for different contexts (the shell prompt or the
> rest of the shell buffer).
The alternative is not necessarily to have two completely different keys. The
typical, traditional, and simpler approach is to use the same key but still
allow two behaviors and keep the behavior distinction under explicit user
control: Initiate one of the two behaviors using `C-u'. Depending on context is
far more complicated.
And depending on context doesn't necessarily mean fewer keystrokes (even though
you never need to hit `C-u'): If the cursor is not in the right place for the
particular behavior you want, then you must first move it there. I'm not sure
that anything significant is gained by the approach you propose, except added
complexity. `C-r' for history search and `C-u C-r' for normal search seems
reasonable, to me.
But it's your call, of course.
This bug report was last modified 15 years and 172 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.