unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1
@ 2021-08-13 22:08 Hugh Daschbach
  2021-08-14 12:39 ` Lars Ingebrigtsen
  2021-08-14 16:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 4+ messages in thread
From: Hugh Daschbach @ 2021-08-13 22:08 UTC (permalink / raw)
  To: 50051

[-- Attachment #1: Type: text/plain, Size: 4430 bytes --]

Invoking a popup menu defined with easymenu results in the following
traceback:

,----
| Debugger entered--Lisp error: (wrong-type-argument listp #f(compiled-function (arg1) (interactive "@e") #<bytecode -0x1b0049559414da65>))
|   x-popup-menu((mouse-3 (#<window 14 on *popup-test*> 7 (58 . 11) 1801985654 nil 7 (6 . 0) nil (4 . 11) (9 . 18))) #f(compiled-function (arg1) (interactive "@e") #<bytecode -0x1b0049559414da65>))
|   popup-test-show-menu((mouse-3 (#<window 14 on *popup-test*> 7 (58 . 11) 1801985654 nil 7 (6 . 0) nil (4 . 11) (9 . 18))))
|   (let ((result (popup-test-show-menu event))) (popup-test-select (car result)))
|   popup-test-action((mouse-3 (#<window 14 on *popup-test*> 7 (58 . 11) 1801985654 nil 7 (6 . 0) nil (4 . 11) (9 . 18))))
|   funcall-interactively(popup-test-action (mouse-3 (#<window 14 on *popup-test*> 7 (58 . 11) 1801985654 nil 7 (6 . 0) nil (4 . 11) (9 . 18))))
|   call-interactively(popup-test-action nil nil)
|   command-execute(popup-test-action)
`----

To reproduce (popup-test.el attached):

emacs -q -Q -l popup-test.el

This opens a window with *popup-tests* buffer.  Right click on the text
"Right click here." to generate the wrong-type-argument error.

This test works with 26.3.  Bisecting the Emacs source tree reveals this
regression was introduced by the first hunk in
a070bd1c8b5213ad469d41dd80d392f924644aed.

Seems odd this has not been reported already.  But I could not find an
existing bug report for this.

Cheers,
Hugh


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars)
 of 2021-08-13 built on debian-11
Repository revision: c4d34d24e36c7f7c54cf3ec3e5d76e3e8fc005aa
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12012000
System Description: Debian GNU/Linux 11 (bullseye)

Configured using:
 'configure --with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XAW3D XDBE XIM XPM LUCID ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
popup-test iso-transl tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd
tool-bar dnd fontset image regexp-opt fringe tabulated-list replace
newcomment text-mode elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar
mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice button loaddefs faces
cus-face macroexp files window text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 51530 6812)
 (symbols 48 6620 1)
 (strings 32 18860 1414)
 (string-bytes 1 608630)
 (vectors 16 13422)
 (vector-slots 8 179251 7821)
 (floats 8 27 34)
 (intervals 56 327 0)
 (buffers 992 12))


[-- Attachment #2: Popup menu test. --]
[-- Type: text/plain, Size: 1711 bytes --]

;;; popup-test.el --- Test popup menu. -*- lexical-binding: t; -*-

(require 'easymenu)

(defvar popup-test-value 0)

(defun popup-test-select (value)
  (message "Selected %s" value)
  (setq popup-test-value value))

(defvar popup-test-menu
  '("popup-test"
    :active t
    "--single-line"
    [0
     (popup-test-select 0)
     :label "Zero"
     :style radio
     :selected (eql 0 popup-test-value)]
    [1
     (popup-test-select 1)
     :label "One"
     :style radio
     :selected (eql 1 popup-test-value)]
    [2
     (popup-test-select 2)
     :label "Two"
     :style radio
     :selected (eql 2 popup-test-value)]
    [3
     (popup-test-select 3)
     :label "Three"
     :style radio 
     :selected (eql 3 popup-test-value)]
    [4
     (popup-test-select 4)
     :label "Four"
     :style radio
     :selected (eql 4 popup-test-value)]))

(easy-menu-define popup-test-show-menu nil "Context sensitive menu" popup-test-menu)

(defun popup-test-action (event)
  (interactive "e")
  (let ((result (popup-test-show-menu event)))
    (popup-test-select (car result))))

(defface popup-test-face
  '((((background dark)) (:foreground "cyan" :background "DimGray"))
    (t (:foreground "DarkRed")))
  "*popup-test demonstration face")

(defvar popup-test-map (make-sparse-keymap))

(define-key popup-test-map [mouse-3] 'popup-test-action)

(let ((buffer (get-buffer-create "*popup-test*")))
  (with-current-buffer buffer
    (erase-buffer)
    (insert (propertize "Right click here."
                        'face 'popup-test-face
                        'keymap popup-test-map
                        'rear-nonsticky t))
    (pop-to-buffer buffer)))

(provide 'popup-test)
;;; popup-test.el ends here

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

* bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1
  2021-08-13 22:08 bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1 Hugh Daschbach
@ 2021-08-14 12:39 ` Lars Ingebrigtsen
  2021-08-14 16:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-14 12:39 UTC (permalink / raw)
  To: Hugh Daschbach; +Cc: 50051, monnier

Hugh Daschbach <hugh@ccss.com> writes:

> This opens a window with *popup-tests* buffer.  Right click on the text
> "Right click here." to generate the wrong-type-argument error.
>
> This test works with 26.3.  Bisecting the Emacs source tree reveals this
> regression was introduced by the first hunk in
> a070bd1c8b5213ad469d41dd80d392f924644aed.

Stefan, this was the patch that replaced some lambdas with closures in
easymenu.  I see that parts of that patch was reverted(ish), but not the
bit that's triggering this problem.

Here's the reverted thing:

diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 292d50b91a..15b8bef428 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -475,7 +475,7 @@ easy-menu-make-symbol
                   ;; `functionp' is probably not needed.
                   (functionp callback) noexp)
               callback
-	    (lambda () (interactive) callback)))
+	    (eval `(lambda () (interactive) ,callback) t)))
     command))
 
I briefly tried to debug the current problem, but it wasn't immediately
clear what the correct fix here would be...

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





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

* bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1
  2021-08-13 22:08 bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1 Hugh Daschbach
  2021-08-14 12:39 ` Lars Ingebrigtsen
@ 2021-08-14 16:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-08-14 16:29   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-08-14 16:24 UTC (permalink / raw)
  To: Hugh Daschbach; +Cc: 50051

> This test works with 26.3.  Bisecting the Emacs source tree reveals this
> regression was introduced by the first hunk in
> a070bd1c8b5213ad469d41dd80d392f924644aed.

Duh... not sure what I was smoking back then, but this commit was
quite odd.
I think I have fixed it, now,


        Stefan






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

* bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1
  2021-08-14 16:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-08-14 16:29   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-08-14 16:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Hugh Daschbach, 50051

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Duh... not sure what I was smoking back then, but this commit was
> quite odd.
> I think I have fixed it, now,

:-)

I can confirm that the bug is now gone.

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





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

end of thread, other threads:[~2021-08-14 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13 22:08 bug#50051: 28.0.50; easymenu defined popup menus broken since 27.1 Hugh Daschbach
2021-08-14 12:39 ` Lars Ingebrigtsen
2021-08-14 16:24 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-14 16:29   ` Lars Ingebrigtsen

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).