Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Add support for Devil #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wesnel
Copy link

@wesnel wesnel commented Aug 1, 2023

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:

@justbur
Copy link
Owner

justbur commented Aug 10, 2023

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

@AkibAzmain
Copy link

I just tried the PR, and it LGTM.

@AkibAzmain
Copy link

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

@jonasfagundes
Copy link

Hi @wesnel, @AkibAzmain :)

What do we need to merge this?

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

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:

- susam/devil#3
@wesnel
Copy link
Author

wesnel commented Oct 24, 2023

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!

@patrickt
Copy link

patrickt commented Jan 4, 2024

Would love to see this merged!

@justbur
Copy link
Owner

justbur commented Feb 26, 2024

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants