-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evil-scroll-down defined as next-line command #1659
Comments
Usually we spoof a command as |
@tomdl89 Thanks for the clarification and the tip to solve the issue (I was unaware of the @protesilaos I will leave it up to you to decide whether or not you want to make any adjustments to pulsar (although might be worth adding some documentation on this issue anyways as I think there may be quite some evil users out there also trying to use pulsar). In case people are facing the same issue and stumble on this thread trying to find a solution, the following has worked for me: (defun my/pulsar-pulse-evil-scroll ()
(when (or (eq real-this-command 'evil-scroll-down)
(eq real-this-command 'evil-scroll-up))
(pulsar-pulse-line)))
(add-hook 'post-command-hook #'my/pulsar-pulse-evil-scroll) Not sure if that is the best way to do it as I'm not a lisp expert by any means :) |
Thank you @tomdl89! @fast-90 I think we can continue this discussion on the mailing list. I believe the following should work: pulsar.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pulsar.el b/pulsar.el
index ed62b86..0e2506f 100644
--- a/pulsar.el
+++ b/pulsar.el
@@ -393,7 +393,8 @@ (define-globalized-minor-mode pulsar-global-mode pulsar-mode pulsar--on)
(defun pulsar--post-command-pulse ()
"Run `pulsar-pulse-line' for `pulsar-pulse-functions'."
(when (and (or pulsar-mode pulsar-global-mode)
- (memq this-command pulsar-pulse-functions))
+ (or (memq this-command pulsar-pulse-functions)
+ (memq real-this-command pulsar-pulse-functions)))
(pulsar-pulse-line)))
(make-obsolete 'pulsar-setup nil "0.3.0") |
The need for this arrangement became clear after trying to make the scroll motions of the 'evil' package work with pulsar-pulse-functions. Thanks to Duy Nguyen for reporting the issue on the mailing list. I helped find the source of the apparent problem in the 'evil' code base and then Tom Dalziel explained why 'evil' does things this way, suggesting 'real-this-command' as a possibility: - <https://lists.sr.ht/~protesilaos/pulsar/%3C89566F5C-25AD-4281-94CB-031FE8878119%40gmail.com%3E> - <https://lists.sr.ht/~protesilaos/pulsar/%3C87pmgy3vzq.fsf%40protesilaos.com%3E> - <emacs-evil/evil#1659>
Closing this as explanation sufficiently provided by @tomdl89 and original issue resolved by @protesilaos in the new update of pulsar. |
Issue type
Environment
Emacs version: GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.5.0, NS appkit-2113.50 Version 12.4 (Build 21F79)) of 2022-07-10
Operating System: MacOS Montery version 12.5
Evil version: Evil version 1.15.0
Evil installation type: straight (via MELPA I believe)
Graphical/Terminal: Graphical
Tested in a
make emacs
session (see CONTRIBUTING.md): NoReproduction steps
C-d
to scroll downExpected behavior
When executing
evil-scroll-down
(e.g. throughC-d
), the line the cursor is on should pulse (temporarily highlight as intended by pulsar).Actual behavior
Nothing happens.
Further notes
The issue is likely caused due to evil defining
evil-scroll-down
as anext-line
command, see here (special thanks to @protesilaos for identifying the root cause of the issue). The same issue happens withevil-scroll-up
.Adding
next-line
topulsar-pulse-functions
makes it work, but has the undesired effect of making the line alsopulse for thej
motion.Added this a question instead of a bug-report as it might be an edge case where defining it as
next-line
is actually an issue. My question is: what is the reason it is defined like this (and notscroll-down-command
for example)? And are there other ways around my problem is the scroll down function has to be defined as anext-line
command?The text was updated successfully, but these errors were encountered: