GNU bug report logs - #59248
29.0.50; apropos lists keywords as if they were variables

Previous Next

Package: emacs;

Reported by: Thibault Polge <thibault <at> thb.lt>

Date: Sun, 13 Nov 2022 16:57:02 UTC

Severity: minor

Found in version 29.0.50

To reply to this bug, email your comments to 59248 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#59248; Package emacs. (Sun, 13 Nov 2022 16:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thibault Polge <thibault <at> thb.lt>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 13 Nov 2022 16:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thibault Polge <thibault <at> thb.lt>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; apropos lists keywords as if they were variables
Date: Sun, 13 Nov 2022 17:56:09 +0100
On a very recent (about yesterday) Emacs from HEAD, apropos lists
interned keywords as undocumented variables.  Eg, the following
invocation:

M-x apropos RET distant-foreground RET

displays the following output:

> Type RET on a type label to view its full documentation.
>
> :distant-foreground
>  Variable: (not documented)
>  Value: :distant-foreground

This is technically correct --- keywords are variable-ish --- but quite
useless.  At best, keywords just add noise to `apropos` output.  At
worst, they may be misleading, since an user may assume they can somehow
control something by setq'ing a keyword.

Regards,
Thibault




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59248; Package emacs. (Sun, 13 Nov 2022 18:10:01 GMT) Full text and rfc822 format available.

Message #8 received at 59248 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thibault Polge <thibault <at> thb.lt>
Cc: 59248 <at> debbugs.gnu.org
Subject: Re: bug#59248: 29.0.50;
 apropos lists keywords as if they were variables
Date: Sun, 13 Nov 2022 20:09:43 +0200
> From: Thibault Polge <thibault <at> thb.lt>
> Date: Sun, 13 Nov 2022 17:56:09 +0100
> 
> On a very recent (about yesterday) Emacs from HEAD, apropos lists
> interned keywords as undocumented variables.  Eg, the following
> invocation:
> 
> M-x apropos RET distant-foreground RET
> 
> displays the following output:
> 
> > Type RET on a type label to view its full documentation.
> >
> > :distant-foreground
> >  Variable: (not documented)
> >  Value: :distant-foreground
> 
> This is technically correct --- keywords are variable-ish

"M-x apropos" is not just about variables.  It's about any symbol that
matches a regexp.

> but quite useless.  At best, keywords just add noise to `apropos`
> output.  At worst, they may be misleading, since an user may assume
> they can somehow control something by setq'ing a keyword.

How can Emacs know that the user didn't actually _want_ to look up a
keyword?  It is not impossible.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59248; Package emacs. (Sun, 13 Nov 2022 18:39:02 GMT) Full text and rfc822 format available.

Message #11 received at 59248 <at> debbugs.gnu.org (full text, mbox):

From: Thibault Polge <thibault <at> thb.lt>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 59248 <at> debbugs.gnu.org
Subject: Re: bug#59248: 29.0.50; apropos lists keywords as if they were
 variables
Date: Sun, 13 Nov 2022 19:30:23 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Thibault Polge <thibault <at> thb.lt>
>> Date: Sun, 13 Nov 2022 17:56:09 +0100
>>
>> On a very recent (about yesterday) Emacs from HEAD, apropos lists
>> interned keywords as undocumented variables.  Eg, the following
>> invocation:
>>
>> M-x apropos RET distant-foreground RET
>>
>> displays the following output:
>>
>> > Type RET on a type label to view its full documentation.
>> >
>> > :distant-foreground
>> >  Variable: (not documented)
>> >  Value: :distant-foreground
>>
>> This is technically correct --- keywords are variable-ish
>
> "M-x apropos" is not just about variables.  It's about any symbol that
> matches a regexp.

In this case, the docstring for `apropos` is incorrect.  It currently
reads:

"Show all meaningful Lisp symbols whose names match PATTERN.  Symbols
are shown if they are defined as functions, variables, or faces, or if
they have nonempty property lists."

