GNU bug report logs - #78593
31.0.50; describe-key broken on interactive lambdas

Previous Next

Package: emacs;

Reported by: Madhu <enometh <at> meer.net>

Date: Mon, 26 May 2025 15:48:01 UTC

Severity: normal

Found in version 31.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 78593 in the body.
You can then email your comments to 78593 AT debbugs.gnu.org in the normal way.

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#78593; Package emacs. (Mon, 26 May 2025 15:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Madhu <enometh <at> meer.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 26 May 2025 15:48:02 GMT) Full text and rfc822 format available.

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

From: Madhu <enometh <at> meer.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; describe-key broken on interactive lambdas
Date: Mon, 26 May 2025 21:16:22 +0530 (IST)
On recent master, but this seems to have been broken for a while:

$ emacs -Q -eval '(define-key global-map (kbd "<f11>") (lambda () (interactive) (bury-buffer)))'

C-h v <f11>

throws an error:

function-get: Wrong type argument: symbolp, #[nil ((bury-buffer)) (t) nil nil nil]

Acktually the *Help* buffer is formatted with sufficient information,
but the error prevents it from being displayed.

-- Madhu




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Mon, 26 May 2025 16:47:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Madhu <enometh <at> meer.net>, Stefan Kangas <stefankangas <at> gmail.com>
Cc: 78593 <at> debbugs.gnu.org
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Mon, 26 May 2025 19:46:21 +0300
> Date: Mon, 26 May 2025 21:16:22 +0530 (IST)
> From: Madhu <enometh <at> meer.net>
> 
> On recent master, but this seems to have been broken for a while:
> 
> $ emacs -Q -eval '(define-key global-map (kbd "<f11>") (lambda () (interactive) (bury-buffer)))'
> 
> C-h v <f11>
> 
> throws an error:
> 
> function-get: Wrong type argument: symbolp, #[nil ((bury-buffer)) (t) nil nil nil]
> 
> Acktually the *Help* buffer is formatted with sufficient information,
> but the error prevents it from being displayed.

Thanks.

Stefan, this is due to your change:

  commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
  Author:     Stefan Kangas <stefankangas <at> gmail.com>
  AuthorDate: Tue Apr 1 21:25:33 2025 +0200
  Commit:     Stefan Kangas <stefankangas <at> gmail.com>
  CommitDate: Tue Apr 1 21:25:33 2025 +0200

      function-put: signal error with non-symbol

      * lisp/subr.el (function-get): Signal an error if given a non-symbol
      for consistency with 'get'.
      * test/lisp/subr-tests.el (subr-butlast): Test for the above.

Any reasons not to revert that?  function-get correctly returns nil if
its argument is not a symbol, so why should this signal an error?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 07 Jun 2025 08:41:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefankangas <at> gmail.com
Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 07 Jun 2025 11:40:32 +0300
Ping!  Stefan, please chime in.

> Cc: 78593 <at> debbugs.gnu.org
> Date: Mon, 26 May 2025 19:46:21 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Mon, 26 May 2025 21:16:22 +0530 (IST)
> > From: Madhu <enometh <at> meer.net>
> > 
> > On recent master, but this seems to have been broken for a while:
> > 
> > $ emacs -Q -eval '(define-key global-map (kbd "<f11>") (lambda () (interactive) (bury-buffer)))'
> > 
> > C-h v <f11>
> > 
> > throws an error:
> > 
> > function-get: Wrong type argument: symbolp, #[nil ((bury-buffer)) (t) nil nil nil]
> > 
> > Acktually the *Help* buffer is formatted with sufficient information,
> > but the error prevents it from being displayed.
> 
> Thanks.
> 
> Stefan, this is due to your change:
> 
>   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
>   Author:     Stefan Kangas <stefankangas <at> gmail.com>
>   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
>   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
>   CommitDate: Tue Apr 1 21:25:33 2025 +0200
> 
>       function-put: signal error with non-symbol
> 
>       * lisp/subr.el (function-get): Signal an error if given a non-symbol
>       for consistency with 'get'.
>       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
> 
> Any reasons not to revert that?  function-get correctly returns nil if
> its argument is not a symbol, so why should this signal an error?
> 
> 
> 
> 




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 28 Jun 2025 09:07:01 GMT) Full text and rfc822 format available.

Notification sent to Madhu <enometh <at> meer.net>:
bug acknowledged by developer. (Sat, 28 Jun 2025 09:07:02 GMT) Full text and rfc822 format available.

