From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#45607: 27.1; compiled replace-string breaks repeat-complex-command Date: Wed, 06 Jul 2022 10:53:13 +0300 Organization: LINKOV.NET Message-ID: <861quywusu.fsf@mail.linkov.net> References: <80o8i7676p.fsf@felesatra.moe> <87czfkir6n.fsf@gnus.org> <86r1402un1.fsf@mail.linkov.net> <87y1y79x82.fsf@gnus.org> <87v8t9y8hi.fsf@gnus.org> <87r13xy8c3.fsf@gnus.org> <871quzaagc.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 45607@debbugs.gnu.org, Allen Li To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 06 10:20:15 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o90Gd-0004fZ-FV for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 10:20:15 +0200 Original-Received: from localhost ([::1]:46304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o90Gc-0002cW-38 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 04:20:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o90GQ-0002bT-WB for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 04:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58299) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o90GQ-00075w-M2 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 04:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o90GQ-0003QP-H0 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 04:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jul 2022 08:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45607 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 45607-submit@debbugs.gnu.org id=B45607.165709555713092 (code B ref 45607); Wed, 06 Jul 2022 08:20:02 +0000 Original-Received: (at 45607) by debbugs.gnu.org; 6 Jul 2022 08:19:17 +0000 Original-Received: from localhost ([127.0.0.1]:52196 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o90Fh-0003P6-LQ for submit@debbugs.gnu.org; Wed, 06 Jul 2022 04:19:17 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:37361) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o90Ff-0003Ob-9g for 45607@debbugs.gnu.org; Wed, 06 Jul 2022 04:19:16 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 3698860010; Wed, 6 Jul 2022 08:19:05 +0000 (UTC) In-Reply-To: <871quzaagc.fsf@web.de> (Michael Heerdegen's message of "Tue, 05 Jul 2022 16:41:23 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236203 Archived-At: >> (defun replace-string (from-string to-string &optional delimited start end backward region-noncontiguous-p) >> ... >> (declare (arg start (if (use-region-p) (region-beginning))) >> (arg end (if (use-region-p) (region-end)))) >> >> and fix_command would pick them up from the symbol plist and use those >> forms instead of the value for these arguments. > > If we do that, it would be impossible to explicitly specify START and > END values that are different from an active region from ELisp code. If > the region is active, those arguments would always just be ignored. Indeed, some users might want to have numbers for START and END values to repeat the command exactly on the same previous region, but other users might want to repeat the command on a newly selected region with (region-beginning)/(region-end) in the command history. OTOH, keeping numbers in the history breaks replace-string for rectangular regions, because the command history will contain inconsistent numbers: some numbers from the previous replacement, and other numbers from the new rectangular region. For example: (replace-string "buffer" "foo" nil 1 2 nil '((3 . 4) (5 . 6))) where 1 2 are the old region boundaries, and '((3 . 4) (5 . 6)) is a new rectangular region boundaries.