From unknown Mon Jun 23 04:12:35 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#17180 <17180@debbugs.gnu.org> To: bug#17180 <17180@debbugs.gnu.org> Subject: Status: [PATCH] eldoc doesn't find docstrings for variable aliases Reply-To: bug#17180 <17180@debbugs.gnu.org> Date: Mon, 23 Jun 2025 11:12:35 +0000 retitle 17180 [PATCH] eldoc doesn't find docstrings for variable aliases reassign 17180 emacs submitter 17180 Josh severity 17180 minor tag 17180 easy fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 03 12:41:29 2014 Received: (at submit) by debbugs.gnu.org; 3 Apr 2014 16:41:29 +0000 Received: from localhost ([127.0.0.1]:34662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVkhj-00068i-BJ for submit@debbugs.gnu.org; Thu, 03 Apr 2014 12:41:28 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42936) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVkhe-00068Y-R1 for submit@debbugs.gnu.org; Thu, 03 Apr 2014 12:41:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVkhV-0002H4-Mq for submit@debbugs.gnu.org; Thu, 03 Apr 2014 12:41:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,HTML_MESSAGE autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVkhV-0002H0-KE for submit@debbugs.gnu.org; Thu, 03 Apr 2014 12:41:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVkhP-0007bB-Ct for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 12:41:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVkhJ-0002Es-6M for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 12:41:07 -0400 Received: from mail-yh0-f49.google.com ([209.85.213.49]:49368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVkhJ-0002EO-1D for bug-gnu-emacs@gnu.org; Thu, 03 Apr 2014 12:41:01 -0400 Received: by mail-yh0-f49.google.com with SMTP id z6so1935671yhz.8 for ; Thu, 03 Apr 2014 09:41:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:content-type; bh=ix8K+91I5E6bp/ESn79ouasw07RU/HwG7w7iyg9YMng=; b=Blc0rVcluloIUzgZ5/ccR2G3okckTXVoDxTEusRT6Wfs6YphlRGx7+pdgdiJJQaKoj 6XZdkNbHillTP4qBuPWA+ZtUL1XIJ3ZFNl5W0spnaKF89FXl9C6UlPn/ec/L4qBbm0ZC Cjxf7xkDIu7LZEAlvPx4+R4VZd1uY7ERUIUc5j3W5qKmVx9qowZmXIgovfgE7AOFYSrW tL9pEqpEep8qLvYu5I8Z+bGP1xEdogXWEdmvcsypNuSZ/SDJk+VIVbmPOa59J4LSiCGm GBhxukauB7k351GkhMHClEqY//ZS4F06H7lJuVJ3ebHymHXr38m0TBEXvoKM1OT9EJ3R +kTg== X-Gm-Message-State: ALoCoQmo8YDIv94hF46uAx0xM2/6M1iky7+M+dZIpOlGl2hJE+fG5W8Y1aRsR+LJA2NOei2Hwcv7 X-Received: by 10.236.15.102 with SMTP id e66mr9640821yhe.69.1396543260090; Thu, 03 Apr 2014 09:41:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.170.138.198 with HTTP; Thu, 3 Apr 2014 09:40:30 -0700 (PDT) From: Josh Date: Thu, 3 Apr 2014 09:40:30 -0700 X-Google-Sender-Auth: sVgm-wNXOR_qAI69RigyhYZU5ck Message-ID: Subject: [PATCH] eldoc doesn't find docstrings for variable aliases To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=089e0122a3d4ee87af04f626105c X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --089e0122a3d4ee87af04f626105c Content-Type: text/plain; charset=ISO-8859-1 I noticed that eldoc doesn't currently show docstrings for variable aliases such as `inhibit-splash-screen'. The attached patch against the eldoc.el in trunk fixes the behavior and also cleans up the surrounding code a bit. If the latter is objectionable, the only functional change is passing `sym' through `indirect-variable' on the way to `documentation-property' as `describe-variable' does. Incidentally, I wondered whether this would be better addressed within `documentation-property' itself but I wasn't sure it would be correct to preclude the possibility of unique docstrings between aliases and their targets. === modified file 'lisp/emacs-lisp/eldoc.el' --- lisp/emacs-lisp/eldoc.el 2014-03-31 01:31:17 +0000 +++ lisp/emacs-lisp/eldoc.el 2014-04-03 16:14:43 +0000 @@ -418,18 +418,19 @@ ;; Return a string containing a brief (one-line) documentation string for ;; the variable. (defun eldoc-get-var-docstring (sym) - (when sym - (cond ((and (eq sym (aref eldoc-last-data 0)) - (eq 'variable (aref eldoc-last-data 2))) - (aref eldoc-last-data 1)) - (t - (let ((doc (documentation-property sym 'variable-documentation t))) - (cond (doc - (setq doc (eldoc-docstring-format-sym-doc - sym (eldoc-docstring-first-line doc) - 'font-lock-variable-name-face)) - (eldoc-last-data-store sym doc 'variable))) - doc))))) + (if (and (eq sym (aref eldoc-last-data 0)) + (eq 'variable (aref eldoc-last-data 2))) + (aref eldoc-last-data 1) + (let ((doc + (documentation-property (indirect-variable sym) + 'variable-documentation t))) + (when doc + (setq doc + (eldoc-docstring-format-sym-doc sym + (eldoc-docstring-first-line doc) + 'font-lock-variable-name-face)) + (eldoc-last-data-store sym doc 'variable)) + doc))) (defun eldoc-last-data-store (symbol doc type) (aset eldoc-last-data 0 symbol) --089e0122a3d4ee87af04f626105c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I noticed that eldoc doesn't currently show docstrings= for variable
aliases such as `inhibit-splash-screen'.=A0 The attach= ed patch against
the eldoc.el in trunk fixes the behavior and also clean= s up the
surrounding code a bit.=A0 If the latter is objectionable, the only
func= tional change is passing `sym' through `indirect-variable' on theway to `documentation-property' as `describe-variable' does.