Message #16 received at 78593-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: stefankangas <at> gmail.com
Cc: enometh <at> meer.net, 78593-done <at> debbugs.gnu.org
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 12:06:00 +0300
> Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net
> Date: Sat, 07 Jun 2025 11:40:32 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Ping!  Stefan, please chime in.
> 
> > Cc: 78593 <at> debbugs.gnu.org
> > Date: Mon, 26 May 2025 19:46:21 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > > Date: Mon, 26 May 2025 21:16:22 +0530 (IST)
> > > From: Madhu <enometh <at> meer.net>
> > > 
> > > On recent master, but this seems to have been broken for a while:
> > > 
> > > $ emacs -Q -eval '(define-key global-map (kbd "<f11>") (lambda () (interactive) (bury-buffer)))'
> > > 
> > > C-h v <f11>
> > > 
> > > throws an error:
> > > 
> > > function-get: Wrong type argument: symbolp, #[nil ((bury-buffer)) (t) nil nil nil]
> > > 
> > > Acktually the *Help* buffer is formatted with sufficient information,
> > > but the error prevents it from being displayed.
> > 
> > Thanks.
> > 
> > Stefan, this is due to your change:
> > 
> >   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
> >   Author:     Stefan Kangas <stefankangas <at> gmail.com>
> >   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
> >   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
> >   CommitDate: Tue Apr 1 21:25:33 2025 +0200
> > 
> >       function-put: signal error with non-symbol
> > 
> >       * lisp/subr.el (function-get): Signal an error if given a non-symbol
> >       for consistency with 'get'.
> >       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
> > 
> > Any reasons not to revert that?  function-get correctly returns nil if
> > its argument is not a symbol, so why should this signal an error?

No further comments, so I've now reverted the offending commit, and
I'm closing this bug.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 16:01:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78593 <at> debbugs.gnu.org, Madhu <enometh <at> meer.net>,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 12:00:01 -0400
> Stefan, this is due to your change:
>
>   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
>   Author:     Stefan Kangas <stefankangas <at> gmail.com>
>   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
>   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
>   CommitDate: Tue Apr 1 21:25:33 2025 +0200
>
>       function-put: signal error with non-symbol
>
>       * lisp/subr.el (function-get): Signal an error if given a non-symbol
>       for consistency with 'get'.
>       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
>
> Any reasons not to revert that?  function-get correctly returns nil if
> its argument is not a symbol, so why should this signal an error?

IMO, `function-get/put` should accept *functions* as arguments, not
just symbols.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 19:09:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net, stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 22:08:15 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: Madhu <enometh <at> meer.net>,  Stefan Kangas <stefankangas <at> gmail.com>,
>   78593 <at> debbugs.gnu.org
> Date: Sat, 28 Jun 2025 12:00:01 -0400
> 
> > Stefan, this is due to your change:
> >
> >   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
> >   Author:     Stefan Kangas <stefankangas <at> gmail.com>
> >   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
> >   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
> >   CommitDate: Tue Apr 1 21:25:33 2025 +0200
> >
> >       function-put: signal error with non-symbol
> >
> >       * lisp/subr.el (function-get): Signal an error if given a non-symbol
> >       for consistency with 'get'.
> >       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
> >
> > Any reasons not to revert that?  function-get correctly returns nil if
> > its argument is not a symbol, so why should this signal an error?
> 
> IMO, `function-get/put` should accept *functions* as arguments, not
> just symbols.

Not sure I understand: are you saying that it was wrong for me to
revert that commit?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 21:21:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net, stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 17:20:33 -0400
>> > Stefan, this is due to your change:
>> >
>> >   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
>> >   Author:     Stefan Kangas <stefankangas <at> gmail.com>
>> >   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
>> >   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
>> >   CommitDate: Tue Apr 1 21:25:33 2025 +0200
>> >
>> >       function-put: signal error with non-symbol
>> >
>> >       * lisp/subr.el (function-get): Signal an error if given a non-symbol
>> >       for consistency with 'get'.
>> >       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
>> >
>> > Any reasons not to revert that?  function-get correctly returns nil if
>> > its argument is not a symbol, so why should this signal an error?
>> 
>> IMO, `function-get/put` should accept *functions* as arguments, not
>> just symbols.
>
> Not sure I understand: are you saying that it was wrong for me to
> revert that commit?

No, but just pointing out that signaling errors for functions which are
not symbols was the core of the problem.  It's probably OK to signal
errors for values which are not functions at all.  Not sure if it's
worth the trouble, OTOH.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 22:28:03 GMT) Full text and rfc822 format available.

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

From: Pip Cet <pipcet <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>, 78593 <at> debbugs.gnu.org,
 enometh <at> meer.net, stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 22:27:46 +0000
