aboutsummaryrefslogtreecommitdiff
path: root/compat-macs.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-04 12:22:22 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-04 12:22:22 +0100
commit7aa705b65e9978a708db69aedb8059067808df91 (patch)
tree4093526ae69b441ef87e647c39163bee3cccd368 /compat-macs.el
parentdab2ec091d51bb0220453f1a3d28664f4d3ccd92 (diff)
Require features at compile time
Diffstat (limited to 'compat-macs.el')
-rw-r--r--compat-macs.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/compat-macs.el b/compat-macs.el
index f778703..4dc476d 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -34,7 +34,7 @@
(declare (indent 1))
(if feature
;; See https://nullprogram.com/blog/2018/02/22/:
- `(eval-after-load ,feature `(funcall ',(lambda () ,body)))
+ `(eval-after-load ',feature `(funcall ',(lambda () ,body)))
body))
(defun compat--generate (name def-fn install-fn check-fn attr)
@@ -91,6 +91,9 @@ ignored:
nil)
(`(when (and ,(if cond cond t)
,(funcall check-fn)))))))
+ (when feature
+ (unless (require feature nil t)
+ (setq feature nil)))
(when (and (plist-get attr :realname)
(string= name (plist-get attr :realname)))
(error "%S: Name is equal to realname" name))