unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* repeat-complex-command on current marked region
@ 2003-12-02 20:16 Spencer Thiel
  0 siblings, 0 replies; 2+ messages in thread
From: Spencer Thiel @ 2003-12-02 20:16 UTC (permalink / raw)


If I use C-x ESC ESC to repeat a command, the previously marked region
shows up as an argument.  For example:
(replace-string "foo" "bar" nil 675 779)

What if I want to repeat the replacement on the current highlighted
region, rather than from 675 to 779?

This used to work as desired in emacs 20.x, but it somehow changed in
21.x.

tia,
Spencer Thiel

^ permalink raw reply	[flat|nested] 2+ messages in thread
* RE: repeat-complex-command on current marked region
@ 2003-12-03 16:13 andrew.maguire
  0 siblings, 0 replies; 2+ messages in thread
From: andrew.maguire @ 2003-12-03 16:13 UTC (permalink / raw)
  Cc: help-gnu-emacs

> If I use C-x ESC ESC to repeat a command, the previously marked region
> shows up as an argument.  For example:
> (replace-string "foo" "bar" nil 675 779)
> 
> What if I want to repeat the replacement on the current highlighted
> region, rather than from 675 to 779?
> 
> This used to work as desired in emacs 20.x,
> but it somehow changed in
> 21.x.

At Emacs 20, replace-string only took three args, i.e. it did not optionally
restrict replacements to a region.

At Emacs 21, two optional args were added to provide this region capability.
Since these are optional just edit the command perhaps to:
	(replace-string "foo" "bar" nil (point) (mark))
if you want to do it on a different region.

Or, don't forget that you can use M-p and M-n in the replace-string
interactive prompt to retrieve
previously entered strings.

Or, use narrow to region first.

Andrew

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-03 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-02 20:16 repeat-complex-command on current marked region Spencer Thiel
  -- strict thread matches above, loose matches on Subject: below --
2003-12-03 16:13 andrew.maguire

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).