[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master dff9657c6c0 2/2: Redirect eldoc messages to the mode-line when in
From: |
Dmitry Gutov |
Subject: |
master dff9657c6c0 2/2: Redirect eldoc messages to the mode-line when in edebug-mode |
Date: |
Fri, 3 Mar 2023 19:42:57 -0500 (EST) |
branch: master
commit dff9657c6c039ad35734f1d98e0ccc71b85a1a24
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Redirect eldoc messages to the mode-line when in edebug-mode
* lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Redirect
eldoc messages to the mode-line when in edebug-mode (bug#56459).
(eldoc-minibuffer--cleanup): New function, used in above.
---
lisp/emacs-lisp/eldoc.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 83948ad00d4..74bef264bf1 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -296,13 +296,9 @@ reflect the change."
This function displays the message produced by formatting ARGS
with FORMAT-STRING on the mode line when the current buffer is a minibuffer.
Otherwise, it displays the message like `message' would."
- (if (minibufferp)
+ (if (or (bound-and-true-p edebug-mode) (minibufferp))
(progn
- (add-hook 'minibuffer-exit-hook
- (lambda () (setq eldoc-mode-line-string nil
- ;; https://debbugs.gnu.org/16920
- eldoc-last-message nil))
- nil t)
+ (add-hook 'post-command-hook #'eldoc-minibuffer--cleanup)
(with-current-buffer
(window-buffer
(or (window-in-direction 'above (minibuffer-window))
@@ -321,6 +317,13 @@ Otherwise, it displays the message like `message' would."
(force-mode-line-update)))
(apply #'message format-string args)))
+(defun eldoc-minibuffer--cleanup ()
+ (unless (or (bound-and-true-p edebug-mode) (minibufferp))
+ (setq eldoc-mode-line-string nil
+ ;; https://debbugs.gnu.org/16920
+ eldoc-last-message nil)
+ (remove-hook 'post-command-hook #'eldoc-minibuffer--cleanup)))
+
(make-obsolete
'eldoc-message "use `eldoc-documentation-functions' instead." "eldoc-1.1.0")
(defun eldoc-message (&optional string) (eldoc--message string))