From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#26428: 24.5; (elisp) Extended Menu Items: document same features for menus Date: Sun, 9 Apr 2017 14:23:02 -0700 (PDT) Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1491773057 17529 195.159.176.226 (9 Apr 2017 21:24:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Apr 2017 21:24:17 +0000 (UTC) To: 26428@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 09 23:24:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxKJa-0004Lv-LK for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 23:24:06 +0200 Original-Received: from localhost ([::1]:59697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxKJf-0000Dd-5q for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Apr 2017 17:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxKJZ-0000DX-7p for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:24:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxKJW-00088x-3g for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:24:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxKJW-00088t-0X for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cxKJV-0008J0-R9 for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2017 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26428 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.149177300131874 (code B ref -1); Sun, 09 Apr 2017 21:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Apr 2017 21:23:21 +0000 Original-Received: from localhost ([127.0.0.1]:40179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxKIr-0008I1-FI for submit@debbugs.gnu.org; Sun, 09 Apr 2017 17:23:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxKIo-0008Ho-Pj for submit@debbugs.gnu.org; Sun, 09 Apr 2017 17:23:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxKIi-00081x-TV for submit@debbugs.gnu.org; Sun, 09 Apr 2017 17:23:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57814) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cxKIi-00081s-QG for submit@debbugs.gnu.org; Sun, 09 Apr 2017 17:23:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxKIh-0000BU-QW for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:23:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxKIe-00080h-Mr for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:23:11 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:49428) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cxKIe-00080G-EG for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2017 17:23:08 -0400 Original-Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v39LN5xo005591 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 9 Apr 2017 21:23:05 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v39LN4rA025442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 9 Apr 2017 21:23:05 GMT Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id v39LN3Tc019554 for ; Sun, 9 Apr 2017 21:23:04 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 12.0.6753.5000 (x86)] X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131420 Archived-At: I filed a bug a few years back to get the use of keywords documented for separator lines. That was done: in (elisp) `Menu Separators' we now have this: You can use a longer form to specify keywords such as `:enable' and `:visible=3D' for a menu separator: (menu-item SEPARATOR-TYPE nil . ITEM-PROPERTY-LIST) For example: (menu-item "--" nil :visible (boundp 'foo)) After some fiddling, I found that the same is true for menus (e.g. submenus). This too should be documented - it is not obvious. What is needed is to pass the keymap itself, not a variable whose value is the keymap, as the REAL-BINDING. E.g.: (define-key diredp-menu-bar-operate-menu [multiple-dired] `(menu-item "Dired" ,diredp-multiple-dired-menu :visible (save-excursion (goto-char (point-min)) (and (re-search-forward (dired-marker-regexp) nil t) (re-search-forward (dired-marker-regexp) nil t))))) It's not enough to use `diredp-multiple-dired-menu' as the second arg to `menu-item'. Its value needs to be passed as the second arg. The way (elisp) Extended Menu Items is written, it seems to apply only to menu items that are leaves, not to those that are submenu names. Even the description of REAL-BINDING suggests this limitation ("the command to execute"). Please document how to use :enable, :visible etc. with a (sub)menu. In GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D3D/c/usr --host=3D3Di686-pc-mingw32'