all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60530: 28.2; Add tools to find keymaps that bind a given command
@ 2023-01-03 22:30 Sean Devlin
  2023-02-20  7:07 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Sean Devlin @ 2023-01-03 22:30 UTC (permalink / raw)
  To: 60530

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))





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-20 13:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03 22:30 bug#60530: 28.2; Add tools to find keymaps that bind a given command Sean Devlin
2023-02-20  7:07 ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 11:54   ` Eli Zaretskii
2023-02-20 12:01     ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 13:09       ` Eli Zaretskii
2023-02-20 13:44         ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.