"Stefan Monnier via \"Bug reports for GNU Emacs, the Swiss army knife of text editors\"" <bug-gnu-emacs <at> gnu.org> writes:

>>> > Stefan, this is due to your change:
>>> >
>>> >   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
>>> >   Author:     Stefan Kangas <stefankangas <at> gmail.com>
>>> >   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
>>> >   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
>>> >   CommitDate: Tue Apr 1 21:25:33 2025 +0200
>>> >
>>> >       function-put: signal error with non-symbol
>>> >
>>> >       * lisp/subr.el (function-get): Signal an error if given a non-symbol
>>> >       for consistency with 'get'.
>>> >       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
>>> >
>>> > Any reasons not to revert that?  function-get correctly returns nil if
>>> > its argument is not a symbol, so why should this signal an error?
>>>
>>> IMO, `function-get/put` should accept *functions* as arguments, not
>>> just symbols.

I'm a bit confused about function-put: are you saying that all functions
should have a plist (in a weak hash table?) that function-put
manipulates, or that we should silently ignore attempts to set a
function property on a non-symbol?

Pip





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 22:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sat, 28 Jun 2025 23:11:02 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Pip Cet <pipcet <at> protonmail.com>
Cc: 78593 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, enometh <at> meer.net,
 stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sat, 28 Jun 2025 19:10:18 -0400
>>>> IMO, `function-get/put` should accept *functions* as arguments, not
>>>> just symbols.
> I'm a bit confused about function-put: are you saying that all functions
> should have a plist (in a weak hash table?) that function-put
> manipulates,

Well, how to make it work for non-symbol functions is up in the air.
But I'm just saying that we shouldn't *necessarily* disallow it (as
long as we can make it work).
The weak hash-table is what we do for `set-advertised-calling-convention`.

> or that we should silently ignore attempts to set a function property
> on a non-symbol?

I don't have a clear opinion on that.


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sun, 29 Jun 2025 04:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net, stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sun, 29 Jun 2025 07:55:27 +0300
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: enometh <at> meer.net,  stefankangas <at> gmail.com,  78593 <at> debbugs.gnu.org
> Date: Sat, 28 Jun 2025 17:20:33 -0400
> 
> >> > Stefan, this is due to your change:
> >> >
> >> >   commit a4ec9ca12969018cdf15b8cc713b3ba054326f99
> >> >   Author:     Stefan Kangas <stefankangas <at> gmail.com>
> >> >   AuthorDate: Tue Apr 1 21:25:33 2025 +0200
> >> >   Commit:     Stefan Kangas <stefankangas <at> gmail.com>
> >> >   CommitDate: Tue Apr 1 21:25:33 2025 +0200
> >> >
> >> >       function-put: signal error with non-symbol
> >> >
> >> >       * lisp/subr.el (function-get): Signal an error if given a non-symbol
> >> >       for consistency with 'get'.
> >> >       * test/lisp/subr-tests.el (subr-butlast): Test for the above.
> >> >
> >> > Any reasons not to revert that?  function-get correctly returns nil if
> >> > its argument is not a symbol, so why should this signal an error?
> >> 
> >> IMO, `function-get/put` should accept *functions* as arguments, not
> >> just symbols.
> >
> > Not sure I understand: are you saying that it was wrong for me to
> > revert that commit?
> 
> No, but just pointing out that signaling errors for functions which are
> not symbols was the core of the problem.

I agree.

> It's probably OK to signal errors for values which are not functions
> at all.  Not sure if it's worth the trouble, OTOH.

Ah, so you are saying that symbolp should have been functionp?  But
does functionp indeed return non-nil for all the function types for
which we want function-get to do its job?  E.g., what about macros of
special forms?

Or do we have another predicate that would cover all the cases?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78593; Package emacs. (Sun, 29 Jun 2025 05:02:04 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78593 <at> debbugs.gnu.org, enometh <at> meer.net, stefankangas <at> gmail.com
Subject: Re: bug#78593: 31.0.50; describe-key broken on interactive lambdas
Date: Sun, 29 Jun 2025 01:01:48 -0400
>> It's probably OK to signal errors for values which are not functions
>> at all.  Not sure if it's worth the trouble, OTOH.
> Ah, so you are saying that symbolp should have been functionp?  But
> does functionp indeed return non-nil for all the function types for
> which we want function-get to do its job?  E.g., what about macros of
> special forms?
> Or do we have another predicate that would cover all the cases?

That's what I meant by "Not sure if it's worth the trouble".


        Stefan





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 27 Jul 2025 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 13 days ago.

Previous Next


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