aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-03 15:39:01 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-06 12:23:51 -0700
commit5a50d6a5d6ccb96e75ddf2be317ecb159186575a (patch)
tree45f878c30c21488b5dcbb99055b530c1aa7d8fa6
parent0e477cf3bb462ccb6637a3ccaee6ac78a525649e (diff)
downloadconsfigurator-5a50d6a5d6ccb96e75ddf2be317ecb159186575a.tar.gz
override *CONSFIG* for all calls to MAKE-PROPSPEC within DEFPROPSPEC
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property.lisp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 28687c0..0a5768e 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -190,6 +190,11 @@ see MAP-PROPSPEC-PROPAPPS for how they are used.")
(when indent
(setf (get sym 'indent) indent)))))
+(defmacro with-*host*-*consfig* (&body forms)
+ `(progv `(,(intern "*CONSFIG*"))
+ `(,(propspec-systems (host-propspec *host*)))
+ ,@forms))
+
(defmacro define-dotted-property-macro (name args &aux (whole (gensym)))
"Affix a period to the end of NAME and define a macro expanding into a
propapp calling the original NAME after applying the dotted propapp rules,
@@ -279,9 +284,9 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
(make-host
:hostattrs (hostattrs *host*)
:propspec
- (make-propspec
- :systems nil
- :propspec (cons ',,name args)))))))))))))))
+ (with-*host*-*consfig*
+ (make-propspec
+ :propspec (cons ',,name args))))))))))))))))
(define-condition programmatic-apply-hostattrs (simple-warning) ())
@@ -374,12 +379,12 @@ You can usually use DEFPROPLIST instead of DEFPROPSPEC, which see."
,@(cdr (pop forms))))))
(setf (getf slots :hostattrs)
`(lambda (plist)
- (let ((propspec (preprocess-propspec
- (make-propspec
- :systems (propspec-systems (host-propspec *host*))
- :propspec (destructuring-bind ,lambda
- (getf plist :orig-args)
- ,@forms)))))
+ (let ((propspec (with-*host*-*consfig*
+ (preprocess-propspec
+ (make-propspec
+ :propspec (destructuring-bind ,lambda
+ (getf plist :orig-args)
+ ,@forms))))))
(setf (getf plist :propspec) propspec)
(propappattrs (eval-propspec propspec))))))