;; 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