emacs-which-key icon indicating copy to clipboard operation
emacs-which-key copied to clipboard

Trasient maps support

Open Ergus opened this issue 3 years ago • 5 comments

Hi:

I am wondering whether is it something available to provide some support for transient-maps. I mean; is it possible to show some hints with which-key when a transient-map is active?

Ergus avatar Jun 17 '21 22:06 Ergus

Isn't the point of transient maps to show you the available key bindings? Are you talking about this package?

justbur avatar Jun 20 '21 02:06 justbur

Are you talking about this package?

No, I was referring to the set-transient-map function: https://www.gnu.org/software/emacs/manual/html_node/elisp/Controlling-Active-Maps.html

Ergus avatar Jun 20 '21 14:06 Ergus

The only package that offers more or less a similar functionality is hydra... but it is a little bit too much for basic uses and to go into vanilla as which-keys is expected to do hopefully very soon.

Ergus avatar Jun 20 '21 15:06 Ergus

Just chiming in here. I've set myself up with a command to activate a sparse keymap via (set-transient-keymap) and which-key does not activate. Just wanna throw my name in the bucket of people who might care about this.

(defvar er/keymap
  (let ((map (make-sparse-keymap "er/objects")))
    (td/bind-keys '(("w" . er/mark-word)
                    ("W" . er/mark-symbol)
                    ("s" . er/mark-sentence)
                    ("p" . er/mark-paragraph)
                    ("b" . er/mark-block)
                    ("e" . er/mark-email)
                    ("u" . er/mark-url)
                    ("o" . er/mark-org-element)
                    ("O" . er/mark-org-parent))
                  map)
    map)
  "A keymap for quickly calling expand region functions.
\\{er/keymap}")

(defun er/keymap ()
  "Activate the `er/keymap'.
\\{er/keymap}"
  (interactive)
  (set-transient-map er/keymap))

trev-dev avatar Aug 11 '22 22:08 trev-dev

Hercules was built to use which-key for transient states.

It's like hydra but it doesn't require the significant amount of setup. https://github.com/wurosh/hercules

KhalfaniW avatar Sep 22 '22 18:09 KhalfaniW