Subject: Re: bug#45607: 27.1; compiled replace-string breaks repeat-complex-command

From: Juri Linkov <[email-masked]>
Date: Tue, 09 Aug 2022 22:30:54 +0300

>>   (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))
>
> OK, so I've now done this.  So somebody™ should go through the code base
> and adjust the code and add the new `declare' forms.  😀

Interesting, there are not too many uses of this pattern,
and most of them are related to replacement commands.
Ok, I could replace them with adding interactive-args.

lisp/isearch.el
2392:      (if (use-region-p) (region-beginning))
2393:      (if (use-region-p) (region-end))
lisp/replace.el
464: 	   (if (use-region-p) (region-beginning))
465: 	   (if (use-region-p) (region-end))
558: 	   (if (use-region-p) (region-beginning))
559: 	   (if (use-region-p) (region-end))
606: 	   (if (use-region-p) (region-beginning))
607: 	   (if (use-region-p) (region-end))
761: 	   (if (use-region-p) (region-beginning))
762: 	   (if (use-region-p) (region-end))
lisp/textmodes/paragraphs.el
518:                      (if (use-region-p) (region-beginning))
519:                      (if (use-region-p) (region-end))))
lisp/vc/log-view.el
581:    (list (if (use-region-p) (region-beginning) (point))
582:          (if (use-region-p) (region-end) (point))))
596:    (list (if (use-region-p) (region-beginning) (point))
597:          (if (use-region-p) (region-end) (point))))