branch: externals/hydra
commit d2b921d067d7c7ea2f087b4d8edfdc37bcdf4af8
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>

    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