summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/eldoc.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/eldoc.el')
-rw-r--r--lisp/emacs-lisp/eldoc.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 250f93800e..8ec6b41efe 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -216,6 +216,9 @@ expression point is on."
Otherwise work like `message'."
(if (minibufferp)
(progn
+ (add-hook 'minibuffer-exit-hook
+ (lambda () (setq eldoc-mode-line-string nil))
+ nil t)
(with-current-buffer
(window-buffer
(or (window-in-direction 'above (minibuffer-window))
@@ -226,17 +229,11 @@ Otherwise work like `message'."
(setq mode-line-format
(list "" '(eldoc-mode-line-string
(" " eldoc-mode-line-string " "))
- mode-line-format))))
- (add-hook 'minibuffer-exit-hook
- (lambda () (setq eldoc-mode-line-string nil))
- nil t)
- (cond
- ((null format-string)
- (setq eldoc-mode-line-string nil))
- ((stringp format-string)
- (setq eldoc-mode-line-string
- (apply 'format format-string args))))
- (force-mode-line-update))
+ mode-line-format)))
+ (setq eldoc-mode-line-string
+ (when (stringp format-string)
+ (apply 'format format-string args)))
+ (force-mode-line-update)))
(apply 'message format-string args)))
(defun eldoc-message (&rest args)