aboutsummaryrefslogtreecommitdiff
path: root/compat-macs.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-17 01:12:44 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-17 01:35:44 +0100
commit787f31425ba91e2d8fec3c5fc85aa2059282f6f8 (patch)
treeaae95444cc94b467765ad160d58b77bb8e2e1a1b /compat-macs.el
parente38857341e0186bc44e3e7fb524b791566505914 (diff)
Simplify compat-27 struct definitions, add make-decoded-time
Diffstat (limited to 'compat-macs.el')
-rw-r--r--compat-macs.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/compat-macs.el b/compat-macs.el
index 1c71db9..62305ef 100644
--- a/compat-macs.el
+++ b/compat-macs.el
@@ -74,9 +74,7 @@ ARGS is a list of keywords which are looked up and passed to FUN."
(when feature
(when (eq feature 'subr-x)
(error "Feature subr-x must not be specified"))
- ;; If the feature does not exist, treat it as nil. The function will then
- ;; be defined on the toplevel and not in a `with-eval-after-load' block.
- (setq feature (require feature nil t)))
+ (require feature))
(when (if cond
;; If a condition is specified, no version check is performed.
(eval cond t)
@@ -105,7 +103,9 @@ REST are attributes and the function BODY."
(let* ((defname (if (and explicit (fboundp name))
(intern (format "compat--%s" name))
name))
- (def `(,(if (eq type 'macro) 'defmacro 'defun)
+ (def `(,(if (memq '&key arglist)
+ (if (eq type 'macro) 'cl-defmacro 'cl-defun)
+ (if (eq type 'macro) 'defmacro 'defun))
,defname ,arglist
,(compat--format-docstring type name docstring)
,@body)))