Subject: Re: bug#59248: 29.0.50; apropos lists keywords as if they were variables

From: Thibault Polge <[email-masked]>
Date: Sun, 13 Nov 2022 19:30:23 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Thibault Polge <[email-masked]>
>> 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.