The second sentence should include keywords.

The produced output is also incorrect: a symbol is not a "Variable: (not
documented)", and I'm not sure it makes sense to give its value, since
it's auto-evaluating.

>> but quite useless.  At best, keywords just add noise to `apropos`
>> output.  At worst, they may be misleading, since an user may assume
>> they can somehow control something by setq'ing a keyword.
>
> How can Emacs know that the user didn't actually _want_ to look up a
> keyword?  It is not impossible.

I'm not sure I can think of a reason to do that: all the user would learn is
that something, somewhere, interned that keyword.  But maybe there are use
cases that escape me.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59248; Package emacs. (Sun, 13 Nov 2022 18:51:01 GMT) Full text and rfc822 format available.

Message #14 received at 59248 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thibault Polge <thibault <at> thb.lt>
Cc: 59248 <at> debbugs.gnu.org
Subject: Re: bug#59248: 29.0.50; apropos lists keywords as if they were
 variables
Date: Sun, 13 Nov 2022 20:34:02 +0200
> From: Thibault Polge <thibault <at> thb.lt>
> Cc: 59248 <at> debbugs.gnu.org
> Date: Sun, 13 Nov 2022 19:30:23 +0100
> 
> > "M-x apropos" is not just about variables.  It's about any symbol that
> > matches a regexp.
> 
> In this case, the docstring for `apropos` is incorrect.

I will see about fixing that, thanks.

> > How can Emacs know that the user didn't actually _want_ to look up a
> > keyword?  It is not impossible.
> 
> I'm not sure I can think of a reason to do that: all the user would learn is
> that something, somewhere, interned that keyword.  But maybe there are use
> cases that escape me.

Apropos is also (if not mainly) for when you don't remember the exact
name of something.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#59248; Package emacs. (Mon, 14 Nov 2022 08:06:02 GMT) Full text and rfc822 format available.

Message #17 received at 59248 <at> debbugs.gnu.org (full text, mbox):

From: Akib Azmain Turja <akib <at> disroot.org>
To: Thibault Polge <thibault <at> thb.lt>
Cc: 59248 <at> debbugs.gnu.org
Subject: Re: bug#59248: 29.0.50; apropos lists keywords as if they were
 variables
Date: Mon, 14 Nov 2022 11:21:56 +0600
[Message part 1 (text/plain, inline)]
Thibault Polge <thibault <at> thb.lt> writes:

> On a very recent (about yesterday) Emacs from HEAD, apropos lists
> interned keywords as undocumented variables.  Eg, the following
> invocation:

This happens to me with a Emacs build from more than two months old
commit.

>
> M-x apropos RET distant-foreground RET
>
> displays the following output:
>
>> Type RET on a type label to view its full documentation.
>>
>> :distant-foreground
>>  Variable: (not documented)
>>  Value: :distant-foreground
>
> This is technically correct --- keywords are variable-ish --- but quite
> useless.  At best, keywords just add noise to `apropos` output.  At
> worst, they may be misleading, since an user may assume they can somehow
> control something by setq'ing a keyword.
>
> Regards,
> Thibault
>
>
>

These symbol (nil, t, keywords) are self-evaluating.  Their value is the
symbol itself.  For example, do the following:

M-x apropos RET ^nil$ RET
M-x apropos RET ^t$ RET

However they are constants, the values can't be changed.

I suggest to remove the "Variable" and "Value" and add something like
"Self-evaluating: yes" and "Constant: yes".

-- 
Akib Azmain Turja, GPG key: 70018CE5819F17A3BBA666AFE74F0EFA922AE7F5
Fediverse: akib <at> hostux.social
Codeberg: akib
emailselfdefense.fsf.org | "Nothing can be secure without encryption."
[signature.asc (application/pgp-signature, inline)]

Severity set to 'minor' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 24 Nov 2022 18:38:03 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 203 days ago.

Previous Next


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