From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: charles@aurox.ch (Charles A. Roelli) Newsgroups: gmane.emacs.bugs Subject: bug#27230: eldoc doc Date: Tue, 19 Sep 2017 22:02:33 +0200 Message-ID: References: <282e174a-e9c0-6bec-32f5-ed9d772e5e1d@yandex.ru> <83efu8ta6n.fsf@gnu.org> <4107369a-5d50-7e46-2e81-57c4ef5c7965@yandex.ru> <1f39b877-4cbf-96d8-a318-7edf95f10406@yandex.ru> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1505851432 29901 195.159.176.226 (19 Sep 2017 20:03:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 19 Sep 2017 20:03:52 +0000 (UTC) Cc: pok@netfonds.no, 27230@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 19 22:03:40 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duOk7-00075P-34 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 22:03:39 +0200 Original-Received: from localhost ([::1]:45156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duOkE-0000Vb-J7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Sep 2017 16:03:46 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33711) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1duOjc-00008K-Bh for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:03:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1duOjW-0001Pk-Ap for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:03:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1duOjW-0001PP-1H for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1duOjV-00051D-ML for bug-gnu-emacs@gnu.org; Tue, 19 Sep 2017 16:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: charles@aurox.ch (Charles A. Roelli) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Sep 2017 20:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27230 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27230-submit@debbugs.gnu.org id=B27230.150585136819269 (code B ref 27230); Tue, 19 Sep 2017 20:03:01 +0000 Original-Received: (at 27230) by debbugs.gnu.org; 19 Sep 2017 20:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:48662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duOjH-00050j-NC for submit@debbugs.gnu.org; Tue, 19 Sep 2017 16:02:47 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:35217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1duOjG-00050T-HO for 27230@debbugs.gnu.org; Tue, 19 Sep 2017 16:02:47 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id 8B38022542 for <27230@debbugs.gnu.org>; Tue, 19 Sep 2017 19:56:22 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-type:content-type:mime-version:references:subject :subject:in-reply-to:to:from:from:message-id:date:date; s=dkim; t=1505850981; x=1506714982; bh=4th0nbaSiFE6Prz5790A/qeBO+yEj/y5 LzhT1OEbofw=; b=QuTDRJZiscrKtocc6pWholDd+15T2ZGvf7CDgIYBWNlWLnVg irUdQDqbaaqhfl1vaOY0cg4AOV4YYVK55GfAgQxLr/zEATG6g3HI4iz902uP2XQb pwRHVl+9qlH72vyKJrMdypcVvO7X1HAmOW6NrKQFDcDID9HLDh/J3V8gkTI= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 3Jh8rjlmMG4M for <27230@debbugs.gnu.org>; Tue, 19 Sep 2017 19:56:21 +0000 (UTC) Original-Received: from gray (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 4F02A22541; Tue, 19 Sep 2017 19:56:17 +0000 (UTC) In-reply-to: (message from Dmitry Gutov on Fri, 15 Sep 2017 01:03:35 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137147 Archived-At: --=-=-= Content-Type: text/plain > From: Dmitry Gutov > 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Keep-old-calling-convention-of-eldoc-message.patch >From f872315286949e9b428ee108c66a8bb5f1131953 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" 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 --=-=-=--