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

Add support for Devil

Open wesnel opened this issue 1 year ago • 7 comments

What is Devil?

Devil mode trades your comma key in exchange for a modifier-free editing experience in Emacs.

The above description comes from their README at:

https://github.com/susam/devil

Unfortunately, Devil is not currently supported by which-key. For example, when I type , x, the which-key popup for C-x does not appear. Instead, I merely see the following text in the echo area:

Devil: C-x

With this patch, I have mimicked the existing god-mode logic in which-key to intercept the current Devil prompt and spawn a which-key popup.

This feature was requested by susam/devil#3:

  • https://github.com/susam/devil/issues/3

wesnel avatar Aug 01 '23 01:08 wesnel

It would be nice to abstract this logic on the which-key side, so that any package can use it and which-key doesn't have to know about these packages

justbur avatar Aug 10 '23 12:08 justbur

I just tried the PR, and it LGTM.

AkibAzmain avatar Oct 02 '23 12:10 AkibAzmain

Ok I have found a bug, typing , m m (C-M-) throws an error.

AkibAzmain avatar Oct 02 '23 12:10 AkibAzmain

Hi @wesnel, @AkibAzmain :)

What do we need to merge this?

@AkibAzmain you mentioned that you found an error, what was it?

jonasfagundes avatar Oct 17 '23 12:10 jonasfagundes

hi @AkibAzmain, i believe i have fixed your error.

typing , m m equates to typing C-M-, which resulted in the error:

Error running timer ‘which-key--update’: (error "C- must prefix a single character, not M-")

i have fixed this by first performing a check on the current devil command string with key-valid-p. please let me know if anyone knows of a better way to accomplish this.

i have also rebased to fix conflicts with the master branch.

thanks all!

wesnel avatar Oct 24 '23 17:10 wesnel

Would love to see this merged!

patrickt avatar Jan 04 '24 15:01 patrickt

Hi, thanks for the contribution. I'm currently working on getting which-key merged into core emacs. In the process, I am disentangling the third-party support code from which-key in a way that will allow for third-party support without putting custom code in the which-key file.

See what I did recently with god-mode so you can update this PR. It may no longer be necessary at all. To be clear the goal is to allow for third-party support without modifying the which-key code at all. This should be possible now, but if not I can make further changes.

justbur avatar Feb 26 '24 22:02 justbur