From 7ef0b5f611c2d56ac2edb8de287190f04c4b8f32 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Mon, 21 Aug 2017 00:26:45 +0300 Subject: [PATCH] Simplify eldoc-message * lisp/emacs-lisp/eldoc.el (eldoc-message): Simplify. Don't use ARGS because no callers pass them. Discussed in bug#27230. --- lisp/emacs-lisp/eldoc.el | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index bca40ab87da..8c165461988 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -276,19 +276,12 @@ Otherwise work like `message'." (force-mode-line-update))) (apply 'message format-string args))) -(defun eldoc-message (&optional format-string &rest args) - "Display FORMAT-STRING formatted with ARGS as an ElDoc message. +(defun eldoc-message (&optional string) + "Display STRING as an ElDoc message if it's non-nil. -Store the message (if any) in `eldoc-last-message', and return it." +Also store it in `eldoc-last-message' and return that value." (let ((omessage eldoc-last-message)) - (setq eldoc-last-message - (cond ((eq format-string eldoc-last-message) eldoc-last-message) - ((null format-string) nil) - ;; If only one arg, no formatting to do, so put it in - ;; eldoc-last-message so eq test above might succeed on - ;; subsequent calls. - ((null args) format-string) - (t (apply #'format-message format-string args)))) + (setq eldoc-last-message string) ;; In emacs 19.29 and later, and XEmacs 19.13 and later, all messages ;; are recorded in a log. Do not put eldoc messages in that log since ;; they are Legion. -- 2.11.4.GIT