GNU bug report logs - #7755
24.0.50; Document that you can apply a keyword to a menu submenu

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Drew Adams" <drew.adams@HIDDEN>; dated Wed, 29 Dec 2010 17:20:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Dec 2010 17:19:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 29 12:19:15 2010
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1PXzgA-0006v7-H7
	for submit <at> debbugs.gnu.org; Wed, 29 Dec 2010 12:19:15 -0500
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams@HIDDEN>) id 1PXzg9-0006uw-Ec
	for submit <at> debbugs.gnu.org; Wed, 29 Dec 2010 12:19:14 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1PXzmo-0007rc-5g
	for submit <at> debbugs.gnu.org; Wed, 29 Dec 2010 12:26:07 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
	T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:49422)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1PXzmo-0007rW-1I
	for submit <at> debbugs.gnu.org; Wed, 29 Dec 2010 12:26:06 -0500
Received: from [140.186.70.92] (port=59336 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1PXzmm-00086g-UH
	for bug-gnu-emacs@HIDDEN; Wed, 29 Dec 2010 12:26:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1PXzml-0007qp-MY
	for bug-gnu-emacs@HIDDEN; Wed, 29 Dec 2010 12:26:04 -0500
Received: from rcsinet10.oracle.com ([148.87.113.121]:25755)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams@HIDDEN>) id 1PXzml-0007qb-H6
	for bug-gnu-emacs@HIDDEN; Wed, 29 Dec 2010 12:26:03 -0500
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227])
	by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id
	oBTHPwDn015708
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs@HIDDEN>; Wed, 29 Dec 2010 17:26:01 GMT
Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154])
	by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id
	oBTHPv9m028996
	for <bug-gnu-emacs@HIDDEN>; Wed, 29 Dec 2010 17:25:58 GMT
Received: from abhmt018.oracle.com by acsmt353.oracle.com
	with ESMTP id 914189591293643492; Wed, 29 Dec 2010 09:24:52 -0800
Received: from dradamslap1 (/10.159.216.195)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 29 Dec 2010 09:24:52 -0800
From: "Drew Adams" <drew.adams@HIDDEN>
To: <bug-gnu-emacs@HIDDEN>
Subject: 24.0.50; Document that you can apply a keyword to a menu submenu
Date: Wed, 29 Dec 2010 09:24:56 -0800
Message-ID: <58EA349B1CB44B7E96ED8B5A7B409201@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: AcunfU/Hm/vx3gfwTneieqV0+AxRfA==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.4 (------)

emacs -Q
 
(See also related bug #6344.)
 
The doc for so-called extended menu items is misleading and incomplete.
 
1. As bug #6344 addresses, the doc does not indicate that you can use
`menu-item' and keywords for a non-selectable menu item.
 
2. The doc also does not indicate that you can use `menu-item' and
keywords for a submenu, as opposed to a menu item.
 
#2 is the subject of this bug report, but #1 and #2 should be addressed
 together.
 
The relevant doc is (elisp) `Extended Menu Items'.
 
What's missing is to explicitly state the following:
 
a. This is about submenus as well as menu items (no, a submenu is not a
   menu item).  This also means that the node name is not really
   appropriate.
 
b. The form for a submenu is the same:
   (menu-item ITEM-NAME REAL-BINDING . ITEM-PROPERTY-LIST)
 
   But the REAL-BINDING description needs to be changed.  This is
   incorrect:
   "The third element, REAL-BINDING, is the command to execute."
 
   REAL-BINDING can be a command or a keymap or nil.
 
c. If REAL-BINDING is a command, then you get a selectable menu item.
   If it is a keymap then you get a submenu.  If it is nil then you get
   a non-selectable menu item (e.g. a separator line).
 
All of this is particularly important wrt ITEM-PROPERTY-LIST, which BTW
needs to be renamed to something like KEYWORDS, since (i) it is a
_keyword_ list, not an arbitrary property list, and (ii) it is not
necessarily for a menu item, since REAL-BINDING can also be a keymap or
nil.
 
Without such doc changes, users will not know that they can use a
keyword such as :visible with a submenu or a separator item (to
remove it, in the case of :visible).
 
I discovered this only by trial and error and by examining the Emacs
source files.  Among the Emacs source files, AFAICT only 3 files use
:visible with a submenu, and for a total of only 5 submenus.
 
The 3 files: menu-bar.el, semantic.el, and gdb-mi.el. The 5 submenus:
`menu-bar-showhide-fringe-ind-menu', `menu-bar-showhide-fringe-menu',
`menu-bar-showhide-scroll-bar-menu', `menu-bar-showhide-tool-bar-menu',
`mule-menu-keymap', `edit-menu', `navigate-menu', `menu'.
 
IOW, this feature does not appear to be used often by Emacs developers,
which suggests that perhaps it is not well known.
 
I got the idea when looking for a good way to dynamically remove a
submenu that has only buffer-modifying commands from a popup menu
whenever the buffer is read-only.

I'm guessing that such a use case might be more common than the
actual uses in our sources of :visible with a submenu indicate.  Don't
we have any submenus that should be removed or disabled for a
read-only buffer, for example?

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2010-12-20 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.4) --no-opt --cflags
-Ic:/imagesupport/include'
 





Acknowledgement sent to "Drew Adams" <drew.adams@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs@HIDDEN:
bug#7755; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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