emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/hydra 1ab885785e 29/35: hydra.el (hydra--make-defun): A


From: ELPA Syncer
Subject: [elpa] externals/hydra 1ab885785e 29/35: hydra.el (hydra--make-defun): Allow to speficy :idle property for a head
Date: Tue, 25 Oct 2022 22:59:06 -0400 (EDT)

branch: externals/hydra
commit 1ab885785ee4103efd96cd635cebde1474e8f50e
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    hydra.el (hydra--make-defun): Allow to speficy :idle property for a head
    
    For example, if we want to bind a head to `universal-argument', we
    likely don't want to see the whole hint just yet.
    
    (defhydra hydra-k (:exit t :idle 0.8)
      "Misc command launcher."
      ("f" universal-argument "C-u" :exit nil :idle 0.8)
      ("d" define-word-at-point "def"))
---
 hydra.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hydra.el b/hydra.el
index f13f1451c8..eb8c575c17 100644
--- a/hydra.el
+++ b/hydra.el
@@ -910,7 +910,8 @@ BODY-AFTER-EXIT is added to the end of the wrapper."
                      ,(hydra--call-interactively cmd (cadr head))
                    ((quit error)
                     (message (error-message-string err)))))
-             ,(if (and body-idle (eq (cadr head) 'body))
+             ,(if (or (and body-idle (eq (cadr head) 'body))
+                      (setq body-idle (plist-get (nthcdr 3 head) :idle)))
                   `(hydra-idle-message ,body-idle ,hint ',name)
                 `(hydra-show-hint ,hint ',name))
              (hydra-set-transient-map



reply via email to

[Prev in Thread] Current Thread [Next in Thread]