From 8497f93806be83e1fc8e496c1134c6e1680fea29 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 3 Dec 2013 23:42:01 -0500 Subject: [PATCH] Fix eldoc-in-minibuffer's modeline update. * lisp/emacs-lisp/eldoc.el (eldoc-minibuffer-message): Call force-mode-line-update is the proper buffer. Fixes: debbugs:16042 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/eldoc.el | 19 ++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b18de86df2..18b404f536 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-12-04 Stefan Monnier + + * emacs-lisp/eldoc.el (eldoc-minibuffer-message): + Call force-mode-line-update is the proper buffer (bug#16042). + 2013-12-04 Dmitry Gutov * vc/log-edit.el (log-edit-add-new-comment): Rename to 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) -- 2.20.1