* Edit default of M-x replace-regexp
@ 2008-08-14 19:10 Corey Foote
2008-08-14 20:23 ` Drew Adams
0 siblings, 1 reply; 5+ messages in thread
From: Corey Foote @ 2008-08-14 19:10 UTC (permalink / raw)
To: help-gnu-emacs
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
Hi everybody,
I've got a quick question. I did M-x replace-regexp and
entered a regexp and newstring only to realize (after pressing return and seeing
the replacement fail) that the newstring I entered was not quite right. When I
type M-x replace-regexp again, I get the choice to use my last replacement as the
default. Is there a way to edit this default (particularly the newstring part
of the default) so that I don't have to type everything all over again?
Thanks!Sincerely,
Corey Foote
_________________________________________________________________
Reveal your inner athlete and share it with friends on Windows Live.
http://revealyourinnerathlete.windowslive.com?locale=en-us&ocid=TXT_TAGLM_WLYIA_whichathlete_us
[-- Attachment #2: Type: text/html, Size: 1058 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Edit default of M-x replace-regexp
[not found] <mailman.16699.1218741011.18990.help-gnu-emacs@gnu.org>
@ 2008-08-14 19:51 ` Chris McMahan
2008-08-14 19:57 ` Jens Teich
2008-08-14 20:32 ` Xah
2 siblings, 0 replies; 5+ messages in thread
From: Chris McMahan @ 2008-08-14 19:51 UTC (permalink / raw)
To: help-gnu-emacs
Corey Foote <coreyfoote@hotmail.com> writes:
> Hi everybody,
>
> I've got a quick question. I did M-x replace-regexp and entered a
> regexp and newstring only to realize (after pressing return and
> seeing the replacement fail) that the newstring I entered was not
> quite right. When I type M-x replace-regexp again, I get the choice
> to use my last replacement as the default. Is there a way to edit
> this default (particularly the newstring part of the default) so
> that I don't have to type everything all over again?
>
> Thanks!
>
> Sincerely,
>
> Corey Foote
There certainly is! (at least this works for me in my environment)
When you're presented with the default choice for the last
replacement, use the M-p key to cycle through the last entries into
the minibuffer, and you'll see (after 2 M-p presses) your original
string, suitable for editing.
- Chris
--
(. .)
=ooO=(_)=Ooo=====================================
Chris McMahan | first_initiallastname@one.dot.net
=================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Edit default of M-x replace-regexp
[not found] <mailman.16699.1218741011.18990.help-gnu-emacs@gnu.org>
2008-08-14 19:51 ` Chris McMahan
@ 2008-08-14 19:57 ` Jens Teich
2008-08-14 20:32 ` Xah
2 siblings, 0 replies; 5+ messages in thread
From: Jens Teich @ 2008-08-14 19:57 UTC (permalink / raw)
To: help-gnu-emacs
Corey Foote <coreyfoote@hotmail.com> writes:
> default. Is there a way to edit this default (particularly the newstring part
> of the default) so that I don't have to type everything all over again?
C-x ESC ESC
Jens
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Edit default of M-x replace-regexp
2008-08-14 19:10 Edit default of M-x replace-regexp Corey Foote
@ 2008-08-14 20:23 ` Drew Adams
0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2008-08-14 20:23 UTC (permalink / raw)
To: 'Corey Foote', help-gnu-emacs
> I did M-x replace-regexp and entered a regexp and newstring
> only to realize (after pressing return and seeing the
> replacement fail) that the newstring I entered was not quite
> right. When I type M-x replace-regexp again, I get the choice
> to use my last replacement as the default. Is there a way to
> edit this default (particularly the newstring part of the
> default) so that I don't have to type everything all over again?
Use `M-n' to retrieve the default value for editing.
[Please use plain text, not HTML, for mail to this mailing list.]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Edit default of M-x replace-regexp
[not found] <mailman.16699.1218741011.18990.help-gnu-emacs@gnu.org>
2008-08-14 19:51 ` Chris McMahan
2008-08-14 19:57 ` Jens Teich
@ 2008-08-14 20:32 ` Xah
2 siblings, 0 replies; 5+ messages in thread
From: Xah @ 2008-08-14 20:32 UTC (permalink / raw)
To: help-gnu-emacs
> Hi everybody,
>
On Aug 14, 12:10 pm, Corey Foote <coreyfo...@hotmail.com> wrote:
> I've got a quick question. I did M-x replace-regexp and
> entered a regexp and newstring only to realize (after pressing return and seeing
> the replacement fail) that the newstring I entered was not quite right. When I
> type M-x replace-regexp again, I get the choice to use my last replacement as the
> default. Is there a way to edit this default (particularly the newstring part
> of the default) so that I don't have to type everything all over again?
For me, i've always just used the up/down arrow key to go back or
forward history.
What i typically do is call query-replace-regexp, then press return if
last used pair is good, else just use up arrow or down arrow to cycle.
query-replace-regexp's default shortcut is Ctrl+Alt+Shift+%. Too many
keystrokes. I just alias it to qrr.
(defalias 'qrr 'query-replace-regexp)
Xah
∑ http://xahlee.org/
☄
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-08-14 20:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 19:10 Edit default of M-x replace-regexp Corey Foote
2008-08-14 20:23 ` Drew Adams
[not found] <mailman.16699.1218741011.18990.help-gnu-emacs@gnu.org>
2008-08-14 19:51 ` Chris McMahan
2008-08-14 19:57 ` Jens Teich
2008-08-14 20:32 ` Xah
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).