all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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-03 16:13 repeat-complex-command on current marked region andrew.maguire
  -- strict thread matches above, loose matches on Subject: below --
2003-12-02 20:16 Spencer Thiel

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.