[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: repeat-complex-command too complex
From: |
despen |
Subject: |
Re: repeat-complex-command too complex |
Date: |
Wed, 08 Dec 2010 15:33:31 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Barry Margolin <barmar@alum.mit.edu> writes:
> 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've been doing that but I was looking for something better.
>> 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.
Yes, some tests verify what you describe.
(I just changed the "redo" command to the shortened form.)
It's pretty unfortunate. I actually have repeat-complex-command
bound to a key and use it a lot. Plus I never use transient mark
mode. It's too visually disturbing.
Thanks.