From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: andrew.maguire@ps.ge.com Newsgroups: gmane.emacs.help Subject: RE: repeat-complex-command on current marked region Date: Wed, 3 Dec 2003 11:13:50 -0500 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <6192367D59F8904CA553579EF41FEEA00241AD09@ukcbgx01psge.geips.ge.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" X-Trace: sea.gmane.org 1070474895 30999 80.91.224.253 (3 Dec 2003 18:08:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 3 Dec 2003 18:08:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 03 19:08:12 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ARbQ4-0005fJ-00 for ; Wed, 03 Dec 2003 19:08:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARcMR-0004RF-My for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Dec 2003 14:08:31 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ARcKd-0003kS-42 for help-gnu-emacs@gnu.org; Wed, 03 Dec 2003 14:06:39 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ARcK6-0003Wx-Qg for help-gnu-emacs@gnu.org; Wed, 03 Dec 2003 14:06:37 -0500 Original-Received: from [216.35.73.165] (helo=ext-nj2gw-3.online-age.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ARcK2-0003Rj-Pn for help-gnu-emacs@gnu.org; Wed, 03 Dec 2003 14:06:02 -0500 Original-Received: from int-nj2gw-6.online-age.net (int-nj2gw-6 [3.159.236.70]) by ext-nj2gw-3.online-age.net (8.12.9/8.12.9/990426-RLH) with ESMTP id hB3Hovar007297; Wed, 3 Dec 2003 12:51:46 -0500 (EST) Original-Received: from nyschx06psge.ps.ge.com (localhost [127.0.0.1]) by int-nj2gw-6.online-age.net (8.12.9/8.12.8/990426-RLH) with ESMTP id hB3GGIPb019308; Wed, 3 Dec 2003 11:16:20 -0500 (EST) Original-Received: by nyschx06psge.ps.ge.com with Internet Mail Service (5.5.2657.72) id ; Wed, 3 Dec 2003 11:15:55 -0500 Original-To: vpsthiel@yahoo.com X-Mailer: Internet Mail Service (5.5.2657.72) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14897 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14897 > 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