GNU bug report logs - #60530
28.2; Add tools to find keymaps that bind a given command

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; Reported by: Sean Devlin <spd@HIDDEN>; dated Tue, 3 Jan 2023 22:32:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

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


Received: (at submit) by debbugs.gnu.org; 3 Jan 2023 22:31:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jan 03 17:31:15 2023
Received: from localhost ([127.0.0.1]:47001 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pCpoR-0001ue-Df
	for submit <at> debbugs.gnu.org; Tue, 03 Jan 2023 17:31:15 -0500
Received: from lists.gnu.org ([209.51.188.17]:56854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <spd@HIDDEN>) id 1pCpoP-0001uR-L3
 for submit <at> debbugs.gnu.org; Tue, 03 Jan 2023 17:31:14 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <spd@HIDDEN>) id 1pCpoP-0006jp-F2
 for bug-gnu-emacs@HIDDEN; Tue, 03 Jan 2023 17:31:13 -0500
Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <spd@HIDDEN>) id 1pCpoK-0000Jg-R5
 for bug-gnu-emacs@HIDDEN; Tue, 03 Jan 2023 17:31:11 -0500
Received: by mail-qt1-x82f.google.com with SMTP id v14so22975765qtq.3
 for <bug-gnu-emacs@HIDDEN>; Tue, 03 Jan 2023 14:31:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=toadstyle-org.20210112.gappssmtp.com; s=20210112;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=OGNrG4iZcR6YW3JkxTF1iCj4y7Qu3fNPRjMkHA1d3p0=;
 b=cIvOu2ztPlXQYCRae47Nj2kZXAJQtCbfnJZSBNxmwv3O5+EebbqsVhWkaIelc8d+sT
 UAQMea4NQFRoBXV6aiKwLRZn/8sRe6MipuOYZXfXI5GnJIEZnuKgsZjGzSBoueTcoWB+
 eUw3MKsktRHhAlH7FIlaknnrt+OnRS8OJaBwSLYNUbOZ+teL2tAqReOoP4k62pgvuI2C
 rXaboWKapR+iOMGgStEpn1mbY1myw0fxiRKgUlGdDk02celrUoAFOGh+9C9rjfAnVu/Z
 HgGEtku14mpo+kLkq2615NS6n+C/NiNF7sKjTaPhbrPLMPC/5LwiN8fEtgUnCMdv8Of9
 mJ+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=to:date:message-id:subject:mime-version:content-transfer-encoding
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=OGNrG4iZcR6YW3JkxTF1iCj4y7Qu3fNPRjMkHA1d3p0=;
 b=a5ZhRhCCwHOmMCnfu2yXmByjHKP+mMeiUdMkmA2SavEyVxVn173ljkq5M53909fim7
 /pI3lZooJZ9BxxNQEd9lmB1Kyeci+uzRs1ktyeM2N+4JuYRsQROzZa87inCxlg23dPOJ
 UzQsUgEWzfb7SvviO5PeEhJ2RVYW5DE64ExIvHnYx8sm1N+g1vhcAAdiKsdiD3CalelG
 aJzbN1sKpg9/mRtDeEjTyBExS+a4GAGdnWRB8JpTIWydkxfrAuc1LzTh1sDFSeyXwWqG
 KguDzl+5cZjdbIQqfdKHLSeU0IVjZLEcu+LuK6DL42p8zSDDYBodIsI6IYNHunVIaQLh
 yT0A==
X-Gm-Message-State: AFqh2kqciA91Ra7NA0gr2ybCXXnHoqRKBtKfpf+5lc8bshTVEF66XDB6
 qzsRdFLQn3K8+seekyl9atJJxFWohgnPtdnj
X-Google-Smtp-Source: AMrXdXvasBlzK0FDm38lzO7JVWNHuTnFnZEJt0x2OeGFxslWe11vkY8kMQknlEw5H1LoR72/yycxyw==
X-Received: by 2002:ac8:1249:0:b0:3a6:7558:e0af with SMTP id
 g9-20020ac81249000000b003a67558e0afmr66117301qtj.28.1672785064393; 
 Tue, 03 Jan 2023 14:31:04 -0800 (PST)
Received: from smtpclient.apple ([70.107.172.48])
 by smtp.gmail.com with ESMTPSA id
 h25-20020ac87159000000b003a82562c90fsm19245008qtp.62.2023.01.03.14.31.03
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 03 Jan 2023 14:31:04 -0800 (PST)
From: Sean Devlin <spd@HIDDEN>
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.2\))
Subject: 28.2; Add tools to find keymaps that bind a given command
Message-Id: <9D2761CB-E158-4D8A-876B-CE1AE0F9ACEA@HIDDEN>
Date: Tue, 3 Jan 2023 17:30:53 -0500
To: bug-gnu-emacs@HIDDEN
X-Mailer: Apple Mail (2.3731.300.101.1.2)
Received-SPF: pass client-ip=2607:f8b0:4864:20::82f;
 envelope-from=spd@HIDDEN; helo=mail-qt1-x82f.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/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: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi folks,

There is a third-party package "helpful"
(https://github.com/Wilfred/helpful) that provides (in their words) "an
alternative to the built-in Emacs help that provides much more
contextual information".

One nice feature their describe-command replacement provides is a list
of bindings for the given command for all known keymaps. For example,
for find-file it might generate a list like the following:

ctl-x-map C-f
embark-become-file+buffer-map f
embark-file-map RET
embark-file-map f
global-map <open>
global-map C-x C-f
term-raw-map C-c C-f

(Obviously, it depends on what libraries are loaded when the command is
called.)

This is similar to where-is, but it provides a broader view of where the
command is bound. As far as I know, where-is only tells you about
bindings in active maps, and it doesn't tell you which maps contain the
bindings.

It's nice to know exactly which keymaps contain a binding. It gives you
a better idea of where best to tweak a configuration, and it can give
you new ideas about how and where a command might be used.

I looked in helpful.el, and they use some non-trivial logic to generate
their list. I think this functionality should come built-in with Emacs.

I think Emacs should provide low-level functions to generate a list of
bindings similar to the above and a command to describe the bindings. It
might also be nice to expose the information in describe-command like
helpful.el does.

Thanks!

In GNU Emacs 28.2
System Description:  macOS 13

Configured using:
'configure --with-ns '--enable-locallisppath=/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules'

Configured features:
ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS
TOOLKIT_SCROLL_BARS ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize
mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer cl-generic cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932
hebrew greek romanian slovak czech european ethiopic indian cyrillic
chinese composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button
loaddefs faces cus-face macroexp files window text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads kqueue cocoa ns multi-tty
make-network-process emacs)

Memory information:
((conses 16 50747 7557)
(symbols 48 6552 1)
(strings 32 18281 2303)
(string-bytes 1 632125)
(vectors 16 13822)
(vector-slots 8 191476 12084)
(floats 8 21 38)
(intervals 56 202 0)
(buffers 992 10))




Acknowledgement sent to Sean Devlin <spd@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#60530; 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: Tue, 3 Jan 2023 22:45:01 UTC

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