help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: repeat-complex-command too complex


From: Barry Margolin
Subject: Re: repeat-complex-command too complex
Date: Wed, 08 Dec 2010 15:33:26 -0000
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <ick4l5okgl.fsf@verizon.net>, despen@verizon.net wrote:

> I  often need  to redo  query-replace, usually with slightly different
> arguments.
> 
> I first do M-% aaa bbb.
> 
> Then I want to repeat the command to maybe replace xxx by bbb.
> 
> I do C-x ESC ESC (repeat-complex-command)
> 
> I then see at least 2 lines in the mini-buffer reading:
> 
> redo: (query-replace "aaa" "bbb" nil (if
>  (and transient-mark-mode mark-active)
>  (region-beginning))
>  (if (and transient-mark-mode mark-active) (region-end)))
> 
> Why is all that ?JUNK? there.  It's not so easy to get back to
> the "bbb" part and change it.

M-< will get you to the beginning.

> 
> I'd really like to see something like:
> 
> redo: (query-replace "aaa" "bbb")
> 
> I tried this with emacs -q and got the same results.

When you use M-%, it automatically confines its operation to the region 
if you use transient-mark-mode and have a region enabled.  This is 
implemented in the function's (interactive) specification.

When you repeat the command, it has preserve that functionality.  Since 
you're no longer invoking the command interactively, but through the 
low-level Lisp interface, the expressions to do this defaulting has to 
be included explicitly.

-- 
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 ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]