all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: charles@aurox.ch (Charles A. Roelli)
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: pok@netfonds.no, 27230@debbugs.gnu.org
Subject: bug#27230: eldoc doc
Date: Tue, 19 Sep 2017 22:02:33 +0200	[thread overview]
Message-ID: <m2d16mmp7q.fsf@aurox.ch> (raw)
In-Reply-To: <c4014196-2bce-fdae-2a91-e66f13fe2c1f@yandex.ru> (message from Dmitry Gutov on Fri, 15 Sep 2017 01:03:35 +0300)

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Fri, 15 Sep 2017 01:03:35 +0300
> 
> > Right.  But why should we break its calling convention without good
> > reason, when we can see that now that other packages have been using
> > it?
> 
> Now they know they should fix it, though.

Unfortunately it means there are probably other users of the function,
and if we don't document the change, the function should stay as is.
Attached is a patch that brings back the old behavior, without the
convoluted buggy logic for setting eldoc-last-message.  What do you
think?

And from an earlier message:

> Aside from breaking the "obviously wrong" callers like explained above, 
> the code had a subtle bug where calling it with no format arguments, and 
> then with some arguments, wouldn't update the message area.

Should be fixed with this patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Keep-old-calling-convention-of-eldoc-message.patch --]
[-- Type: text/x-patch, Size: 1410 bytes --]

From f872315286949e9b428ee108c66a8bb5f1131953 Mon Sep 17 00:00:00 2001
From: "Charles A. Roelli" <charles@aurox.ch>
Date: Tue, 19 Sep 2017 22:00:54 +0200
Subject: [PATCH] Keep old calling convention of 'eldoc-message'

* lisp/emacs-lisp/eldoc.el (eldoc-message): Keep its old calling
convention, as it's used by other packages.  See the discussion in
Bug#27230, and the previous change 7ef0b5f6 ("Simplify
eldoc-message") of 2017-08-21.
---
 lisp/emacs-lisp/eldoc.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index cba9a00..7176eb8 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -276,12 +276,13 @@ eldoc-minibuffer-message
           (force-mode-line-update)))
     (apply 'message format-string args)))
 
-(defun eldoc-message (&optional string)
+(defun eldoc-message (&optional format-string &rest args)
   "Display STRING as an ElDoc message if it's non-nil.
 
 Also store it in `eldoc-last-message' and return that value."
   (let ((omessage eldoc-last-message))
-    (setq eldoc-last-message string)
+    (setq eldoc-last-message
+          (if args (apply #'format-message format-string args) format-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.9.4


  reply	other threads:[~2017-09-19 20:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-04 10:38 bug#27230: eldoc doc Charles A. Roelli
2017-06-05 22:08 ` Dmitry Gutov
2017-06-06 18:33   ` Charles A. Roelli
2017-06-06 20:19     ` Dmitry Gutov
2017-06-25  9:14       ` Charles A. Roelli
2017-06-25 14:26         ` Eli Zaretskii
2017-06-25 19:47           ` Charles A. Roelli
2017-06-26  1:04             ` Dmitry Gutov
2017-06-27 19:51               ` Charles A. Roelli
2017-06-27 23:50                 ` Dmitry Gutov
2017-06-28 19:16                   ` Charles A. Roelli
2017-07-22  8:11                     ` Eli Zaretskii
2017-09-14 11:47               ` Peder O. Klingenberg
2017-09-14 12:02                 ` Dmitry Gutov
2017-09-14 19:39                   ` Charles A. Roelli
2017-09-14 22:03                     ` Dmitry Gutov
2017-09-19 20:02                       ` Charles A. Roelli [this message]
2017-09-20 18:12                         ` Charles A. Roelli
2017-09-21 14:23                           ` Dmitry Gutov
2017-09-21 18:33                             ` Charles A. Roelli
2017-09-21 23:05                               ` Dmitry Gutov
2017-09-25 23:26                               ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2d16mmp7q.fsf@aurox.ch \
    --to=charles@aurox.ch \
    --cc=27230@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=pok@netfonds.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.