summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2026-04-22 18:36:26 +0200
committerJonas Bernoulli <jonas@bernoul.li>2026-04-22 18:36:26 +0200
commitb03d9dc0b6bf1800d49a8c249c4f1f161d64028c (patch)
treefbc0c614a0b1fc0b946432dca0d4a7f3e58b2eec
parent9a9776c010a50169aa8f3aac459556c94b616758 (diff)
Add kludge for mystery issue involving static-if and defalias
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' more than once, last in https://github.com/magit/magit/issues/5557, and while I was never able to reproduce, I concluded that these report are credible.
-rw-r--r--lisp/transient.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/transient.el b/lisp/transient.el
index 25bc8f1..c4091a3 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -5194,7 +5194,8 @@ apply the face `transient-unreachable' to the complete string."
(oref group suffixes))))))
(static-if (fboundp 'string-pixel-width) ; since Emacs 29.1
- (defalias 'transient--string-pixel-width #'string-pixel-width)
+ (progn ; See https://github.com/magit/magit/issues/5557.
+ (defalias 'transient--string-pixel-width #'string-pixel-width))
;; c22b735f0c6 and 61c254cafc9 cannot be backported. Some later
;; commits could be ported, but users should instead update Emacs.
(defun transient--string-pixel-width (string)