From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: repeat-complex-command too complex
Date: Wed, 27 Oct 2010 15:54:52 +0200 [thread overview]
Message-ID: <87hbg7lp03.fsf@fh-trier.de> (raw)
In-Reply-To: iciq0nn4ja.fsf@verizon.net
despen@verizon.net writes:
> Barry Margolin <barmar@alum.mit.edu> writes:
>
>> In article <icmxq1m3cc.fsf@verizon.net>, despen@verizon.net wrote:
>>
>>> 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.
>>
>> (defun my-query-replace (from-string to-string)
>> (interactive "sReplace: \nsWith: ")
>> (query-replace from-string to-string))
>>
>> Then bind M-% to my-query-replace.
>
> Have to admit, I tried to do that myself and failed.
> My understanding of "interactive" is sadly lacking.
> I think I have it now though.
>
> Thanks!
Changing the interactive spec with an advice is also an option.
(defadvice query-replace (before hack-interactive-spec activate)
(interactive
(let ((common
(query-replace-read-args
(concat "Replace"
(if current-prefix-arg " word" "")
" string")
nil)))
(list (nth 0 common) (nth 1 common) (nth 2 common)))))
-ap
prev parent reply other threads:[~2010-10-27 13:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-26 0:40 repeat-complex-command too complex despen
[not found] ` <barmar-12C417.00343426102010@reserved-multicast-range-not-delegated.example.com>
[not found] ` <icmxq1m3cc.fsf@verizon.net>
2010-10-27 6:33 ` Barry Margolin
2010-10-27 13:34 ` despen
2010-10-27 13:54 ` Andreas Politz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87hbg7lp03.fsf@fh-trier.de \
--to=politza@fh-trier.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).