aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-22 18:27:03 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-22 18:27:03 +0200
commitbf9f861025805d7e3c01fb1cfea32f02efebb04e (patch)
tree7742017a0846a545ad35b2f333431c07fe3992ce
parent83d899b66f2aa4744498baa6866f3bdec2d238be (diff)
Add kludge for mystery issue involving static-if
It appears that for some users `static-if' expands to nothing if the THEN or ELSE part is a `defalias' form (whichever is used in their case). I got similar reports when using `static-if' like this in other packages, but I was never able to reproduce these issues. Workaround this by placing the `static-if' inside the `defalias'. Another workaround, which appears to work, would be to wrap both THEN and ELSE with `progn'. Closes #5557.
-rw-r--r--lisp/magit-base.el5
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 0c50e72..415b707 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -1030,9 +1030,8 @@ If PROPS is nil, remove all properties."
;;; Emacs Compatibility
-(static-if (fboundp 'member-if) ; Emacs 31.1
- (defalias 'magit--any 'member-if)
- (defalias 'magit--any 'cl-member-if))
+(defalias 'magit--any ; Emacs 31.1 adds member-if
+ (static-if (fboundp 'member-if) #'member-if #'cl-member-if))
;;; Kludges for Emacs Bugs