From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#55096: Eldoc showing elisp variable value beside docs Date: Mon, 25 Apr 2022 13:00:33 +0200 Message-ID: <20220425130033+0200.658972-stepnem@gmail.com> References: <87levt60u4.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25119"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 55096@debbugs.gnu.org, emacsq To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 25 13:01:25 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1niwT5-0006MA-W4 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 13:01:24 +0200 Original-Received: from localhost ([::1]:44878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niwT4-00023P-WA for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 07:01:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44960) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1niwSk-0001sN-1C for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 07:01:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1niwSj-00029b-N0 for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 07:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1niwSj-0002rh-Lp for bug-gnu-emacs@gnu.org; Mon, 25 Apr 2022 07:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Apr 2022 11:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55096 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 55096-submit@debbugs.gnu.org id=B55096.165088440510868 (code B ref 55096); Mon, 25 Apr 2022 11:01:01 +0000 Original-Received: (at 55096) by debbugs.gnu.org; 25 Apr 2022 11:00:05 +0000 Original-Received: from localhost ([127.0.0.1]:33402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niwRo-0002pE-9y for submit@debbugs.gnu.org; Mon, 25 Apr 2022 07:00:04 -0400 Original-Received: from mail-ed1-f44.google.com ([209.85.208.44]:37386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1niwRl-0002o6-OD for 55096@debbugs.gnu.org; Mon, 25 Apr 2022 07:00:02 -0400 Original-Received: by mail-ed1-f44.google.com with SMTP id k27so2719543edk.4 for <55096@debbugs.gnu.org>; Mon, 25 Apr 2022 04:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=NepP6VlGm/HqntsbzBKj+nyczwUiXYxo0w7+2dneyo0=; b=dzUpIHvMj1PUI4ALk2tioU44xe7T8lRAWkI8r1rrXvXCjkrFfV4iOBBhsMgCqW58bI kZC3hIyJ1GVrjpijoz0NbqXYJl6simNcPS5SzCBbeWYadavL2eJR5MSQddJ0mspLIAAp q7c6rHrIGBh4I0YgD/Tlfzqxg2Q0uCDhu7v8T5T4/rJ/MdEvKa31SY1424mnVSqvXiCK fTyQSL/nt4BMQ/qiOeQW2rZVKoPPowViJlmdkYWtV33sH805eWqtt+CsrcA6QbdMqCor Hz12vUtheizTJ0woDRtWeXZnbjYbV35LKaCRrFREC4i31nV2inCEImiKyzQ0RxA+ogW7 oD1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=NepP6VlGm/HqntsbzBKj+nyczwUiXYxo0w7+2dneyo0=; b=mCY3IBm7yWiW4aKRwhSsVg88jdS/jjwkntQpPq56jPlIs1UNEn/z+LI7cqMhtcuH5m j+oPNz/2QWx2G7gxyq3p87zyQOL0snEa3+rORjRv6yNS0emED0zb9tvejVdoAmTJ7HB+ L3RQA2C6L4EAU2QmUHB8n1gXiwaR8G6CyDnOZEbvHcG1LqhhfDhgaqLzd1B9VHJxkELN R9MNaw+zf+PCxdvBDnCTLVNCSlYPtxM74oZzsJVv2Ro66tdhi2EOLlp1jzH5ykU7LhNa 5KbKGzGDipxgThmKhXhdLuH66DTPRCOXlCWvBFsVOI3XVWJoYPd7INaw+SSdjWxeHEjV ewWQ== X-Gm-Message-State: AOAM533mq+hOJG1JM4/I1nZSbK7bhrEKgCGNznTfVyex1vzpoXYL+OVN PypuTl8blZNmqz/kY+NaMyo= X-Google-Smtp-Source: ABdhPJzX9+bfOWzMMy7npJqhQQ3iBH3WEGjhhw5FNbTPdhdOgfg2O6bGgZhRuG9PURu/19pC8A6ZAA== X-Received: by 2002:a50:f1c5:0:b0:425:dd04:b7a9 with SMTP id y5-20020a50f1c5000000b00425dd04b7a9mr7477105edl.388.1650884395784; Mon, 25 Apr 2022 03:59:55 -0700 (PDT) Original-Received: from localhost (internet-185-112-167-61.cznet.cz. [185.112.167.61]) by smtp.gmail.com with ESMTPSA id l3-20020aa7cac3000000b00422c961c8c9sm4409593edt.78.2022.04.25.03.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 03:59:55 -0700 (PDT) In-Reply-To: <87levt60u4.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 25 Apr 2022 10:09:39 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:230629 Archived-At: On Mon, 25 Apr 2022 10:09:39 +0200 Lars Ingebrigtsen wrote: > emacsq writes: > >> Eldoc showing the docs in the minibuffer is quite useful, but I often >> check elisp variable values too in the code, and it can be quite handy >> if eldoc shows that too simply by putting cursor on the variable. > > This would only work for global values, and in that case, you can just > `C-x C-e' the variable if you're interested in the value. > > So it seems like this would be of marginal utility. Anybody else got an > opinion here? FWIW, I've been running with some form of the following for many years, and I find it extremely useful: ;; cf. `elisp-eldoc-var-docstring' (defun my-elisp-eldoc-var-docstring-with-value (callback &rest _) "Document variable at point. Intended for `eldoc-documentation-functions' (which see)." (when-let ((cs (elisp--current-symbol))) (when (and (boundp cs) ;; nil and t are boundp! (not (null cs)) (not (eq cs t))) (funcall callback (format "%.1250S %s" (symbol-value cs) (let* ((doc (custom-variable-documentation cs)) (more (- (length doc) 1000))) (concat (propertize (s-truncate 1000 (if (string=3D doc "nil") "Undocumented." doc) "") 'face 'font-lock-doc-face) (when (> more 0) (format "[%sc more]" more))))) :thing cs :face 'font-lock-variable-name-face)))) It shows the current value, i.e. buffer-local for local variables, which is what I want. (It also shows more of the doc string: I use multi-line echo area.) --=20 =C5=A0t=C4=9Bp=C3=A1n