emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 7ef0b5f 1/3: Simplify eldoc-message


From: Dmitry Gutov
Subject: [Emacs-diffs] master 7ef0b5f 1/3: Simplify eldoc-message
Date: Sun, 20 Aug 2017 18:10:27 -0400 (EDT)

branch: master
commit 7ef0b5f611c2d56ac2edb8de287190f04c4b8f32
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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 bca40ab..8c16546 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.



reply via email to

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