You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hydra-repeat isn't picking up universal-argument for me. To reproduce it I define the following hydra (based on this random blog-post: https://oremacs.com/2015/02/28/hydra-repeat/ ):
I expect the point to move eight lines down, but it only moves a total of five: Four when invoking next-line using j, and one when invoking hydra-repeat.
I have a potential fix: I tried changing the definition of hydra-repeat from
(defun hydra-repeat (&optional arg)
"Repeat last command with last prefix arg.
When ARG is non-nil, use that instead."
(interactive "p")
(if (eq arg 1)
(unless (string-match "hydra-repeat$" (symbol-name last-command))
(setq hydra-repeat--command last-command)
(setq hydra-repeat--prefix-arg last-prefix-arg))
(setq hydra-repeat--prefix-arg arg))
(setq current-prefix-arg hydra-repeat--prefix-arg)
(funcall hydra-repeat--command))
to
(defun hydra-repeat (&optional arg)
"Repeat last command with last prefix arg.
When ARG is non-nil, use that instead."
(interactive "p")
(if (eq arg 1)
(unless (string-match "hydra-repeat$" (symbol-name last-command))
(setq hydra-repeat--command last-command)
(setq hydra-repeat--prefix-arg last-prefix-arg))
(setq hydra-repeat--prefix-arg arg))
(setq current-prefix-arg hydra-repeat--prefix-arg)
(call-interactively hydra-repeat--command))
The difference is that I use call-interactively instead of funcall. This caused hydra-repeat to actually reuse the prefix-arg from the previous function, which I think is the intended behavior. Please note that I'm not intimately familiar with when one should be used over the other. Could this cause issues that I'm not seeing? Note that the repeat command (the non-hydra one) uses call-interactively rather than funcall.
I also tried changing it to funcall-interactively rather than call-interactively, but it has the same behavior as funcall in this case.
I'm using hydra-20200306.913 from elpa with emacs27 on Ubuntu.
Is hydra-repeat doing what it is supposed to, and if not, is my fix appropriate?
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
Thank you for developing this great package.
hydra-repeat isn't picking up universal-argument for me. To reproduce it I define the following hydra (based on this random blog-post: https://oremacs.com/2015/02/28/hydra-repeat/ ):
And perform the following chords:
I expect the point to move eight lines down, but it only moves a total of five: Four when invoking next-line using j, and one when invoking hydra-repeat.
I have a potential fix: I tried changing the definition of hydra-repeat from
to
The difference is that I use call-interactively instead of funcall. This caused hydra-repeat to actually reuse the prefix-arg from the previous function, which I think is the intended behavior. Please note that I'm not intimately familiar with when one should be used over the other. Could this cause issues that I'm not seeing? Note that the repeat command (the non-hydra one) uses call-interactively rather than funcall.
I also tried changing it to funcall-interactively rather than call-interactively, but it has the same behavior as funcall in this case.
I'm using hydra-20200306.913 from elpa with emacs27 on Ubuntu.
Is hydra-repeat doing what it is supposed to, and if not, is my fix appropriate?
Thanks.
The text was updated successfully, but these errors were encountered: