summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-10-15 22:15:53 +0200
committerUlrich Müller <ulm@gentoo.org>2023-10-15 22:15:53 +0200
commit393f84bb3e0bb305d0ccc0f5511db903112676ed (patch)
treed753dbebd73ba7c221b8d5cd5ba6727dc141d31e /ebuild-mode.el
parentUpdate parent of glep custom group (diff)
downloadebuild-mode-393f84bb3e0bb305d0ccc0f5511db903112676ed.tar.gz
ebuild-mode-393f84bb3e0bb305d0ccc0f5511db903112676ed.tar.bz2
ebuild-mode-393f84bb3e0bb305d0ccc0f5511db903112676ed.zip
Yet another fix for the defadvice warning
* ebuild-mode.el (static-if): New macro, taken from APEL. (sh-must-be-shell-mode): Use it. This should finally fix the byte-compile warning for defadvice in Emacs 30. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r--ebuild-mode.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el
index 5d4f38b..05fb011 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -921,7 +921,17 @@ in a Gentoo profile."
["Insert package.mask tag line" ebuild-mode-insert-tag-line]
["Customize ebuild-mode" (customize-group 'ebuild)]))
-(if (eval-when-compile (fboundp 'sh-must-be-shell-mode))
+
+(eval-when-compile
+ (unless (fboundp 'static-if)
+ (defmacro static-if (cond then &rest else) ; from APEL
+ "Like `if', but evaluate COND at compile time."
+ (if (eval cond)
+ then
+ `(progn ,@else)))
+ ))
+
+(static-if (fboundp 'sh-must-be-shell-mode)
;; make TAB key work
(defadvice sh-must-be-shell-mode
(around ebuild-mode-sh-must-be-shell-mode activate)