help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Question Regarding Creating A Random Buffer For Keybind


From: Drew Adams
Subject: RE: [External] : Question Regarding Creating A Random Buffer For Keybinding Reminders / Attempt To Do Via A Reminder Hydra
Date: Sun, 17 Apr 2022 16:36:38 +0000

No doubt someone will point you to `which-key'...
___

As an alternative, I'll point you to key
completion with `keysee.el'.

(Better yet is key completion with Icicles;
Key See is a reduced version, without any
particular completion support/features.)

Key See shows you, at any time, in any
context - including at the top level (i.e.,
not just after a prefix key), the keys that
are currently available, and the commands
they're bound to.  All available keys, any
time.

These are shown in buffer *Completions* as
completion candidates: `KEY  =  COMMAND'.
You can match KEY, or COMMAND, or both,
against minibuffer input to filter the
candidates, and then choose one to invoke.

A prefix-key candidate has `...' as its
COMMAND portion: `PREFIX-KEY  =  ...'.

If you invoke a candidate that's a prefix
key, you're shown all the keys/commands
you can continue with, etc.  Choose a final
candidate to invoke it, or use `C-g' to end
without invoking any command.

Except at the top level, you also have the
candidate `..' (no `KEY  =  COMAND'), which
takes you up a level.

E.g., if you're showing the keys on prefix
key `C-x 4' then `..' takes you up a level
to show you the keys on `C-x'.  Choosing
`..' again then takes you to the top level.

This gives you a dynamic, on-the-fly way
to see _any_ part of the entire forest of
key bindings (including menu-bar menus!).
Explore it up, down, and around - not just
down, down... into a given prefix key.

(`menu-bar' is the name of a prefix key.
Exploring the entire menu-bar hierarchy is
no different from exploring `C-x'.  Just
choose `menu-bar  =  ...' and dig in...)

You can change the candidate sort order on
the fly, using `C-,'.  Sort by key name -
either prefix keys first or local (i.e.,
major-mode) keys first.  Or sort by command
name.

You can configure which keymaps to recognize
for top-level key completion.

You can have key completion kick in only on
demand (by hitting, e.g., `S-TAB) or also
automatically, after a given delay.

Being able to complete also against command
names is an advantage.  Among other things,
it means you can filter (and sort) by
matching parts of command names.  You can
often remember or guess part of a command
name, even if you don't have a clue which
keys might be involved.

Key completion is a good way to learn keys -
it's at your fingertips, either on demand
or automatically.

Being able to match parts of key names and
command names is helpful, but sometimes
you might want to just hit a candidate key
to match it (`which-key' behavior), rather
than type text to match its name (e.g.
"C-x").  You can do that by prefixing the
key with `M-q': `C-q C-x' inserts "C-x".
___

(If you use Icicles then the key completion
you get is more feature-full.  You can
progressively narrow a set of candidates by
matching multiple patterns, show the doc
for candidate keys/commands, etc.

You can perhaps get some such benefit if
you combine `keysee.el' with another
completion "framework" besides Icicles -
dunno.  `keysee.el' is itself independent
of Icicles.)
___

https://www.emacswiki.org/emacs/KeySee

https://www.emacswiki.org/emacs/download/keysee.el



reply via email to

[Prev in Thread] Current Thread [Next in Thread]