GNU bug report logs - #31094
25.2: Feature Reuqest: apropos-value: limit scope [CODE INCLUDED]

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Boruch Baum <boruch_baum@HIDDEN>; dated Sun, 8 Apr 2018 07:40:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 16:32:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 12:32:33 2018
Received: from localhost ([127.0.0.1]:42751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5DF3-0001in-A7
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 12:32:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49032)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f5DF1-0001iZ-Am
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 12:32:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f5DEt-0004Ie-0z
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 12:32:26 -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_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36577)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f5DEs-0004IP-UC; Sun, 08 Apr 2018 12:32:22 -0400
Received: from [176.228.60.248] (port=3691 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f5DEs-0008HR-CB; Sun, 08 Apr 2018 12:32:22 -0400
Date: Sun, 08 Apr 2018 19:32:25 +0300
Message-Id: <83bmetzmjq.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
In-reply-to: <20180408141330.qzrustisiaea7ozg@HIDDEN> (message
 from Boruch Baum on Sun, 8 Apr 2018 10:13:30 -0400)
Subject: Re: bug#31094: Code for second solution
References: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
 <20180408110901.4dukaueroieovrkp@HIDDEN>
 <83muydzw32.fsf@HIDDEN>
 <20180408131700.uwh3bozuqu76xf7m@HIDDEN>
 <83fu45ztuc.fsf@HIDDEN>
 <20180408141330.qzrustisiaea7ozg@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 31094
Cc: 31094 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> Date: Sun, 8 Apr 2018 10:13:30 -0400
> From: Boruch Baum <boruch_baum@HIDDEN>
> Cc: 31094 <at> debbugs.gnu.org
> 
> > > The second snippet is controlled by a boolean defcustom variable,
> > > defaulting to the current long print-out behavior.
> >
> > That sounds sub-optimal to me: completely changing the behavior of a
> > command given an option is not the best UI, IMO.  Two different
> > commands are better.
> 
> You're over stating the behavior change of the second snippet; it
> changes the detail level of the output. True, as written, it 'breaks'
> the response to <RET> keybinding, but I consider that trivial, because
> the same functionality is available with `C-h v` or `C-h f', and to the
> benefit that the snippet is much leaner on memory. If you insist that
> you absolutely need that <RET> key to display the symbol's complete
> documentation, that can be done without rejecting the idea of the
> snippet, but it's a minor coding hassle for no real reason; Everyone
> knows `C-h v' and `C-h f' describe the symbol at point.

I hear you.  Let's see what others think about this.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 14:13:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 10:13:45 2018
Received: from localhost ([127.0.0.1]:42617 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5B4f-0002xV-GM
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 10:13:45 -0400
Received: from mout.gmx.net ([212.227.17.21]:34647)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1f5B4d-0002xJ-Hn
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 10:13:40 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
 (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id
 0LbA4j-1ecxro0JDt-00kfXP; Sun, 08 Apr 2018 16:13:33 +0200
Date: Sun, 8 Apr 2018 10:13:30 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#31094: Code for second solution
Message-ID: <20180408141330.qzrustisiaea7ozg@HIDDEN>
References: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
 <20180408110901.4dukaueroieovrkp@HIDDEN>
 <83muydzw32.fsf@HIDDEN>
 <20180408131700.uwh3bozuqu76xf7m@HIDDEN>
 <83fu45ztuc.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83fu45ztuc.fsf@HIDDEN>
User-Agent: NeoMutt/20180223
X-Provags-ID: V03:K1:HAgC/t6Ozj61TvPxalNYrAgEvsVirRHx0WLie2deQXE2pm9s03B
 izyaamyQrnPvUnUMbpe4WLphyzV4ryCiupkws1iGD92Ru78V6Q61s5vzyf+3fizx4ZWOiCy
 /wqg66YRhOcNtSj/J9AzpRljArn0ceHbLQ6QdrVDsjsNbDHS96obe9wek0PDHviqZrr/++o
 4cy907YyhALd2d76uZjug==
X-UI-Out-Filterresults: notjunk:1;V01:K0:VEOwZna5C6w=:qbuKEMcKOWyTAWAMn08XUe
 k/fXyTNb/FQgQWQdX/rkzsmU6dDzA258/U0iIglDuVpInDbGAtO9uXtnLJjS/u6OI9kE2tb6i
 wuZzuP8gFO5IIxBzM2Du6kxUHmqwn6TxynsuqHY7faChystYq6SJsFjs5WMgnS440zBXsU1IA
 tT9ZDAbSztpL8lbkJANrn+bKXJdv0+iS7/lc3PwZe8L8I0h2Lk2fVveYqRYacva/Lv4ZPBWBo
 AIuYG8Rh/ynfEdHQjrNirGkH8c7ysK11EYgG5K+ka6gHYVTHwZqFwr5S1rxrN1UVwIKut0lht
 zZycKCBEMHvQDtFsKPBIUxe5eB+hnqysIHm/LLNyTeR+TaWk6e2OblFNU53tmINrCr8N4EIVL
 789hlfv3d4dQVrvNAstOB/WU/3Xo9/1NcKXWmcobyUZr+0aDk644CfgEvG9cXtz7dNkn7w0Gs
 lC6m2tJErToOnHK0vtMA3HlRcC0bkSXchsW/MuxPZFERV6L4SZ3o7060XFU/0XacD9cWHtSlm
 wHnDvdyWdoTCsFaS706rlly9mdDVL12y/B+Bz4GWZo5bpNMg0HjRzlR+LuAzak/Bm5ubdQV8C
 0TwxprSGjuw9YYXb3pwj0vDal4Q/vs5SWSCnnNccopXpZUO4YcqieijY791l2zWcn29FOHHfl
 vWDhRCs2UI5pDlzhpJtBvDbJBKCQZM+WZwS/LFoxhQcDtGI0u1iQYbNd8zx3RMypKf1todOVd
 rLtd7/GZQ7iLH+HiKqd8DeHTLrq2mnU7SMPnPc7K3716iXvY4Nbs1weSlyQO+sCm8PCCmI38M
 60d2daZef4N3RWAJX4GdKlnFFrU/g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 31094
Cc: 31094 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2018-04-08 16:54, Eli Zaretskii wrote:
> > Date: Sun, 8 Apr 2018 09:17:01 -0400
> > From: Boruch Baum <boruch_baum@HIDDEN>
> > Cc: 31094 <at> debbugs.gnu.org
> >
> > The first code snippet already only changes behavior when the function
> > is called with either two or three universal prefix args.
>
> I was under the impression that the first variant was not what you were
> promoting.

Different strokes for different folks. Personally, I would end up using
the second variant, but I wouldn't begrudge anyone the first option and
they can co-exist peacefully in the code. Both are minor tweaks.

> > The second snippet is controlled by a boolean defcustom variable,
> > defaulting to the current long print-out behavior.
>
> That sounds sub-optimal to me: completely changing the behavior of a
> command given an option is not the best UI, IMO.  Two different
> commands are better.

You're over stating the behavior change of the second snippet; it
changes the detail level of the output. True, as written, it 'breaks'
the response to <RET> keybinding, but I consider that trivial, because
the same functionality is available with `C-h v` or `C-h f', and to the
benefit that the snippet is much leaner on memory. If you insist that
you absolutely need that <RET> key to display the symbol's complete
documentation, that can be done without rejecting the idea of the
snippet, but it's a minor coding hassle for no real reason; Everyone
knows `C-h v' and `C-h f' describe the symbol at point.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 13:55:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 09:55:01 2018
Received: from localhost ([127.0.0.1]:42056 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5Ama-0002Nv-Sv
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:55:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41617)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f5AmY-0002Nh-Op
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:54:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f5AmP-0004dP-IM
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:54:53 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34428)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f5AmP-0004dB-EK; Sun, 08 Apr 2018 09:54:49 -0400
Received: from [176.228.60.248] (port=3227 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f5AmO-0006yG-Th; Sun, 08 Apr 2018 09:54:49 -0400
Date: Sun, 08 Apr 2018 16:54:51 +0300
Message-Id: <83fu45ztuc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
In-reply-to: <20180408131700.uwh3bozuqu76xf7m@HIDDEN> (message
 from Boruch Baum on Sun, 8 Apr 2018 09:17:01 -0400)
Subject: Re: bug#31094: Code for second solution
References: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
 <20180408110901.4dukaueroieovrkp@HIDDEN>
 <83muydzw32.fsf@HIDDEN>
 <20180408131700.uwh3bozuqu76xf7m@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 31094
Cc: 31094 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> Date: Sun, 8 Apr 2018 09:17:01 -0400
> From: Boruch Baum <boruch_baum@HIDDEN>
> Cc: 31094 <at> debbugs.gnu.org
> 
> The first code snippet already only changes behavior when the function
> is called with either two or three universal prefix args.

I was under the impression that the first variant was not what you were
promoting.

> The second snippet is controlled by a boolean defcustom variable,
> defaulting to the current long print-out behavior.

That sounds sub-optimal to me: completely changing the behavior of a
command given an option is not the best UI, IMO.  Two different
commands are better.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 13:17:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 09:17:14 2018
Received: from localhost ([127.0.0.1]:42017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5AC1-0001Vo-PS
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:17:13 -0400
Received: from mout.gmx.net ([212.227.17.22]:53975)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1f5ABz-0001VZ-Ot
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:17:12 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
 (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id
 0M8IuM-1eIP5O3aHy-00vxF6; Sun, 08 Apr 2018 15:17:05 +0200
Date: Sun, 8 Apr 2018 09:17:01 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#31094: Code for second solution
Message-ID: <20180408131700.uwh3bozuqu76xf7m@HIDDEN>
References: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
 <20180408110901.4dukaueroieovrkp@HIDDEN>
 <83muydzw32.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <83muydzw32.fsf@HIDDEN>
User-Agent: NeoMutt/20180223
X-Provags-ID: V03:K1:WRDOH5nYP6U2eFwz4xH5KcAZqeebC/KJyCFGGNR4FA9s9FYHBm5
 qb89GfOaOcXnwDlCdhbEZbutzE/Rl0W4FGrRCoRjfIf3j8BStKHSrAk6Ea9NZsEYD3Y2iaC
 SGtJS9zJ9g7Lj1XNdXVNmwN90JuadpZRdXu/1huyRUd+kqiBv9KnsABN41GfcvRqptEuMJo
 qLEtIfeEaWN2fjWAmkBsg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:TRnuC3ZH3Do=:IdR8mmoiL4KyoEA7scMMe+
 QoqOgjOLvSQZ19+loZgGIHsIWP8eImqNgHo875I3Lz25vYgM/+PUQPYFBGEsBK0xWipfCCml3
 i8nJf9dTABgWmbbiHaqryOhWicVsD53clVMcgpIj4sj+mSC6ZJUF8aUedJReFe4EdIKJo/vl+
 VEgZ5STYnzoMa+PLJaUmLBcNYGZxmky13bMD99kZKfaao3CIEThtzRM5e0p/4o1y7X92R38oR
 UzQblcgl8E3iSF3wvrm7ge73kzRyh2AbvROapNq/ornI3RFNqjF4hKI6pjjyBm8qR93Zrz95A
 lqv+B4dYt5pGScQ4eOr6ahSnh20gvz52i8c0bUpLu0OFffBWuPUP+RWxxU0zFOogzHm1y5E1A
 4dsgejpwHCTR0jUpHZIa69Yf3AbC2zvY18sy0nzECYCADPyre6wrqQmsjXCmI42ljLoQHLPu5
 5OM9QxYzKTi+9BqM1ChGYp17sVEDMlPYhdWdHYMgqntWrmUm/e4D29eETcjS9AyjntLRW87fm
 etWgvfMui+gxCZtt4h219JkynXGbt4bTI3joRUnAcASmpsAhJpGTxDo4sh+ii0oqdQj+4+40X
 6dQSDlFtLB9IZGZPmLYp/Ialw+FQ0CFNeuZZU6UDiHv2mV53napGDRKfKFqNhmdcaNhnLvwkA
 4dXIvz4EgUSqR3Kr4Ep1BfqIr9wZZddtPUkhDICEzwZ+WYP7fwEtfFiUVssQKDNJVjLX6t//B
 DL6E2tXdsRj5s5p3WL8TL26WPbfGAPjdiw3i9e+Rj5XntiYlGaAUQZVqDkYr9xZZcX+A8i81C
 THcAP/eyE07LGcK5DW0nNlbnjlJ1Q==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 31094
Cc: 31094 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

On 2018-04-08 16:06, Eli Zaretskii wrote:
> Why not do this the other way around: make apropos-value present a
> shorter list when invoked with some special value of the prefix
> argument?  Or even make this a new command?  That way, people's muscle
> memory doesn't need to change, which I think is a Good Thing, given
> that I think we never had any complaints about the current behavior.

If either or both proposed changes are adopted, there will be no need to
change muscle memory for those who want the behavior to remain the same.

The first code snippet already only changes behavior when the function
is called with either two or three universal prefix args.

The second snippet is controlled by a boolean defcustom variable,
defaulting to the current long print-out behavior.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 13:06:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 09:06:35 2018
Received: from localhost ([127.0.0.1]:42009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f5A1j-0001H0-E2
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:06:35 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47072)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1f5A1h-0001Gl-RZ
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:06:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1f5A1X-0006xd-It
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 09:06:28 -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.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33901)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1f5A1X-0006xJ-Fh; Sun, 08 Apr 2018 09:06:23 -0400
Received: from [176.228.60.248] (port=3110 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1f5A1W-00043a-LB; Sun, 08 Apr 2018 09:06:23 -0400
Date: Sun, 08 Apr 2018 16:06:25 +0300
Message-Id: <83muydzw32.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Boruch Baum <boruch_baum@HIDDEN>
In-reply-to: <20180408110901.4dukaueroieovrkp@HIDDEN> (message
 from Boruch Baum on Sun, 8 Apr 2018 07:09:01 -0400)
Subject: Re: bug#31094: Code for second solution
References: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
 <20180408110901.4dukaueroieovrkp@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 31094
Cc: 31094 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.0 (------)

> Date: Sun, 8 Apr 2018 07:09:01 -0400
> From: Boruch Baum <boruch_baum@HIDDEN>
> 
> Attached is code for the second solution idea that I mrentioned in my
> first post. Note that these approaches are complementary and
> independent; I would advocate for both being adopted.
> 
> Do note that this 'breaks' a feature formerly available. Prior, pressing
> return on an entry would display documentation for that entry; Now one
> must press `C-h v' / `C-h f' etc.

Why not do this the other way around: make apropos-value present a
shorter list when invoked with some special value of the prefix
argument?  Or even make this a new command?  That way, people's muscle
memory doesn't need to change, which I think is a Good Thing, given
that I think we never had any complaints about the current behavior.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at 31094 <at> debbugs.gnu.org:


Received: (at 31094) by debbugs.gnu.org; 8 Apr 2018 11:09:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 07:09:12 2018
Received: from localhost ([127.0.0.1]:41941 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f58C8-00057S-Hk
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 07:09:12 -0400
Received: from mout.gmx.net ([212.227.17.20]:60071)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1f58C7-00057F-2k
 for 31094 <at> debbugs.gnu.org; Sun, 08 Apr 2018 07:09:11 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
 (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id
 0M1RHp-1eBe8133mr-00tU6l for <31094 <at> debbugs.gnu.org>; Sun, 08 Apr 2018
 13:09:05 +0200
Date: Sun, 8 Apr 2018 07:09:01 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: 31094 <at> debbugs.gnu.org
Subject: Code for second solution
Message-ID: <20180408110901.4dukaueroieovrkp@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="v2vwy2qwgalrblb4"
Content-Disposition: inline
User-Agent: NeoMutt/20180223
X-Provags-ID: V03:K1:Kzwcp2MUEofV3hMwQWC7spzRt8YVTxqJWqlHLwI33yqOPCLfEge
 CXS/TiALmVrbODhaT8I+tPAWZBPecDCNayshHs8b31Q81jnAtK4xuNQGdiJbd2og/m2oKt6
 Vba3NOhTx2HY0tSJQSVyrgvJjDPelnkYie3ChmCtqfnHFDaZEBXytOpw7KGb+EUdvTtXkmq
 AheMqB1yjk90pVNXchUNw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:6E4e8F4LkWo=:sWDkEBVUQ5wNbR0403fm7J
 a4EWXFPGBBY31uB9pDV1xYEGjaIkwkGOUpKG8WS2eyNGso43X3FNpWr5zBu5knZALKXignZX+
 9s1B7gqlFJZTCVAquSgPWORWd8OSz5ovoO/8YrGpjt04ghYHErvIsFJ0dXOufvjzuM+oDnd8R
 NWjj3w2/wIqC+LX9Azd7LdW/jHeeMhCKIbdBjdnudN5sYm+L8CvzCkuFoczSCRxxrP+zBt3Dc
 xiqQ8rEu/9C5bAscsu5+RA7AXzjA1sqbuaPjgNcgbZ3RNKT2oYxFfRQBFPAPqxvakcxxt1j9m
 2lxxQeuzwRz0ZiXNOHyPXlQxlaIiYKV9UfggqG6uEk58kUDDgofDidjH/ccEXkxH74K1o1ttZ
 REwlqJhBM3ouY0o9vsug/tPv7qz900aNTozG9H98ufNSiMXDXbDM9O6ZQpath9gM78RRCtTOD
 x/a5Myw/hCvMFraQPUvJ6REtOSiVZY3fxvbHX5QHXylKdaqxBxIZDKCkdMdZSKLGuEMPuYBBM
 nK8ZXIo8dV3YjfeU80aZ6VQYTbBiwaUnPZGBIrxZ61538gxbNOszWsGfoAKK1fh4XRRYeiD0s
 9pZ62Flb8ohZxJKfnHzlM70rX+qJ2nPa3mWtMcndrV3dNzAxGzb5D9GFvJoQ51XQbUhFO8Qki
 jgSnvMDMOzI1ZDhYhNeafkWHQp0rgUw92H90ZQzqy2nixHImbfyXTQUQEJy+HtU3flpvO0hLz
 JlP4Y5bj4TbH04WMUeMS4+Ae99lT6JU4imhO+fDs42sVN7mol5dSn2mvASHjBVDfr3ncN6lCi
 E/zWkLSc1IQ88SfYW8WdGQpQvr1rQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 31094
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)


--v2vwy2qwgalrblb4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Attached is code for the second solution idea that I mrentioned in my
first post. Note that these approaches are complementary and
independent; I would advocate for both being adopted.

Do note that this 'breaks' a feature formerly available. Prior, pressing
return on an entry would display documentation for that entry; Now one
must press `C-h v' / `C-h f' etc.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

--v2vwy2qwgalrblb4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="apropos-print.el"

(defcustom apropos-value-limited-print nil
"Print only symbol names, not their contents.

When this option is active, one may always view a symbol's
contents by `C-h v' while point is on the symbol's name."
  :type 'boolean)


(defun apropos-print (do-keys spacing &optional text nosubst)
  "Output result of apropos searching into buffer `*Apropos*'.
The value of `apropos-accumulator' is the list of items to output.
Each element should have the format
 (SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]).
The return value is the list that was in `apropos-accumulator', sorted
alphabetically by symbol name; but this function also sets
`apropos-accumulator' to nil before returning.
If DO-KEYS is non-nil, output the key bindings.  If NOSUBST is
nil, substitute \"ASCII quotes\" (i.e., grace accent and
apostrophe) with curly quotes), and if non-nil, leave them alone.
If SPACING is non-nil, it should be a string; separate items with
that string.  If non-nil, TEXT is a string that will be printed
as a heading."
  (if (null apropos-accumulator)
      (message "No apropos matches for `%s'" apropos-pattern)
    (setq apropos-accumulator
	  (sort apropos-accumulator
		(lambda (a b)
		  (if apropos-sort-by-scores
		      (or (> (cadr a) (cadr b))
			  (and (= (cadr a) (cadr b))
			       (string-lessp (car a) (car b))))
		    (string-lessp (car a) (car b))))))
    (with-output-to-temp-buffer "*Apropos*"
      (let ((p apropos-accumulator)
	    (old-buffer (current-buffer))
	    (inhibit-read-only t)
	    (button-end 0)
	    symbol item)
	(set-buffer standard-output)
	(apropos-mode)
	(if text (insert text "\n\n"))
	(dolist (apropos-item p)
	  (when (and (not apropos-value-limited-print) spacing (not (bobp)))
	    (princ spacing))
	  (setq symbol (car apropos-item))
	  ;; Insert dummy score element for backwards compatibility with 21.x
	  ;; apropos-item format.
	  (if (not (numberp (cadr apropos-item)))
	      (setq apropos-item
		    (cons (car apropos-item)
			  (cons nil (cdr apropos-item)))))
	  (when (= (point) button-end) (terpri))
	  (insert-text-button (symbol-name symbol)
			      'type 'apropos-symbol
			      'skip apropos-multi-type
			      'face 'apropos-symbol)
	  (setq button-end (point))
	  (if (and (eq apropos-sort-by-scores 'verbose)
		   (cadr apropos-item))
	      (insert " (" (number-to-string (cadr apropos-item)) ") "))
	  ;; Calculate key-bindings if we want them.
          (unless apropos-compact-layout
            (and do-keys
                 (commandp symbol)
                 (not (eq symbol 'self-insert-command))
                 (indent-to 30 1)
                 (if (let ((keys
                            (with-current-buffer old-buffer
                              (where-is-internal symbol)))
                           filtered)
                       ;; Copy over the list of key sequences,
                       ;; omitting any that contain a buffer or a frame.
                       ;; FIXME: Why omit keys that contain buffers and
                       ;; frames?  This looks like a bad workaround rather
                       ;; than a proper fix.  Does anybody know what problem
                       ;; this is trying to address?  --Stef
                       (dolist (key keys)
                         (let ((i 0)
                               loser)
                           (while (< i (length key))
                             (if (or (framep (aref key i))
                                     (bufferp (aref key i)))
                                 (setq loser t))
                             (setq i (1+ i)))
                           (or loser
                               (push key filtered))))
                       (setq item filtered))
                     ;; Convert the remaining keys to a string and insert.
                     (insert
                      (mapconcat
                       (lambda (key)
                         (setq key (condition-case ()
                                       (key-description key)
                                     (error)))
			 (put-text-property 0 (length key)
					    'face 'apropos-keybinding
					    key)
                         key)
                       item ", "))
                   (insert "M-x ... RET")
		   (put-text-property (- (point) 11) (- (point) 8)
				      'face 'apropos-keybinding)
		   (put-text-property (- (point) 3) (point)
				      'face 'apropos-keybinding)))
            (terpri))
          (when (not apropos-value-limited-print)
	    (apropos-print-doc 2
	          	     (if (commandp symbol)
	          		 'apropos-command
	          	       (if (macrop symbol)
	          		   'apropos-macro
	          		 'apropos-function))
	          	     (not nosubst))
	    (apropos-print-doc 3
	          	     (if (custom-variable-p symbol)
	          		 'apropos-user-option
	          	       'apropos-variable)
	          	     (not nosubst))
	    (apropos-print-doc 7 'apropos-group t)
	    (apropos-print-doc 6 'apropos-face t)
	    (apropos-print-doc 5 'apropos-widget t)
	    (apropos-print-doc 4 'apropos-plist nil)))
        (set (make-local-variable 'truncate-partial-width-windows) t)
        (set (make-local-variable 'truncate-lines) t))))
  (prog1 apropos-accumulator
    (setq apropos-accumulator ())))	; permit gc

--v2vwy2qwgalrblb4--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 8 Apr 2018 07:39:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 08 03:39:38 2018
Received: from localhost ([127.0.0.1]:41853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1f54vH-0000K8-QZ
	for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 03:39:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56273)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <boruch_baum@HIDDEN>) id 1f54vG-0000Jt-0F
 for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 03:39:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <boruch_baum@HIDDEN>) id 1f54v8-0004z1-Jn
 for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 03:39:27 -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.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:50818)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <boruch_baum@HIDDEN>) id 1f54v8-0004yu-Gy
 for submit <at> debbugs.gnu.org; Sun, 08 Apr 2018 03:39:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47208)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <boruch_baum@HIDDEN>) id 1f54v7-0006uT-5w
 for bug-gnu-emacs@HIDDEN; Sun, 08 Apr 2018 03:39:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <boruch_baum@HIDDEN>) id 1f54v3-0004xf-6V
 for bug-gnu-emacs@HIDDEN; Sun, 08 Apr 2018 03:39:25 -0400
Received: from mout.gmx.net ([212.227.15.18]:44843)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <boruch_baum@HIDDEN>) id 1f54v2-0004xC-RN
 for bug-gnu-emacs@HIDDEN; Sun, 08 Apr 2018 03:39:21 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
 (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id
 0Lcj9b-1efwdE0BlP-00kCAk for <bug-gnu-emacs@HIDDEN>; Sun, 08 Apr 2018
 09:39:19 +0200
Date: Sun, 8 Apr 2018 03:39:16 -0400
From: Boruch Baum <boruch_baum@HIDDEN>
To: Emacs Bug Reporting <bug-gnu-emacs@HIDDEN>
Subject: 25.2: Feature Reuqest: apropos-value: limit scope [CODE INCLUDED]
Message-ID: <20180408073916.d5lsceul3gpj34l3@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="lyagqavzr2krievf"
Content-Disposition: inline
User-Agent: NeoMutt/20180223
X-Provags-ID: V03:K1:4e1nrLnH0gPmfQrY8Ycn6F4YREUsWqVxRqT8yR5u4EE9zGTivZ+
 jv704AKa3KngdcDWNbvB9UnN2VV8EWUd/xKsDxLQdzztoDc3UW7IUS4KMAGxj2fp/mJSex8
 wABEpW1zF1YF2ztng+69DSIpzyWtphqOQ1vQGy9NBkigXot0WXHU4PTM0J4YTerMqjfQmP1
 +Mf7WNJU+hRjOt1q/9iXg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:QUrfzgnGZM8=:reM2cAQLfEJ/OAswBf78W4
 fx7XpBRiHfNLLn5i2eJx5RMh/0F4MOETaBD6tAwXC7OfVS1AvNNk+/VRYH8l8BmvpFySv2OJ+
 3tmQWIfpYbJ2VL1hv/rov0x+Y0euFb9ZAPEr2BEfrMdSVdhlwcR2UPuLyZSXcqx6YXzFaufvm
 Ir1fpQWKLja39hqmWliPq95hwxxGe8uiE0P62k/J11LYH+nuInDRORVMk2h4DRumEEU7MljIa
 Bh3ZP7fYgfeLedM/kyUacTfsqZ1Ak2pFJKYSEnwqcohWbDW23+lQYyymCThifGBsgw8JuNqSv
 CJbUXQM9xB8LQ2VXM/8Oy5Q/sC9aODdUT9pkw4HvDpF5pjmL8+QUCz7JwGhaWR8DGQUR7AS7y
 uqkE7lKtKTJo4SgqL7RZ0xgat/ZIbIDwk9tImOCdggyIHWIgj/p7kwyA9eXsivR0fZsIF8Uew
 o9BurCKNR5qEc1ku7k/yCfNHPk9PvPExjkUuasYPCNGDy39/wb5AYaj1fjXlh0Xke1C/9tR4h
 9rN/LtxOov9rqbrnPdTtMWInzHWDVaAWaoROoNZf1A3RuJZXliiUYfjmms14Tj7K8QTF6tzU0
 6RliyU/cD614SnSVbUMOi/+oLvkqvMM7h3lBblV0oZd3bpBqGTZ6HZvhnzjXorc36O49E/7H5
 VAoQEZFDQK9kCNpdj8WuMpYJx49JsfJAdG9yueXS7dvImbpwidLitPexw6e1VmDRLc8MQeAk2
 cqULtKFfFfsKlsI+jOvVIQHG7RFgVBF6+Uv1M/fkAFB66JHhhoR88IgmFM5z3tbn2MZBrOOth
 LHUm4ZH56U3cpIK9kjgycK2l3VdOg==
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: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.1 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.1 (-----)


--lyagqavzr2krievf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I've begun using function apropos-value, and find that its ouput is
undesirably huge, because the feature prints out the entire value of
each variable that contains a match.

Some of this can be reduced when considegring that in most cases, I know
in advance that a value will be present in some very commonly used huge
variables, that won't be of use to me (eg. kill-ring,
minibuffer-history).f

A better solution would be an option to initially print only the names
of symbol that contain a match. The user can then easily view any value
of interest, because the output buffer already includes a feature that
pressing return on any symbol in the output list will display the
documentation for the symbol, which will include the variable's value.

Attached was my first thought at a solution, using an exclude list to
exclude certain variables from a search. As I said, upon further
consideration, I decided it would be better to abbreviate the output
buffer to just a list of symbol names, but I came to that conclusion
after writing the snippet.

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0

--lyagqavzr2krievf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="apropos-value.el"

(defcustom apropos-value-exclude-list
  '(kill-ring values minibuffer-history buffer-name-history
     command-history ivy--all-candidates)
"List of variable names to be excluded from `apropos-value' searches."
  :type '(repeat variable))


(defun my-apropos-value (pattern &optional do-all)
  "Allow `apropos-value' to limit scope of its searches.

With \\[universal-argument] prefix, or if `apropos-do-all' is
non-nil, also looks at function definitions (arguments,
documentation and body) and at the names and values of
properties.

With two \\[universal-argument] prefixes, excludes the variables
listed in `apropos-value-exclude-list' from its search.

With three \\[universal-argument] prefixes, performs a search
only on the variables listed in `apropos-value-exclude-list'.

See also variable `apropos-value-limited-print'."
  (interactive (list (apropos-read-pattern "value")
		     current-prefix-arg))
  (apropos-parse-pattern pattern)
  (or do-all (when apropos-do-all (setq do-all '(4))))
  (setq apropos-accumulator ())
  (let (f v p)
    (if (equal do-all '(64)) ; C-u C-u C-u
      (dolist (symbol apropos-value-exclude-list)
        (when (setq v (apropos-value-internal 'boundp symbol 'symbol-value))
          (setq apropos-accumulator
            (cons (list symbol (apropos-score-str v) nil v nil) apropos-accumulator))))
     (mapatoms (lambda (symbol)
       (setq f nil v nil p nil)
       (or (memq symbol '(apropos-regexp
       		   apropos-pattern apropos-all-words-regexp
       		   apropos-words apropos-all-words
       		   do-all apropos-accumulator apropos-value-exclude-list
       		   symbol f v p))
           (and (equal do-all '(16)) ; C-u C-u
                (memq symbol apropos-value-exclude-list))
           (setq v (apropos-value-internal 'boundp symbol 'symbol-value)))
       (when (equal do-all '(4)) ; C-u
         (setq f (apropos-value-internal 'fboundp symbol 'symbol-function)
               p (apropos-format-plist symbol "\n    " t)))
       (if (apropos-false-hit-str v)
           (setq v nil))
       (if (apropos-false-hit-str f)
           (setq f nil))
       (if (apropos-false-hit-str p)
           (setq p nil))
       (if (or f v p)
           (setq apropos-accumulator (cons (list symbol
       					  (+ (apropos-score-str f)
       					     (apropos-score-str v)
       					     (apropos-score-str p))
       					  f v p)
       				    apropos-accumulator)))))))
  (let ((apropos-multi-type (if (equal do-all '(4)) t nil)))
    (apropos-print nil "\n----------------\n")))

--lyagqavzr2krievf--




Acknowledgement sent to Boruch Baum <boruch_baum@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#31094; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.