(107 . hydra-error/previous-error)
(106 . hydra-error/next-error)
(104 . hydra-error/first-error)
- (7 . hydra-keyboard-quit)
(kp-subtract . hydra--negative-argument)
(kp-9 . hydra--digit-argument)
(kp-8 . hydra--digit-argument)
(97 . hydra-toggle/abbrev-mode-and-exit)
(102 . hydra-toggle/auto-fill-mode-and-exit)
(116 . hydra-toggle/toggle-truncate-lines-and-exit)
- (7 . hydra-keyboard-quit)
(kp-subtract . hydra--negative-argument)
(kp-9 . hydra--digit-argument)
(kp-8 . hydra--digit-argument)
(quote (keymap (113 . hydra-vi/nil)
(107 . hydra-vi/previous-line)
(106 . hydra-vi/next-line)
- (7 . hydra-vi/hydra-keyboard-quit-and-exit)
(kp-subtract . hydra--negative-argument)
(kp-9 . hydra--digit-argument)
(kp-8 . hydra--digit-argument)
(48 . hydra--digit-argument)
(45 . hydra--negative-argument)
(21 . hydra--universal-argument))))
- (defun hydra-vi/hydra-keyboard-quit-and-exit nil
- "Create a hydra with no body and the heads:
-
-\"\a\": `hydra-keyboard-quit',
-\"j\": `next-line',
-\"k\": `previous-line',
-\"q\": `nil'
-
-The body can be accessed via `hydra-vi/body'.
-
-Call the head: `hydra-keyboard-quit'."
- (interactive)
- (hydra-default-pre)
- (set-cursor-color "#e52b50")
- (hydra-keyboard-quit)
- (call-interactively
- (function hydra-keyboard-quit)))
(defun hydra-vi/next-line nil
"Create a hydra with no body and the heads:
-\"\a\": `hydra-keyboard-quit',
\"j\": `next-line',
\"k\": `previous-line',
\"q\": `nil'
(defun hydra-vi/previous-line nil
"Create a hydra with no body and the heads:
-\"\a\": `hydra-keyboard-quit',
\"j\": `next-line',
\"k\": `previous-line',
\"q\": `nil'
(defun hydra-vi/nil nil
"Create a hydra with no body and the heads:
-\"\a\": `hydra-keyboard-quit',
\"j\": `next-line',
\"k\": `previous-line',
\"q\": `nil'
(defun hydra-vi/body nil
"Create a hydra with no body and the heads:
-\"\a\": `hydra-keyboard-quit',
\"j\": `next-line',
\"k\": `previous-line',
\"q\": `nil'
(defvar hydra-zoom/keymap nil
"Keymap for hydra-zoom.")
(quote (keymap (114 . hydra-zoom/lambda-r)
- (7 . hydra-keyboard-quit)
(kp-subtract . hydra--negative-argument)
(kp-9 . hydra--digit-argument)
(kp-8 . hydra--digit-argument)
(defvar hydra-zoom/keymap nil
"Keymap for hydra-zoom.")
(quote (keymap (114 . hydra-zoom/lambda-r)
- (7 . hydra-keyboard-quit)
(kp-subtract . hydra--negative-argument)
(kp-9 . hydra--digit-argument)
(kp-8 . hydra--digit-argument)
(kbd "C-c aabbaaqaabbaa")))
"jjkkjjaabbaa|"))
(should (string= (hydra-with "|"
- (execute-kbd-macro
- (kbd "C-c aabb C-g aaqaabbaa")))
+ (condition-case nil
+ (execute-kbd-macro
+ (kbd "C-c aabb C-g"))
+ (quit nil))
+ (execute-kbd-macro "aaqaabbaa"))
"jjkkaaqaabbaa|")))
(provide 'hydra-test)
(defun hydra--clearfun ()
"Disable the current Hydra unless `this-command' is a head."
- (if (eq this-command 'handle-switch-frame)
+ (if (memq this-command '(handle-switch-frame
+ keyboard-quit))
(hydra-disable)
(unless (eq this-command
(lookup-key hydra-curr-map (this-command-keys-vector)))
:type 'boolean
:group 'hydra)
-(defcustom hydra-keyboard-quit "\a"
- "This binding will quit an amaranth Hydra.
-It's the only other way to quit it besides though a blue head.
-It's possible to set this to nil.")
-
(defcustom hydra-lv t
"When non-nil, `lv-message' (not `message') will be used to display hints."
:type 'boolean)
(body-post (plist-get body-plist :post))
(body-color (hydra--body-color body)))
(hydra--make-funcall body-post)
- (when hydra-keyboard-quit
- (if body-post
- (setq heads (cons (list hydra-keyboard-quit #'hydra-keyboard-quit nil :exit t)
- heads))
- (define-key keymap hydra-keyboard-quit #'hydra-keyboard-quit)))
(dolist (h heads)
(let ((len (length h)))
(cond ((< len 2)
(lambda (head)
(let ((name (hydra--head-property head :cmd-name)))
(when (and (cadr head)
- (not (eq (cadr head) 'hydra-keyboard-quit))
(or body-key body-map))
(let ((bind (hydra--head-property head :bind body-map))
(final-key