GNU bug report logs - #18442
24.3; easy-menu-define docstring of menu :label and :help

Previous Next

Package: emacs;

Reported by: Kevin Ryde <user42_kevin <at> yahoo.com.au>

Date: Wed, 10 Sep 2014 07:02:01 UTC

Severity: minor

Tags: fixed

Found in version 24.3

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kevin Ryde <user42_kevin <at> yahoo.com.au>
To: 18442 <at> debbugs.gnu.org
Subject: bug#18442: 24.3; easy-menu-define docstring of menu :label and :help
Date: Wed, 10 Sep 2014 16:57:12 +1000
[Message part 1 (text/plain, inline)]
I see easy-menu-define accepts :label for the menu name, ie. the button
which opens the menu or sub-menu.  Eg. a top-level item changing on
every redisplay,

    (easy-menu-define my-menu global-map "my menu docstring"
      '("MyTest"
        :label (format "MyTest-%d" (random 100))
        ["Foo" doctor t]))

Is this a documented feature?  It'd be good to describe it in the
docstring.  Perhaps something like below, with :help similarly too.

2014-09-09  Kevin Ryde  <user42_kevin <at> yahoo.com.au>

	* emacs-lisp/easymenu.el (easy-menu-define): Docstring :label and
	:help of the menu itself.

[easymenu.el.docstring.diff (text/x-diff, inline)]
--- easymenu.el.orig	2014-09-10 16:40:15.959124358 +1000
+++ easymenu.el	2014-09-10 16:42:55.067126503 +1000
@@ -71,6 +71,17 @@
     if the expression evaluates to a non-nil value.  `:enable' is
     an alias for `:active'.
 
+ :label FORM
+    FORM is an expression that is dynamically evaluated and whose
+    value serves as the menu's label (the default is the first
+    element of MENU).
+
+ :help HELP
+    HELP is a string, the help to display for the menu.
+    In a GUI this is a \"tooltip\" on the menu button.  (Though
+    in Lucid :help is not shown for the top-level menu bar, only
+    for sub-menus.)
+
 The rest of the elements in MENU are menu items.
 A menu item can be a vector of three elements:
 
[Message part 3 (text/plain, inline)]

In GNU Emacs 24.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2014-06-07 on babin, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
Configured using:
 `configure '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf'
 '--without-gsettings' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2
 -fstack-protector --param=ssp-buffer-size=4 -Wformat
 -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

This bug report was last modified 5 years and 290 days ago.

Previous Next


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