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: Tue, 09 Aug 2022 21:41:24 +0300 Organization: LINKOV.NET Message-ID: <868rnxqmy3.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> <861quywusu.fsf@mail.linkov.net> <8735felbi7.fsf@gnus.org> <864jzursq8.fsf@mail.linkov.net> <87zghlgxk4.fsf@gnus.org> <87bksuzvs5.fsf@gnus.org> <86iln264vg.fsf@mail.linkov.net> <871qtpzck5.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33007"; 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: Michael Heerdegen , 45607@debbugs.gnu.org, Allen Li To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 09 20:46:12 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 1oLUF2-0008SK-J2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 20:46:12 +0200 Original-Received: from localhost ([::1]:45996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oLUF1-0005tm-9J for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Aug 2022 14:46:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oLUDu-0005Ub-QH for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 14:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55233) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oLUDu-0000pg-En for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 14:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oLUDu-0001AC-B2 for bug-gnu-emacs@gnu.org; Tue, 09 Aug 2022 14:45: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: Tue, 09 Aug 2022 18:45: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.16600706744267 (code B ref 45607); Tue, 09 Aug 2022 18:45:02 +0000 Original-Received: (at 45607) by debbugs.gnu.org; 9 Aug 2022 18:44:34 +0000 Original-Received: from localhost ([127.0.0.1]:44980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLUDR-00016l-MT for submit@debbugs.gnu.org; Tue, 09 Aug 2022 14:44:33 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:53189) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oLUDP-00016W-3p for 45607@debbugs.gnu.org; Tue, 09 Aug 2022 14:44:31 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4A91F40005; Tue, 9 Aug 2022 18:44:22 +0000 (UTC) In-Reply-To: <871qtpzck5.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 09 Aug 2022 17:00:58 +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:239204 Archived-At: > It should be added to all commands that work on the region like this, > yes. But I wondered whether we should make some trivial helper > functions first like > > (defun use-region-beginning () > "Return the start of the region if `use-region-p'." > (and (use-region-p) (region-beginning))) > > and the same for -end to avoid having to repeat that code phrase so many > places. Indeed, this will help to make the history items shorter: (replace-string "a" "b" nil (if (use-region-p) (region-beginning)) (if (use-region-p) (region-end))) -> (replace-string "a" "b" nil (use-region-beginning) (use-region-end))