bug#81667: 32.0.50; `query-replace-show-preview' includes Quail IME UI and suggestions in buffer preview

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
> From: Rahul Martim Juliato <[email protected]>
> Cc: [email protected],  [email protected], [email protected],
>  [email protected]
> Date: Fri, 21 Aug 2026 00:38:59 -0300
> 
> diff --git a/lisp/international/quail.el b/lisp/international/quail.el
> index 39c10287f3c..f838bc9ab8e 100644
> --- a/lisp/international/quail.el
> +++ b/lisp/international/quail.el
> @@ -1998,14 +1998,22 @@ quail-require-guidance-buf
>  
>  (defun quail-minibuffer-message (string)
>    (message nil)
> -  (let ((point-max (point-max))
> -	(inhibit-quit t)
> -        (deactivate-mark nil))
> -    (save-excursion
> -      (goto-char point-max)
> -      (insert string))
> -    (sit-for 1000000)
> -    (delete-region point-max (point-max))
> +  (let ((inhibit-quit t)
> +        ;; Display the guidance with an overlay instead of inserting it
> +        ;; into the minibuffer, so that it stays out of the minibuffer
> +        ;; contents (bug#81667).
> +        (ov (make-overlay (point-max) (point-max) nil t t)))
> +    (unwind-protect
> +        (progn
> +          ;; Tell the display engine to keep the cursor before the
> +          ;; guidance, where point is.
> +          (unless (zerop (length string))
> +            (setq string (copy-sequence string))
> +            (put-text-property 0 1 'cursor t string))
> +          (overlay-put ov 'after-string string)
> +          (overlay-put ov 'priority 1100)
> +          (sit-for 1000000))
> +      (delete-overlay ov))

Please don't replace the old method of showing guidance with this new
method which uses an overlay.  The effect of such a change is too
dramatic for it to be made globally, for all the uses of Quail, so
doing that for the benefit of a relatively niche feature such as
query-replace-show-preview is not a good idea.

Instead, please make the new method be used when some new variable is
bound non-nil, and then bind that variable in
query-replace-show-preview.  This way, only this new feature is
affected, and we get enough time to learn how well this solution works
before thinking whether to make it the default.

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.