unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49953: 28.0.50; tmm is broken on compiled menus
@ 2021-08-09  7:12 Juri Linkov
  2021-08-09 13:20 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Juri Linkov @ 2021-08-09  7:12 UTC (permalink / raw)
  To: 49953

0. emacs -Q
1. Eval: (tmm-prompt (mouse-buffer-menu-keymap))
2. Select a menu item with the mouse click
   from the *Completions* buffer
3. It fails with this backtrace:

Debugger entered--Lisp error: (error "Empty menu reached")
  error("Empty menu reached")
  tmm-prompt((keymap "Select Buffer" [("*scratch* * " . #f(compiled-function () (interactive nil) #<bytecode...
  tmm-prompt((keymap (Select\ Buffer "Select Buffer" keymap ...
  (progn (tmm-prompt (mouse-buffer-menu-keymap)))
  eval((progn (tmm-prompt (mouse-buffer-menu-keymap))) t)
  elisp--eval-last-sexp((4))
  eval-last-sexp((4))
  funcall-interactively(eval-last-sexp (4))
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

This regression began to occur after merging native-compilation.
It seems the problem is that tmm-get-keymap does very strange things:

	(cond ((if (listp elt)
		   (or (keymapp elt) (eq (car elt) 'lambda))
		 (and (symbolp elt) (fboundp elt)))

I don't know why it checks for 'lambda' and 'symbolp',
but such checks fail on a compiled function.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#49953: 28.0.50; tmm is broken on compiled menus
  2021-08-09  7:12 bug#49953: 28.0.50; tmm is broken on compiled menus Juri Linkov
@ 2021-08-09 13:20 ` Lars Ingebrigtsen
  2021-08-09 17:09   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-09 13:20 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 49953

Juri Linkov <juri@linkov.net> writes:

> This regression began to occur after merging native-compilation.
> It seems the problem is that tmm-get-keymap does very strange things:
>
> 	(cond ((if (listp elt)
> 		   (or (keymapp elt) (eq (car elt) 'lambda))
> 		 (and (symbolp elt) (fboundp elt)))
>
> I don't know why it checks for 'lambda' and 'symbolp',
> but such checks fail on a compiled function.

Yeah, or why the listp at all...  I think the correct test in all these
cases are (or (keymapp elt) (functionp elt))?  So I've now done that on
the trunk, and that seems to make things work.  But there may be
something subtle here, so I guess we'll see...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#49953: 28.0.50; tmm is broken on compiled menus
  2021-08-09 13:20 ` Lars Ingebrigtsen
@ 2021-08-09 17:09   ` Eli Zaretskii
  2021-08-09 18:23     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2021-08-09 17:09 UTC (permalink / raw)
  To: Lars Ingebrigtsen, Stefan Monnier; +Cc: 49953, juri

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Mon, 09 Aug 2021 15:20:58 +0200
> Cc: 49953@debbugs.gnu.org
> 
> Juri Linkov <juri@linkov.net> writes:
> 
> > This regression began to occur after merging native-compilation.
> > It seems the problem is that tmm-get-keymap does very strange things:
> >
> > 	(cond ((if (listp elt)
> > 		   (or (keymapp elt) (eq (car elt) 'lambda))
> > 		 (and (symbolp elt) (fboundp elt)))
> >
> > I don't know why it checks for 'lambda' and 'symbolp',
> > but such checks fail on a compiled function.
> 
> Yeah, or why the listp at all...  I think the correct test in all these
> cases are (or (keymapp elt) (functionp elt))?  So I've now done that on
> the trunk, and that seems to make things work.  But there may be
> something subtle here, so I guess we'll see...

I have a vague recollection that at least some of those are used, so I
brought Stefan on-board this discussion, in the hope that he could
show us the light.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#49953: 28.0.50; tmm is broken on compiled menus
  2021-08-09 17:09   ` Eli Zaretskii
@ 2021-08-09 18:23     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-08-09 18:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 49953, Lars Ingebrigtsen, juri

>> > This regression began to occur after merging native-compilation.
>> > It seems the problem is that tmm-get-keymap does very strange things:
>> >
>> > 	(cond ((if (listp elt)
>> > 		   (or (keymapp elt) (eq (car elt) 'lambda))
>> > 		 (and (symbolp elt) (fboundp elt)))
>> >
>> > I don't know why it checks for 'lambda' and 'symbolp',
>> > but such checks fail on a compiled function.
>> 
>> Yeah, or why the listp at all...  I think the correct test in all these
>> cases are (or (keymapp elt) (functionp elt))?  So I've now done that on
>> the trunk, and that seems to make things work.  But there may be
>> something subtle here, so I guess we'll see...
>
> I have a vague recollection that at least some of those are used, so I
> brought Stefan on-board this discussion, in the hope that he could
> show us the light.

Sorry, my lightbulb is currently out, but I agree that the above test
seems to want to do (or (keymapp elt) (functionp elt)) just in
a clumsy way.


        Stefan






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-09 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09  7:12 bug#49953: 28.0.50; tmm is broken on compiled menus Juri Linkov
2021-08-09 13:20 ` Lars Ingebrigtsen
2021-08-09 17:09   ` Eli Zaretskii
2021-08-09 18:23     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).