Skip to content

Commit 5abd8d7

Browse files
committed
Improve display of temporary echo messages
* lisp/minibuffer.el (set-minibuffer-message): Fix cursor position for the temporary display of an echo-area message when minibuffer is active. Ensure the message is visible even if the end of the completion candidates presented by the likes of Icomplete mode is not visible due to its length, under resize-mini-windows = nil. (Bug#38457)
1 parent f2f9f2f commit 5abd8d7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lisp/minibuffer.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ and `clear-minibuffer-message' called automatically via
766766
(defun set-minibuffer-message (message)
767767
"Temporarily display MESSAGE at the end of the minibuffer.
768768
The text is displayed for `minibuffer-message-clear-timeout' seconds
769-
(if the value is a number), or until the next input event arrives,
769+
\(if the value is a number), or until the next input event arrives,
770770
whichever comes first.
771771
Unlike `minibuffer-message', this function is called automatically
772772
via `set-message-function'."
@@ -790,8 +790,14 @@ via `set-message-function'."
790790
;; The current C cursor code doesn't know to use the overlay's
791791
;; marker's stickiness to figure out whether to place the cursor
792792
;; before or after the string, so let's spoon-feed it the pos.
793-
(put-text-property 0 1 'cursor t message))
793+
(put-text-property 0 1 'cursor 1 message))
794794
(overlay-put minibuffer-message-overlay 'after-string message)
795+
;; Make sure the overlay with the message is displayed before
796+
;; any other overlays in that position, in case they have
797+
;; resize-mini-windows set to nil and the other overlay strings
798+
;; are too long for the mini-window width. This makes sure the
799+
;; temporary message will always be visible.
800+
(overlay-put minibuffer-message-overlay 'priority 1100)
795801

796802
(when (numberp minibuffer-message-clear-timeout)
797803
(setq minibuffer-message-timer

0 commit comments

Comments
 (0)