GNU bug report logs - #24236
25.1.50; `substitute-command-keys', \{...}: optionally show menu items

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 15 Aug 2016 17:16:02 UTC

Severity: wishlist

Found in version 25.1.50

Fixed in version 29.1

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

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 24236 in the body.
You can then email your comments to 24236 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-gnu-emacs <at> gnu.org:
bug#24236; Package emacs. (Mon, 15 Aug 2016 17:16:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 15 Aug 2016 17:16:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; `substitute-command-keys', \{...}: optionally show menu items
Date: Mon, 15 Aug 2016 10:15:29 -0700 (PDT)
Enhancement request.

Add an optional arg to `substitute-command-keys'.  When present
(non-nil) it would cause \{...} to include menu items.

IOW, when `substitute-command-keys' makes use of `describe-bindings' (or
equivalent), if the optional arg is non-nil then it would use
`describe-buffer-bindings', in effect, passing it a non-nil MENUS
argument.

This gives callers of `substitute-command-keys' the possibility of
including menu items in a listing of keymap bindings.

In particular, it lets them show keys that are conditionally bound to
commands in a given map - bindings that are defined using `menu-item'
with a :filter - keys, such as this:

(define-key some-map (kbd "some-keys")
  '(menu-item "" nil
    :filter (lambda (&rest _)
              (and (some-condition) #'some-command))))

Such conditional bindings are typically made for keyboard keys.  But the
fact that they make use of an Emacs-Lisp idiom that defines them using
`menu-item' means that `substitute-command-keys' always filters them
out.  It should be possible to prevent filtering them out.

(If things like `substitute-command-keys', `describe-bindings', and
`describe-buffer-bindings' were defined in Lisp and not C, Lisp users
could themselves take care of such a request.  Please consider moving
such things to Lisp, unless there is a real reason they need to be in C.
I don't imagine that performance is a real reason in this case,
nowadays.)

In GNU Emacs 25.1.50.1 (i686-pc-mingw32)
 of 2015-12-10
Repository revision: 6148555ee5a3d0139ae517803718b3e0357933c7
Windowing system distributor 'Microsoft Corp.', version 6.1.7601
Configured using:
 'configure --prefix=/c/Devel/emacs/snapshot/trunk --enable-checking=yes
 --enable-check-lisp-object-type --without-compress-install 'CFLAGS=-Og
 -ggdb3' LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
 -Ic:/Devel/emacs/include''




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24236; Package emacs. (Fri, 13 May 2022 13:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 24236 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 24236 <at> debbugs.gnu.org
Subject: Re: bug#24236: 25.1.50; `substitute-command-keys', \{...}:
 optionally show menu items
Date: Fri, 13 May 2022 15:54:26 +0200
Drew Adams <drew.adams <at> oracle.com> writes:

> Add an optional arg to `substitute-command-keys'.  When present
> (non-nil) it would cause \{...} to include menu items.

I've now added this to Emacs 29.

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




bug marked as fixed in version 29.1, send any further explanations to 24236 <at> debbugs.gnu.org and Drew Adams <drew.adams <at> oracle.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 13 May 2022 13:55:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 11 Jun 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 313 days ago.

Previous Next


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