"rep"
:bind nil
:exit nil))))
+ (set
+ (defvar hydra-error/hint nil
+ "Dynamic hint for hydra-error.")
+ (quote
+ (format
+ #("error: [h]: first, [j]: next, [k]: prev, [SPC]: rep."
+ 8 9 (face hydra-face-red)
+ 20 21 (face hydra-face-red)
+ 31 32 (face hydra-face-red)
+ 42 45 (face hydra-face-red)))))
(defun hydra-error/first-error nil
"Create a hydra with a \"M-g\" body and the heads:
(define-key global-map [134217831 107]
(function
hydra-error/previous-error))
- (set
- (defvar hydra-error/hint nil
- "Dynamic hint for hydra-error.")
- (quote
- (format
- #("error: [h]: first, [j]: next, [k]: prev, [SPC]: rep."
- 8 9 (face hydra-face-red)
- 20 21 (face hydra-face-red)
- 31 32 (face hydra-face-red)
- 42 45 (face hydra-face-red)))))
(defun hydra-error/body nil
"Create a hydra with a \"M-g\" body and the heads:
"abbrev"
:exit t)
("q" nil "cancel" :exit t))))
+ (set
+ (defvar hydra-toggle/hint nil
+ "Dynamic hint for hydra-toggle.")
+ (quote
+ (format
+ #("toggle: [t]: truncate, [f]: fill, [a]: abbrev, [q]: cancel."
+ 9 10 (face hydra-face-blue)
+ 24 25 (face hydra-face-blue)
+ 35 36 (face hydra-face-blue)
+ 48 49 (face hydra-face-blue)))))
(defun hydra-toggle/toggle-truncate-lines-and-exit nil
"Create a hydra with no body and the heads:
(interactive)
(hydra-default-pre)
(hydra-keyboard-quit))
- (set
- (defvar hydra-toggle/hint nil
- "Dynamic hint for hydra-toggle.")
- (quote
- (format
- #("toggle: [t]: truncate, [f]: fill, [a]: abbrev, [q]: cancel."
- 9 10 (face hydra-face-blue)
- 24 25 (face hydra-face-blue)
- 35 36 (face hydra-face-blue)
- 48 49 (face hydra-face-blue)))))
(defun hydra-toggle/body nil
"Create a hydra with no body and the heads:
""
:exit nil)
("q" nil "quit" :exit t))))
+ (set
+ (defvar hydra-vi/hint nil
+ "Dynamic hint for hydra-vi.")
+ (quote
+ (format
+ #("vi: j, k, [q]: quit."
+ 4 5 (face hydra-face-amaranth)
+ 7 8 (face hydra-face-amaranth)
+ 11 12 (face hydra-face-teal)))))
(defun hydra-vi/next-line nil
"Create a hydra with no body and the heads:
(hydra-default-pre)
(set-cursor-color "#e52b50")
(hydra-keyboard-quit))
- (set
- (defvar hydra-vi/hint nil
- "Dynamic hint for hydra-vi.")
- (quote
- (format
- #("vi: j, k, [q]: quit."
- 4 5 (face hydra-face-amaranth)
- 7 8 (face hydra-face-amaranth)
- 11 12 (face hydra-face-teal)))))
(defun hydra-vi/body nil
"Create a hydra with no body and the heads:
nil
:bind nil
:exit t))))
+ (set
+ (defvar hydra-zoom/hint nil
+ "Dynamic hint for hydra-zoom.")
+ (quote
+ (format
+ #("zoom: [r 0]: reset."
+ 7 8 (face hydra-face-red)
+ 9 10 (face hydra-face-blue)))))
(defun hydra-zoom/lambda-r nil
"Create a hydra with no body and the heads:
(lambda nil
(interactive)
(text-scale-set 0)))))
- (set
- (defvar hydra-zoom/hint nil
- "Dynamic hint for hydra-zoom.")
- (quote
- (format
- #("zoom: [r 0]: reset."
- 7 8 (face hydra-face-red)
- 9 10 (face hydra-face-blue)))))
(defun hydra-zoom/body nil
"Create a hydra with no body and the heads:
nil
:bind nil
:exit nil))))
+ (set
+ (defvar hydra-zoom/hint nil
+ "Dynamic hint for hydra-zoom.")
+ (quote
+ (format
+ #("zoom: [r 0]: reset."
+ 7 8 (face hydra-face-red)
+ 9 10 (face hydra-face-blue)))))
(defun hydra-zoom/lambda-r nil
"Create a hydra with no body and the heads:
(lambda nil
(interactive)
(text-scale-set 0)))))
- (set
- (defvar hydra-zoom/hint nil
- "Dynamic hint for hydra-zoom.")
- (quote
- (format
- #("zoom: [r 0]: reset."
- 7 8 (face hydra-face-red)
- 9 10 (face hydra-face-blue)))))
(defun hydra-zoom/body nil
"Create a hydra with no body and the heads:
;; Author: Oleh Krehel <ohwoeowho@gmail.com>
;; Maintainer: Oleh Krehel <ohwoeowho@gmail.com>
;; URL: https://github.com/abo-abo/hydra
-;; Version: 0.13.0
+;; Version: 0.13.1
;; Keywords: bindings
;; Package-Requires: ((cl-lib "0.5"))
(teal 'hydra-face-teal)
(t (error "Unknown color for %S" head))))))
-(defun hydra-fontify-head-greyscale (head body)
+(defun hydra-fontify-head-greyscale (head _body)
"Produce a pretty string from HEAD and BODY.
HEAD's binding is returned as a string wrapped with [] or {}."
(format
BODY-PRE is added to the start of the wrapper.
BODY-BEFORE-EXIT will be called before the hydra quits.
BODY-AFTER-EXIT is added to the end of the wrapper."
- (let ((name (hydra--head-name head name body))
+ (let ((name (hydra--head-name head name))
(cmd (when (car head)
(hydra--make-callable
(cadr head))))
`(when (and ,sym (symbolp ,sym))
(setq ,sym `(funcall #',,sym))))
-(defun hydra--head-name (h name body)
- "Return the symbol for head H of hydra with NAME and BODY."
+(defun hydra--head-name (h name)
+ "Return the symbol for head H of hydra with NAME."
(let ((str (format "%S/%s" name
(if (symbolp (cadr h))
(cadr h)
(if (eq h-exit 'default)
body-exit
h-exit))))))))))
- (plist-put (cl-cdddr h) :cmd-name (hydra--head-name h name body))
+ (plist-put (cl-cdddr h) :cmd-name (hydra--head-name h name))
(when (null (cadr h)) (plist-put (cl-cdddr h) :exit t)))
(let ((doc (hydra--doc body-key body-name heads))
(heads-nodup (hydra--delete-duplicates heads)))
(cl-remf (cl-cdddr j) :cmd-name)
j))
heads))
+ (set
+ (defvar ,(intern (format "%S/hint" name)) nil
+ ,(format "Dynamic hint for %S." name))
+ ',(hydra--format name body docstring heads))
;; create defuns
,@(mapcar
(lambda (head)
(t
(error "Invalid :bind property `%S' for head %S" bind head)))))))
heads))
- (set
- (defvar ,(intern (format "%S/hint" name)) nil
- ,(format "Dynamic hint for %S." name))
- ',(hydra--format name body docstring heads))
,(hydra--make-defun
name body doc '(nil body)
keymap-name