[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 6c6fc0b 07/18: Allow `hydra-repeat' to take a numeric arg
From: |
Oleh Krehel |
Subject: |
[elpa] master 6c6fc0b 07/18: Allow `hydra-repeat' to take a numeric arg |
Date: |
Sat, 28 Mar 2015 15:04:25 +0000 |
branch: master
commit 6c6fc0be00822622eeb9a3df9b9d432522a6ca4e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow `hydra-repeat' to take a numeric arg
* hydra.el (hydra-repeat): Update.
It's possible now, for instance with `hydra-vi' to do this:
4j.2..
This will forward-line 4 times (4j), 4 times (.), 2 times (2.), 2
times (.).
Fixes #92
---
hydra.el | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hydra.el b/hydra.el
index 049650a..3e4d311 100644
--- a/hydra.el
+++ b/hydra.el
@@ -230,12 +230,15 @@ Vanquishable only through a blue head.")
(defvar hydra-repeat--command nil
"Command to use with `hydra-repeat'.")
-(defun hydra-repeat ()
- "Repeat last command with last prefix arg."
- (interactive)
- (unless (string-match "hydra-repeat$" (symbol-name last-command))
- (setq hydra-repeat--command last-command)
- (setq hydra-repeat--prefix-arg last-prefix-arg))
+(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))
- [elpa] master updated (059c3d5 -> da45e68), Oleh Krehel, 2015/03/28
- [elpa] master 84f4fe7 06/18: Don't default `hydra-repeat--prefix-arg' to 1, Oleh Krehel, 2015/03/28
- [elpa] master 6c6fc0b 07/18: Allow `hydra-repeat' to take a numeric arg,
Oleh Krehel <=
- [elpa] master 87e4574 05/18: Mention the leading newline in `defhydra' docstring, Oleh Krehel, 2015/03/28
- [elpa] master 71491b9 04/18: Fix argument to `replace-match', Oleh Krehel, 2015/03/28
- [elpa] master f6697f3 02/18: Allow for the "%s`foo" spec., Oleh Krehel, 2015/03/28
- [elpa] master 5c3ab46 08/18: hydra.el (hydra--format): Amend regex, Oleh Krehel, 2015/03/28
- [elpa] master 1bad0c4 09/18: hydra.el (hydra--format): Update regex order, Oleh Krehel, 2015/03/28
- [elpa] master 03771f4 01/18: hydra.el: Turn on lexical-binding, Oleh Krehel, 2015/03/28
- [elpa] master fe1cfee 10/18: hydra-examples.el (hydra-rectangle): Update, Oleh Krehel, 2015/03/28
- [elpa] master c8c6b8c 03/18: Fix blue/red heads with same cmd, Oleh Krehel, 2015/03/28
- [elpa] master 1290237 12/18: Disable key-chord for the duration of the hydra, Oleh Krehel, 2015/03/28
- [elpa] master cb4b78a 11/18: hydra-test.el (hydra-format-4): Add test, Oleh Krehel, 2015/03/28