bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#45617: <query-replace> loses the edit region. Works in 23.3, broke i


From: Juri Linkov
Subject: bug#45617: <query-replace> loses the edit region. Works in 23.3, broke in 26.3
Date: Fri, 15 Jan 2021 10:54:56 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> I've removed the earlier patch and installed these changes. Now testing it!
> Thanks.
>
> -----Original Message-----
>  (defun query-replace-read-args (prompt regexp-flag &optional noerror)
>    (unless noerror
>      (barf-if-buffer-read-only))
> +  (save-mark-and-excursion
>    (let* ((from (query-replace-read-from prompt regexp-flag))
>        (to (if (consp from) (prog1 (cdr from) (setq from (car from)))
>              (query-replace-read-to from prompt regexp-flag))))

It seems this is what we need to push to be able to close this bug report.
Indeed, it fixes only query-replace commands.  But fixing all commands
that use the minibuffer is not as easy as adding 'save-mark-and-excursion'
like in the patch above.

The problem is that 'read-from-minibuffer' is implemented in C.
If it was implemented in Lisp, it would be easy to add just
'save-mark-and-excursion', but in C this is impossible.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]