Incidentally, I wondered whether this would be better addressed
with= in `documentation-property' itself but I wasn't sure it would becorrect to preclude the possibility of unique docstrings between
aliase= s and their targets.

=3D=3D=3D modified file 'lisp/emacs-lisp/eldoc.el'
--- lisp/= emacs-lisp/eldoc.el=A0=A0=A0 2014-03-31 01:31:17 +0000
+++ lisp/emacs-li= sp/eldoc.el=A0=A0=A0 2014-04-03 16:14:43 +0000
@@ -418,18 +418,19 @@
= =A0;; Return a string containing a brief (one-line) documentation string fo= r
=A0;; the variable.
=A0(defun eldoc-get-var-docstring (sym)
-=A0 (whe= n sym
-=A0=A0=A0 (cond ((and (eq sym (aref eldoc-last-data 0))
-=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (eq 'variable (aref eldoc-last-= data 2)))
-=A0=A0=A0=A0=A0=A0=A0=A0=A0 (aref eldoc-last-data 1))
-=A0=A0=A0=A0=A0=A0=A0=A0 (t
-=A0=A0=A0=A0=A0=A0=A0=A0=A0 (let ((doc (do= cumentation-property sym 'variable-documentation t)))
-=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 (cond (doc
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (setq doc (eldoc-docstring-format-sym-doc
-=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 sym (eldoc-docstring-first-line doc)
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 'font-lock-variable-name-face))
-=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (eldoc-last-data-store sym doc 'va= riable)))
-=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 doc)))))
+=A0 (if (and (= eq sym (aref eldoc-last-data 0))
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (eq = 9;variable (aref eldoc-last-data 2)))
+=A0=A0=A0=A0=A0 (aref eldoc-last-data 1)
+=A0=A0=A0 (let ((doc
+=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (documentation-property (indirect-variable sym)=
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 'variable-documentation t)))
+=A0= =A0=A0=A0=A0 (when doc
+=A0=A0=A0=A0=A0=A0=A0 (setq doc
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (eldoc-docstring-format-sym-doc sy= m
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (eldoc-d= ocstring-first-line doc)
+=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 'font-lock-variable-name-face))
+=A0=A0=A0=A0=A0=A0=A0 (eldoc-last-data-store sym doc 'variable))
+= =A0=A0=A0=A0=A0 doc)))

=A0(defun eldoc-last-data-store (symbol doc t= ype)
=A0=A0 (aset eldoc-last-data 0 symbol)



--089e0122a3d4ee87af04f626105c-- From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 03 13:37:10 2014 Received: (at 17180) by debbugs.gnu.org; 3 Apr 2014 17:37:10 +0000 Received: from localhost ([127.0.0.1]:34709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVlZd-0007dJ-Pa for submit@debbugs.gnu.org; Thu, 03 Apr 2014 13:37:10 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:45005) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVlZb-0007dA-K0 for 17180@debbugs.gnu.org; Thu, 03 Apr 2014 13:37:08 -0400 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s33Hb5XH006480; Thu, 3 Apr 2014 13:37:06 -0400 Received: by pastel.home (Postfix, from userid 20848) id 8470C60528; Thu, 3 Apr 2014 13:37:05 -0400 (EDT) From: Stefan Monnier To: Josh Subject: Re: bug#17180: [PATCH] eldoc doesn't find docstrings for variable aliases Message-ID: References: Date: Thu, 03 Apr 2014 13:37:05 -0400 In-Reply-To: (josh@foxtail.org's message of "Thu, 3 Apr 2014 09:40:30 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4901=0 X-NAI-Spam-Version: 2.3.0.9378 : core <4901> : inlines <688> : streams <1151318> : uri <1719300> X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 17180 Cc: 17180@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) > Incidentally, I wondered whether this would be better addressed > within `documentation-property' itself Yes, it should be fixed there directly. > but I wasn't sure it would be correct to preclude the possibility of > unique docstrings between aliases and their targets. documentation-property should simply first check variable-documentation and only when that fails, follow the alias indirection. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 23 21:46:58 2016 Received: (at control) by debbugs.gnu.org; 24 Feb 2016 02:46:58 +0000 Received: from localhost ([127.0.0.1]:41941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPTe-0001i5-L3 for submit@debbugs.gnu.org; Tue, 23 Feb 2016 21:46:58 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:41396) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aYPTc-0001g1-Kq for control@debbugs.gnu.org; Tue, 23 Feb 2016 21:46:56 -0500 Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aYPTF-00060S-Nt for control@debbugs.gnu.org; Wed, 24 Feb 2016 03:46:34 +0100 Date: Wed, 24 Feb 2016 13:46:30 +1100 Message-Id: <87k2luomex.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #17180 X-MailScanner-ID: 1aYPTF-00060S-Nt X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1456886795.7544@VdKKEvZnyki56zaTIHPiHw X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) tags 17180 - patch From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 09 19:15:30 2017 Received: (at control) by debbugs.gnu.org; 9 Aug 2017 23:15:30 +0000 Received: from localhost ([127.0.0.1]:53800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfaCI-0008Un-7i for submit@debbugs.gnu.org; Wed, 09 Aug 2017 19:15:30 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:35311) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfaCG-0008NE-7T for control@debbugs.gnu.org; Wed, 09 Aug 2017 19:15:28 -0400 Received: by mail-it0-f51.google.com with SMTP id 76so5331467ith.0 for ; Wed, 09 Aug 2017 16:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=2alZCMd5HTQhuuDWd9P+7tnatk9hZb+YhNrFVmp7Ik0=; b=bFWAWUFfQG4jBwItvtY4NtxM0TFwdWSTpD2fHIG9AOY4xKQbgSYRiRjYRK/0fDvu7I YuU5tDD2x0w6NZAK41+qdaNMAnBRYGv1v+Gn30ReQwNsL34N2L8HHu5Knol8fkoJx9qA /LoSEXUspf+2+bBAga9bOZzG4RuElFUrFMt06SuUsoeciUApmjD0YM3/W6HEqEGK9mw/ pdYSTl2E4gj2VEW38IDKOmzti0AltUwvUslM2VY+S/Sqg0OCt4bxdJTvKd/WmP2f+CiP HHqA3qIg3QNHPCBzMXb3qtQ9PENBgHmQ6uKRgB3YFweAeywihjvRYZMEDLWU9oS3Au19 unBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=2alZCMd5HTQhuuDWd9P+7tnatk9hZb+YhNrFVmp7Ik0=; b=XHtmmwY1fzo5+OPE7Ki74tpI6fu3FMkwx1YprtQ1VGYRgNKsEF7i5v4SNt5CYtf044 5msGbbgYNBRs6GzVlD1aZNYvnxuOdeSrP8UbPWnMgmQD4WVTKMBqTQ3RY3bwTbB92Lt3 LRkmhebrKvtizOvUu5qg24Mx5+xyOMb6ZebNkC1/eGBp7zex/qTmxciL+raziQzL7exq faj2S/TwDkzNGc5KHiMhqvfbylmbkHnhUKDr2OFUH+ZnxtufgDjjkzbHmUL6kzXJfH92 L/Jn7DscKXZvT8bcPud1/2KpCurUrS2Hs9uEJZ1OpxWM2gUg1bOxVbZmp4If4ZTF3q9N zfAA== X-Gm-Message-State: AHYfb5gHIWBwiWWj8Qfr1V1bMuHcEo6M4vs0uK05RFlvGA0TRH6MsRei LwmwE/cM9A1XIEjQ X-Received: by 10.36.84.202 with SMTP id t193mr8783834ita.144.1502320522628; Wed, 09 Aug 2017 16:15:22 -0700 (PDT) Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id 63sm6650251ith.4.2017.08.09.16.15.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Aug 2017 16:15:22 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #17180 Date: Wed, 09 Aug 2017 19:16:59 -0400 Message-ID: <87o9ro2uxg.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) severity 17180 minor tags 17180 + easy quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 10:27:11 2019 Received: (at 17180) by debbugs.gnu.org; 26 Jun 2019 14:27:11 +0000 Received: from localhost ([127.0.0.1]:36646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8tC-0004l5-Q2 for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:27:10 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8tA-0004kt-Ub for 17180@debbugs.gnu.org; Wed, 26 Jun 2019 10:27:09 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg8t5-0000hs-MO; Wed, 26 Jun 2019 16:27:06 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#17180: [PATCH] eldoc doesn't find docstrings for variable aliases References: Date: Wed, 26 Jun 2019 16:27:03 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 03 Apr 2014 13:37:05 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: >> Incidentally, I wondered whether this would be better addressed >> within `documentation-property' itself > > Yes, it should be fixed there directly. > >> but I wasn't sure it would be correct to p [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17180 Cc: Josh , 17180@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> Incidentally, I wondered whether this would be better addressed >> within `documentation-property' itself > > Yes, it should be fixed there directly. > >> but I wasn't sure it would be correct to preclude the possibility of >> unique docstrings between aliases and their targets. > > documentation-property should simply first check variable-documentation > and only when that fails, follow the alias indirection. I've now implemented this like what's below, and I hope that's what you meant. :-) diff --git a/src/doc.c b/src/doc.c index 3fa0eaac20..bc05d09df4 100644 --- a/src/doc.c +++ b/src/doc.c @@ -436,8 +436,20 @@ DEFUN ("documentation-property", Fdocumentation_property, documentation_property: tem = Fget (symbol, prop); + + /* If we don't have any documentation for this symbol, try to see whether + it's an indirect variable and get the documentation from there instead. */ + if (NILP (tem)) + { + Lisp_Object indirect = Findirect_variable (symbol); + if (!NILP (indirect)) + tem = Fget (indirect, prop); + } + if (EQ (tem, make_fixnum (0))) tem = Qnil; + + /* See if we want to look for the string in the DOC file. */ if (FIXNUMP (tem) || (CONSP (tem) && FIXNUMP (XCDR (tem)))) { Lisp_Object doc = tem; -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 10:27:14 2019 Received: (at control) by debbugs.gnu.org; 26 Jun 2019 14:27:14 +0000 Received: from localhost ([127.0.0.1]:36649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8tG-0004lM-39 for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:27:14 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg8tE-0004lD-Kz for control@debbugs.gnu.org; Wed, 26 Jun 2019 10:27:13 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg8tC-0000i0-3V for control@debbugs.gnu.org; Wed, 26 Jun 2019 16:27:12 +0200 Date: Wed, 26 Jun 2019 16:27:09 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #17180 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 17180 fixed close 17180 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 17180 fixed close 17180 27.1 quit From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 10:35:55 2019 Received: (at 17180) by debbugs.gnu.org; 26 Jun 2019 14:35:55 +0000 Received: from localhost ([127.0.0.1]:36680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg91f-0007C1-FQ for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:35:55 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:58600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg91e-0007Bk-1W for 17180@debbugs.gnu.org; Wed, 26 Jun 2019 10:35:54 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B0B3B8116F; Wed, 26 Jun 2019 10:35:48 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 54F098030C; Wed, 26 Jun 2019 10:35:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1561559743; bh=a6ni2JaiCQwKF/oCObVw1mhQyO65fs0Yj7fyVB2PlfI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ek0UtgpyVeD8vfe1IvRs7HzxEkyeceCR0fQTXZJHCPspUM6YnUQgWQ/TRY2736ioT 5i6z6rgQezM028dESbLUEegoizLY9Khqz3ALW45HVCZx5ESCQv9ZVdcf80HeEaJi52 0xKhUNwYoAS+/jqQbTGQ6F1o0PC/vz9RLwDoh0sq2QD4GvDjx0xk+1h05JjpOoHKl+ /JFzrSx7ZDoVHTaXSQblMWiSUSsJo7ud4TZjjauCsSX5CQezkXAJA+l0M2dL1DQzNS o08VS3onC0g61NgfEWzveTY3F6RSy5nCLG6ccnV1dMLWIYcwBx3ypVwlJOoEHNDuU3 8OqTZSVgPG6Zw== Received: from pastel (76-10-151-214.dsl.teksavvy.com [76.10.151.214]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 238A812000B; Wed, 26 Jun 2019 10:35:43 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#17180: [PATCH] eldoc doesn't find docstrings for variable aliases Message-ID: References: Date: Wed, 26 Jun 2019 10:35:42 -0400 In-Reply-To: (Lars Ingebrigtsen's message of "Wed, 26 Jun 2019 16:27:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17180 Cc: Josh , 17180@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > + /* If we don't have any documentation for this symbol, try to see whether > + it's an indirect variable and get the documentation from there instead. */ > + if (NILP (tem)) > + { > + Lisp_Object indirect = Findirect_variable (symbol); > + if (!NILP (indirect)) > + tem = Fget (indirect, prop); > + } In theory documentation-property can be used for any property, so it's not necessarily specific to variables. IOW I think we should only do that if `prop` is `variable-documentation`. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 26 10:37:12 2019 Received: (at 17180) by debbugs.gnu.org; 26 Jun 2019 14:37:12 +0000 Received: from localhost ([127.0.0.1]:36685 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg92t-0007Et-RI for submit@debbugs.gnu.org; Wed, 26 Jun 2019 10:37:12 -0400 Received: from quimby.gnus.org ([80.91.231.51]:49936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hg92s-0007Ek-5g for 17180@debbugs.gnu.org; Wed, 26 Jun 2019 10:37:10 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hg92n-0000mN-MA; Wed, 26 Jun 2019 16:37:08 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#17180: [PATCH] eldoc doesn't find docstrings for variable aliases References: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEURDw0JBwVMSki7ubdy b24EAwIuLCtErD9UAAACYUlEQVQ4jV1UwXbbIBBcKYnOWjXW2cY8zq3h5ZyifZyj16pnmaj8/yd0 ALl2uyfEMLszywrqN2vfiUitK9FK65OtQRk4Ami4xpcbwBW47T8AlFZizkBPDaXOpBLEK/Z67jtm 2lSctDGFSdzV44gubT4EpSrQd62UmGpurMo5GpJSyuNzLyraXgswdjrXUkrK8cmJfK0ABBB1KWns K3WWt3icS3EtAYyoUEO80kokNEsuHlTDxx6kySl0pUO+byWVQS1I5nFMBA9KjDvNMEtnkJU+8ed0 AYFEvLzMTIQNa816TN0mWcZzknjIDNbZmZMAo8HQBta25OKcYCBEK1HDpZqg0CwLcjGH0oe9J/An fgEFgORP+xBvd6Aw/gLfbwA6kaM2S6xvDihCPKTUjNZcR22dk6TO5loZQ1yp26ys1E4X63VqAx+y XI5a2+Nk0UidhZvW16tlHt5t6Pw6YpJcYH49wXkB+jC51b6V6u7KT6fdII9awcm5SHUNP6tDlTts +ni2Ysq+XXmk7xVoFVqKMSsNuaTfM8cK6OnBuCvr9wzkKbD/9ApxxdViCib7f1waGraHMdxHEd+B XrWYpPcazlpfB9bTENMYtS/TWGcOkX+DheZR+cnfZ64G5YsHfRJV0rnb7QCY51bgBfyIW6o/VNQ0 MzrWfHTRi9nU2mAEMadaaM7XxcsH1kF7qtGKQao9enjN+bXCCIq6AzO/nl3RlFX7HeAMfGYXMRaC ofz3zEuu9Et8VVS0ZcZcWT8nV7RCuknpXmP5AftVqsdj8QA861Aejtw5PB53YFMvRV3UBi/MH7Cj 5g9wELhsAAAAAElFTkSuQmCC Date: Wed, 26 Jun 2019 16:37:05 +0200 In-Reply-To: (Stefan Monnier's message of "Wed, 26 Jun 2019 10:35:42 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: >> + /* If we don't have any documentation for this symbol, try to see whether >> + it's an indirect variable and get the documentation from there >> instead. */ >> + if (NILP (tem)) >> + { >> + Lisp_ [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 17180 Cc: Josh , 17180@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: >> + /* If we don't have any documentation for this symbol, try to see whether >> + it's an indirect variable and get the documentation from there >> instead. */ >> + if (NILP (tem)) >> + { >> + Lisp_Object indirect = Findirect_variable (symbol); >> + if (!NILP (indirect)) >> + tem = Fget (indirect, prop); >> + } > > In theory documentation-property can be used for any property, so it's > not necessarily specific to variables. IOW I think we should only do > that if `prop` is `variable-documentation`. Ah, makes sense. I'll fix that up... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Mon Jun 23 04:12:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Jul 2019 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator