GNU bug report logs - #4471
menu-bar menu is undefined

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Thu, 17 Sep 2009 21:30:06 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 4471 in the body.
You can then email your comments to 4471 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4471; Package emacs. (Thu, 17 Sep 2009 21:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> jurta.org>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 17 Sep 2009 21:30:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: bug-gnu-emacs <at> gnu.org
Subject: menu-bar menu is undefined
Date: Fri, 18 Sep 2009 00:19:47 +0300
Some menu-bar's menus fail to open in non-toolkit X builds.

For instance, when I click on the "Buffer-Menu" menu-bar's item,
it signals the error:

  <menu-bar> <Buffer-menu-mode> <nil> is undefined

However, with the following patch it displays the menu correctly:

Index: lisp/buff-menu.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/buff-menu.el,v
retrieving revision 1.125
diff -u -r1.125 buff-menu.el
--- lisp/buff-menu.el	15 Jan 2009 16:46:09 -0000	1.125
+++ lisp/buff-menu.el	17 Sep 2009 21:15:37 -0000
@@ -119,7 +119,7 @@
 
 (defvar Buffer-menu-mode-map
   (let ((map (make-keymap))
-	(menu-map (make-sparse-keymap)))
+	(menu-map (make-sparse-keymap "Buffer-Menu")))
     (suppress-keymap map t)
     (define-key map "v" 'Buffer-menu-select)
     (define-key map "2" 'Buffer-menu-2-window)

If this is the right way to define menus, I could do the same for other
menus as well, e.g.

Index: lisp/add-log.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/add-log.el,v
retrieving revision 1.230
diff -u -r1.230 add-log.el
--- lisp/add-log.el	1 Sep 2009 07:24:18 -0000	1.230
+++ lisp/add-log.el	17 Sep 2009 21:16:23 -0000
@@ -551,7 +551,7 @@
 
 (defvar change-log-mode-map
   (let ((map (make-sparse-keymap))
-	(menu-map (make-sparse-keymap)))
+	(menu-map (make-sparse-keymap "ChangeLog")))
     (define-key map [?\C-c ?\C-p] 'add-log-edit-prev-comment)
     (define-key map [?\C-c ?\C-n] 'add-log-edit-next-comment)
     (define-key map [?\C-c ?\C-f] 'change-log-find-file)

and some other menus that have no menu names.

-- 
Juri Linkov
http://www.jurta.org/emacs/




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4471; Package emacs. (Fri, 18 Sep 2009 03:10:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 18 Sep 2009 03:10:06 GMT) Full text and rfc822 format available.

Message #10 received at 4471 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Juri Linkov <juri <at> jurta.org>
Cc: 4471 <at> debbugs.gnu.org
Subject: Re: bug#4471: menu-bar menu is undefined
Date: Thu, 17 Sep 2009 23:02:50 -0400
> Some menu-bar's menus fail to open in non-toolkit X builds.
> For instance, when I click on the "Buffer-Menu" menu-bar's item,
> it signals the error:

>   <menu-bar> <Buffer-menu-mode> <nil> is undefined

> However, with the following patch it displays the menu correctly:

> Index: lisp/buff-menu.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/buff-menu.el,v
> retrieving revision 1.125
> diff -u -r1.125 buff-menu.el
> --- lisp/buff-menu.el	15 Jan 2009 16:46:09 -0000	1.125
> +++ lisp/buff-menu.el	17 Sep 2009 21:15:37 -0000
> @@ -119,7 +119,7 @@
 
>  (defvar Buffer-menu-mode-map
>    (let ((map (make-keymap))
> -	(menu-map (make-sparse-keymap)))
> +	(menu-map (make-sparse-keymap "Buffer-Menu")))
>      (suppress-keymap map t)
>      (define-key map "v" 'Buffer-menu-select)
>      (define-key map "2" 'Buffer-menu-2-window)

IIUC this is a correct way to fix it, indeed.
OTOH it would be better to make the non-toolkit code accept the same
keymaps as accepted by the toolkit code.


        Stefan



Added tag(s) patch. Request was from Juanma Barranquero <lekktu <at> gmail.com> to control <at> emacsbugs.donarmstrong.com. (Thu, 22 Oct 2009 09:40:09 GMT) Full text and rfc822 format available.

Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Sun, 25 Oct 2009 00:50:04 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> jurta.org>:
bug acknowledged by developer. (Sun, 25 Oct 2009 00:50:06 GMT) Full text and rfc822 format available.

Message #17 received at 4471-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Juri Linkov <juri <at> jurta.org>, 4471-done <at> debbugs.gnu.org
Subject: Re: bug#4471: menu-bar menu is undefined
Date: Sat, 24 Oct 2009 20:41:02 -0400
> >  (defvar Buffer-menu-mode-map
> >    (let ((map (make-keymap))
> > -	(menu-map (make-sparse-keymap)))
> > +	(menu-map (make-sparse-keymap "Buffer-Menu")))
> >      (suppress-keymap map t)
> >      (define-key map "v" 'Buffer-menu-select)
> >      (define-key map "2" 'Buffer-menu-2-window)
>
> IIUC this is a correct way to fix it, indeed.
> OTOH it would be better to make the non-toolkit code accept the same
> keymaps as accepted by the toolkit code.

I've checked in a change to keyboard.c, allowing the non-toolkit code to
handle keymaps with no prompt strings.



Message #18 received at 4471-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>,
        4471-done <at> debbugs.gnu.org
Subject: Re: bug#4471: menu-bar menu is undefined
Date: Tue, 03 Nov 2009 09:30:03 +0200
>> >  (defvar Buffer-menu-mode-map
>> >    (let ((map (make-keymap))
>> > -	(menu-map (make-sparse-keymap)))
>> > +	(menu-map (make-sparse-keymap "Buffer-Menu")))
>> >      (suppress-keymap map t)
>> >      (define-key map "v" 'Buffer-menu-select)
>> >      (define-key map "2" 'Buffer-menu-2-window)
>>
>> IIUC this is a correct way to fix it, indeed.
>> OTOH it would be better to make the non-toolkit code accept the same
>> keymaps as accepted by the toolkit code.
>
> I've checked in a change to keyboard.c, allowing the non-toolkit code to
> handle keymaps with no prompt strings.

Thank you.  The only remaining minor problem is that without prompt
strings the displayed menus have no titles.  The docstring of
`x-popup-menu' says:

  To give the menu a title, put a string into
  the keymap as a top-level element.

So without these prompt strings there are no menu titles.

I'm not sure if it's worth adding these strings explicitly
in every menu that still misses them, given that now such menus
can be displayed in non-toolkit builds (albeit without menu titles).

-- 
Juri Linkov
http://www.jurta.org/emacs/



bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Tue, 01 Dec 2009 15:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 201 days ago.

Previous Next


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