branch: externals/ivy
commit e0b1a6c224afb652d11b315913b8ad0c3ca8ecbc
Author: Basil L. Contovounesios <ba...@contovou.net>
Commit: Basil L. Contovounesios <ba...@contovou.net>

    * swiper.el (static-if): Also add polyfill here.
    
    Otherwise swiper.el does not cleanly compile on its own.
    
    Fixes #3038, fixes #3039.
---
 swiper.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/swiper.el b/swiper.el
index 4cdd2f31ff..f00f08ef47 100644
--- a/swiper.el
+++ b/swiper.el
@@ -38,6 +38,16 @@
 (require 'cl-lib)
 (require 'ivy)
 
+(eval-when-compile
+  (unless (fboundp 'static-if)
+    (defmacro static-if (condition then-form &rest else-forms)
+      "Expand to THEN-FORM or ELSE-FORMS based on compile-time CONDITION.
+Polyfill for Emacs 30 `static-if'."
+      (declare (debug (sexp sexp &rest sexp)) (indent 2))
+      (if (eval condition lexical-binding)
+          then-form
+        (macroexp-progn else-forms)))))
+
 (defgroup swiper nil
   "`isearch' with an overview."
   :group 'matching

Reply via email to