[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8875bf1 28/45: Make digit and negative arguments work in 2
From: |
Oleh Krehel |
Subject: |
[elpa] master 8875bf1 28/45: Make digit and negative arguments work in 24.3 |
Date: |
Thu, 16 Apr 2015 12:45:51 +0000 |
branch: master
commit 8875bf1b16c2f74fa3855d9ec8eddfe49edbb5c4
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Make digit and negative arguments work in 24.3
* hydra.el (hydra--digit-argument): Update.
(hydra--negative-argument): Update.
Just flatten these two functions to their 25.2 bodies, and don't call
the `set-transient-map' variants, since the map remains anyway because
of `hydra-base-map'.
---
hydra.el | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/hydra.el b/hydra.el
index 0d219e3..15ef310 100644
--- a/hydra.el
+++ b/hydra.el
@@ -253,17 +253,28 @@ Vanquishable only through a blue head.")
(defun hydra--digit-argument (arg)
"Forward to (`digit-argument' ARG)."
(interactive "P")
- (let ((universal-argument-map
- (if (fboundp 'universal-argument--mode)
- hydra-curr-map
- universal-argument-map)))
- (digit-argument arg)))
+ (let* ((char (if (integerp last-command-event)
+ last-command-event
+ (get last-command-event 'ascii-character)))
+ (digit (- (logand char ?\177) ?0)))
+ (setq prefix-arg (cond ((integerp arg)
+ (+ (* arg 10)
+ (if (< arg 0)
+ (- digit)
+ digit)))
+ ((eq arg '-)
+ (if (zerop digit)
+ '-
+ (- digit)))
+ (t
+ digit)))))
(defun hydra--negative-argument (arg)
"Forward to (`negative-argument' ARG)."
(interactive "P")
- (let ((universal-argument-map hydra-curr-map))
- (negative-argument arg)))
+ (setq prefix-arg (cond ((integerp arg) (- arg))
+ ((eq arg '-) nil)
+ (t '-))))
;;* Repeat
(defvar hydra-repeat--prefix-arg nil
- [elpa] master 3fce2bd 12/45: Try to re-encode the input in the terminal, (continued)
- [elpa] master 3fce2bd 12/45: Try to re-encode the input in the terminal, Oleh Krehel, 2015/04/16
- [elpa] master fa5643f 15/45: Quit Hydra for `handle-switch-frame', Oleh Krehel, 2015/04/16
- [elpa] master af39a98 14/45: Adapt to the new `hydra-set-transient-map', Oleh Krehel, 2015/04/16
- [elpa] master acdec5b 27/45: Add an integration test for digit args in amaranth, Oleh Krehel, 2015/04/16
- [elpa] master 1a54e09 05/45: hydra.el (hydra--make-funcall): Update location, Oleh Krehel, 2015/04/16
- [elpa] master b351b7c 24/45: hydra.el (hydra--body-color): Remove, Oleh Krehel, 2015/04/16
- [elpa] master 5787a4d 13/45: Move away from setting "t" in keymaps, Oleh Krehel, 2015/04/16
- [elpa] master 5379642 06/45: Use `hydra-keyboard-quit' instead of `hydra-cleanup', Oleh Krehel, 2015/04/16
- [elpa] master e88839c 17/45: Don't double-call :post, Oleh Krehel, 2015/04/16
- [elpa] master 2f07e50 26/45: Account for digit argument, Oleh Krehel, 2015/04/16
- [elpa] master 8875bf1 28/45: Make digit and negative arguments work in 24.3,
Oleh Krehel <=
- [elpa] master 0ae639f 22/45: Use a variable instead of a function for the hint, Oleh Krehel, 2015/04/16
- [elpa] master d71386b 29/45: hydra.el (hydra--head-color): Simplify, Oleh Krehel, 2015/04/16
- [elpa] master 22348d7 23/45: hydra.el (hydra--face): Remove, Oleh Krehel, 2015/04/16
- [elpa] master 88f14a0 30/45: hydra.el (hydra--head-color): Remove, Oleh Krehel, 2015/04/16
- [elpa] master cb630df 16/45: Update the tests for the new `hydra-set-transient-map', Oleh Krehel, 2015/04/16
- [elpa] master 566aab7 31/45: Set `this-command' when appropriate, Oleh Krehel, 2015/04/16
- [elpa] master 19cc1be 21/45: Use `unwind-protect' for :after-exit, Oleh Krehel, 2015/04/16
- [elpa] master 986226f 18/45: Simplify `keyboard-quit', Oleh Krehel, 2015/04/16
- [elpa] master 51e7753 19/45: Alias :post to :before-exit, and add :after-exit, Oleh Krehel, 2015/04/16
- [elpa] master 3d7d8c7 20/45: Add basic error handling, Oleh Krehel, 2015/04/16