emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 5abd8d7: Improve display of temporary echo messages


From: Eli Zaretskii
Subject: emacs-27 5abd8d7: Improve display of temporary echo messages
Date: Tue, 21 Jan 2020 10:59:28 -0500 (EST)

branch: emacs-27
commit 5abd8d73b08f0ef57b1ddcab298fa7a3aff8f45c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 lisp/minibuffer.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 4831bf7..0589211 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -766,7 +766,7 @@ and `clear-minibuffer-message' called automatically via
 (defun set-minibuffer-message (message)
   "Temporarily display MESSAGE at the end of the minibuffer.
 The text is displayed for `minibuffer-message-clear-timeout' seconds
-(if the value is a number), or until the next input event arrives,
+\(if the value is a number), or until the next input event arrives,
 whichever comes first.
 Unlike `minibuffer-message', this function is called automatically
 via `set-message-function'."
@@ -790,8 +790,14 @@ via `set-message-function'."
         ;; The current C cursor code doesn't know to use the overlay's
         ;; marker's stickiness to figure out whether to place the cursor
         ;; before or after the string, so let's spoon-feed it the pos.
-        (put-text-property 0 1 'cursor t message))
+        (put-text-property 0 1 'cursor 1 message))
       (overlay-put minibuffer-message-overlay 'after-string message)
+      ;; Make sure the overlay with the message is displayed before
+      ;; any other overlays in that position, in case they have
+      ;; resize-mini-windows set to nil and the other overlay strings
+      ;; are too long for the mini-window width.  This makes sure the
+      ;; temporary message will always be visible.
+      (overlay-put minibuffer-message-overlay 'priority 1100)
 
       (when (numberp minibuffer-message-clear-timeout)
         (setq minibuffer-message-timer



reply via email to

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