1

I am trying to update annoying-arrows to work with evil-mode.

Annoying arrows is this minor-mode that complains when you use the same simple movement-command too many times in a row. (I have also updated it to open a buffer when it is triggered to make it super annoying.)

Here is my attempt at getting annoying-arrows to work with evil-mode.

One problem I have is that when the advice is triggered for the functions evil-forward-char and evil-previous-char, the message is written twice in the buffer.

So instead of this: Annoying! How about using left-word (<C-left>) instead of this-command: evil-backward-char??

I get the following message:

Annoying! How about using left-word (<C-left>) instead of this-command: evil-backward-chaAnnoying! How about using left-word (<C-left>) instead of this-command: evil-backward-char?r?

Anybody have a clue why that might happen and if there is a workaround? Any debugging tips would be appreciated.

There is probably nothing wrong with my code as it works for the regular emacs functions next-line and previous-line.

Ps. This issue might be related, but is above my current level of emacs understanding: Problem with defining advice for evil-delete

1

For efficiency reason, evil-forward-char is called again after narrowing the buffer.

Not an ideal answer but I suggest to modify the logic to advice stock forward-char and check with this-command-keys if the user pressed the expected keys (in this case l key). This way your advice is agnostic of the layer on top of the raw emacs commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.