-
Notifications
You must be signed in to change notification settings - Fork 87
named prefix maps not possible? #253
Comments
OK, it seems that (push '((nil . "as-jump-ruby-map") . (nil . "Ruby")) which-key-replacement-alist) works, although it would be nicer if the above worked out of the box. |
Actually, (define-key as-jump-map "r" '("Ruby" . as-jump-ruby-map)) is broken; it results in (define-key as-jump-map "r" as-jump-ruby-map)) Is something wrong with |
Same problem here. |
Your syntax is wrong. You need (define-key as-jump-map "r" (cons "Ruby" as-jump-ruby-map)) to bind to the keymap and not the symbol (define-key as-jump-map "r" 'as-jump-ruby-map)) you would run into exactly the same problem. |
By the way, there is another approach that will make your binding work. You can use (define-prefix-command 'test)
(define-key some-map "t" '("Test" . test)) The first line defines |
I did exactly that, minimal example: (setq rde-leader "C-SPC")
(global-set-key (kbd rde-leader) nil)
(define-prefix-command 'rde-global-map)
(global-set-key (kbd rde-leader) 'rde-global-map)
(define-key rde-global-map "b" '("Switch to buffer" . switch-to-buffer)) Now I press |
@minikN First, you're describing another issue. This issue is about naming prefix maps. Second, I just tried the steps you described and they work fine for me (I see "Switch to buffer" as expected). |
@justbur Okay, for me it was the same issue, because it doesn't work with naming prefix maps (the same way) as well. It also doesn't work with using
Where should I start looking? |
@minikN I'd say make sure which-key is up to date first. Try again, and if it doesn't work then post a config that reproduces the problem from a minimal setup ( |
So I wrote a helper to hide my ugly hack behind something a bit nicer: aspiers/emacs@fdea08f |
I'm trying to give a descriptive name to a prefix map, and having problems doing it in any kind of elegant way. To describe it more easily, I'll explain the concrete behaviour I want ...
I have a keymap
as-jump-map
full of bindings for jumping to files / buffers which I commonly need to access. I have this bound to bothC-c j
and the key chordzj
(alsojz
).I want a sub-keymap
as-jump-ruby-map
just for jumping to Ruby stuff. I havewhich-key-enable-extended-define-key
set tot
so thatdefine-key
is advised, and this is already working fine in other circumstances. However if I do something like:then which-key shows
r -> +as-jump-ruby-map
rather thanr -> Ruby
. I can partially fix this withbut then it doesn't work when
as-jump-map
is triggered via thezj
keymap. Is there a way to do this cleanly I'm missing?The text was updated successfully, but these errors were encountered: