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
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>
-rw-r--r--ChangeLog4
-rw-r--r--ebuild-mode.el12
2 files changed, 15 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d64003..54fe807 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2023-10-15 Ulrich Müller <ulm@gentoo.org>
+ * 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.
+
* glep-mode.el (glep): Change parent group to text, because the wp
group is deprecated since Emacs 26.
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)