|
From: | Dmitry Gutov |
Subject: | bug#38457: 27.0.50; dabbrev-expand regression due to message change |
Date: | Wed, 25 Dec 2019 18:30:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 25.12.2019 1:47, Juri Linkov wrote:
IDK, I tried to set resize-mini-windows to nil and in icomplete-mode can see the message.My bad, last time I was trying it was with ido-mode. There, the message comes at the end of all completions. With icomplete, however, it's printed before the completions. And it also appears to the left of the cursor. Is that intentional?Code in set-minibuffer-message was copied from minibuffer-message where handling of the cursor and after-string overlay was intentional.
Since after-string is used, shouldn't it always appear *after* the cursor?
Could ido-mode use an overlay the same way as it's used in icomplete that plays nicely with the set-minibuffer-message overlay?
This seems to work, but it needs more testing: diff --git a/lisp/ido.el b/lisp/ido.el index 79f259b819..d47450fc40 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4492,6 +4492,8 @@ ido-initiate-auto-merge (ido-tidy)) (throw 'ido contents)))) +(defvar ido--overlay nil) + (defun ido-exhibit () "Post command hook for Ido." ;; Find matching files and display a list in the minibuffer. @@ -4726,7 +4728,12 @@ ido-exhibit (let ((inf (ido-completions contents))) (setq ido-show-confirm-message nil) (ido-trace "inf" inf) - (insert inf)) + (when ido--overlay + (delete-overlay ido--overlay)) + (let ((o (make-overlay (point-max) (point-max) nil t t))) + (when (> (length inf) 0) + (put-text-property 0 1 'cursor t inf)) + (overlay-put o 'after-string inf) + (setq ido--overlay o))) )))) (defun ido-completions (name)
[Prev in Thread] | Current Thread | [Next in Thread] |