unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	45607@debbugs.gnu.org, Allen Li <darkfeline@felesatra.moe>
Subject: bug#45607: 27.1; compiled replace-string breaks repeat-complex-command
Date: Wed, 06 Jul 2022 10:53:13 +0300	[thread overview]
Message-ID: <861quywusu.fsf@mail.linkov.net> (raw)
In-Reply-To: <871quzaagc.fsf@web.de> (Michael Heerdegen's message of "Tue, 05 Jul 2022 16:41:23 +0200")

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





  parent reply	other threads:[~2022-07-06  7:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-02  9:04 bug#45607: 27.1; compiled replace-string breaks repeat-complex-command Allen Li
2022-06-07 12:38 ` Lars Ingebrigtsen
2022-06-07 18:40   ` Juri Linkov
2022-06-07 18:58     ` Eli Zaretskii
2022-06-09  8:39       ` Allen Li
2022-06-09  9:23         ` Eli Zaretskii
2022-06-08 12:05     ` Lars Ingebrigtsen
2022-06-09 18:52       ` Lars Ingebrigtsen
2022-06-09 18:56         ` Lars Ingebrigtsen
2022-06-09 20:51           ` Drew Adams
2022-07-05 14:41           ` Michael Heerdegen
2022-07-05 16:45             ` Lars Ingebrigtsen
2022-07-05 18:47               ` Michael Heerdegen
2022-07-06  7:53             ` Juri Linkov [this message]
2022-07-06 11:35               ` Lars Ingebrigtsen
2022-07-06 18:39                 ` Juri Linkov
2022-07-07  8:02                   ` Lars Ingebrigtsen
2022-08-08 13:53                     ` Lars Ingebrigtsen
2022-08-08 17:07                       ` Juri Linkov
2022-08-09 15:00                         ` Lars Ingebrigtsen
2022-08-09 18:41                           ` Juri Linkov
2022-08-09 18:48                             ` Eli Zaretskii
2022-08-09 19:15                               ` Lars Ingebrigtsen
2022-08-09 19:25                                 ` Eli Zaretskii
2022-08-09 19:30                                   ` Lars Ingebrigtsen
2022-08-09 19:14                             ` Lars Ingebrigtsen
2022-08-09 19:30                               ` Juri Linkov
2022-08-12 13:01                                 ` Lars Ingebrigtsen
2022-08-12 17:39                                   ` Juri Linkov
2022-08-13 11:46                                     ` Lars Ingebrigtsen
2022-08-13 19:30                                       ` Juri Linkov
2022-08-15  6:37                                         ` Lars Ingebrigtsen
2022-09-04 16:57                                 ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861quywusu.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=45607@debbugs.gnu.org \
    --cc=darkfeline@felesatra.moe \
    --cc=larsi@gnus.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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