branch: externals/transient
commit 0e35673ef5cfb4ae9ec8047a34d652b2f9986db6
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    No longer use static-if at top-level
    
    I have found used of `static-if' at the top-level in other packages, but
    most uses are within a top-level form, not as a top-level form.  Using
    `static-if' inside the definition, instead of around two alternative
    definitions, also happens to be what is appropriate here.
---
 lisp/transient.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 238f6f4f5e..099da26aa2 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2460,11 +2460,8 @@ value.  Otherwise return CHILDREN as is."
              (remove-hook 'minibuffer-exit-hook ,exit)))
        ,@body)))
 
-(static-if (>= emacs-major-version 30) ;transient--wrap-command
-    (defun transient--wrap-command ()
-      (cl-assert
-       (>= emacs-major-version 30) nil
-       "Emacs was downgraded, making it necessary to recompile Transient")
+(defun transient--wrap-command ()
+  (static-if (>= emacs-major-version 30)
       (letrec
           ((prefix transient--prefix)
            (suffix this-command)
@@ -2492,9 +2489,11 @@ value.  Otherwise return CHILDREN as is."
                 (advice-remove suffix advice)
                 (oset prefix unwind-suffix nil)))))
         (when (symbolp this-command)
-          (advice-add suffix :around advice '((depth . -99))))))
-
-  (defun transient--wrap-command ()
+          (advice-add suffix :around advice '((depth . -99))))
+        (cl-assert
+         (>= emacs-major-version 30) nil
+         "Emacs was downgraded, making it necessary to recompile Transient"))
+    ;; (< emacs-major-version 30)
     (let* ((prefix transient--prefix)
            (suffix this-command)
            (advice nil)

Reply via email to