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

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

[elpa] externals/hydra d2b921d067 22/35: hydra.el (defhydra): :exit key


From: ELPA Syncer
Subject: [elpa] externals/hydra d2b921d067 22/35: hydra.el (defhydra): :exit key can now also be a sexp
Date: Tue, 25 Oct 2022 22:59:06 -0400 (EDT)

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

    hydra.el (defhydra): :exit key can now also be a sexp
    
    Fixes #361
---
 hydra.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/hydra.el b/hydra.el
index 7287d49edc..2eb79d3801 100644
--- a/hydra.el
+++ b/hydra.el
@@ -915,9 +915,15 @@ BODY-AFTER-EXIT is added to the end of the wrapper."
        (require 'hydra)
        (hydra-default-pre)
        ,@(when body-pre (list body-pre))
-       ,@(if (hydra--head-property head :exit)
-             body-on-exit-t
-           body-on-exit-nil))))
+       ,@(cond ((eq (hydra--head-property head :exit) t)
+                body-on-exit-t)
+               ((eq (hydra--head-property head :exit) nil)
+                body-on-exit-nil)
+               (t
+                `((if ,(hydra--head-property head :exit)
+                      (progn
+                        ,@body-on-exit-t)
+                    ,@body-on-exit-nil)))))))
 
 (defvar hydra-props-alist nil)
 



reply via email to

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