aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-06 10:40:56 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-06 10:40:56 -0700
commitc2f2b29a532869f83128ee16635016a7bf474536 (patch)
tree5a2c135d7b1177fa9d15e67c014680afea24806e /src/property.lisp
parentfbe649d0c52e31e6327c5263608c00e7e0743351 (diff)
downloadconsfigurator-c2f2b29a532869f83128ee16635016a7bf474536.tar.gz
DEFPROPLIST/SPEC: don't always warn about programmatic application
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/property.lisp b/src/property.lisp
index e9d5b4f..6b8dbb1 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -268,7 +268,8 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
(with-gensyms (name body declarations)
`(defmacro ,mname (,name ,typev ,lambdav &body ,body)
,@(and mdocstring `(,mdocstring))
- (let ((,slotsv (list :type ,typev :lambda `',,lambdav)))
+ (let ((programmatic-warning t)
+ (,slotsv (list :type ,typev :lambda `',,lambdav)))
(multiple-value-bind (,formsv ,declarations)
(parse-body ,body :documentation t)
(when (> (length ,declarations) 1)
@@ -294,7 +295,8 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
;; Properties with :HOSTATTRS subroutines which set
;; new hostattrs should not be used programmatically
;; in this way, so issue a warning.
- ,@(and (getf ,slotsv :hostattrs)
+ ,@(and programmatic-warning
+ (getf ,slotsv :hostattrs)
`((warn 'programmatic-apply-hostattrs
:property ',,name)))
(consfigure (cons ',,name args)))))))))))))
@@ -401,6 +403,8 @@ You can usually use DEFPROPLIST instead of DEFPROPSPEC, which see."
,@(ordinary-ll-variable-names
lambda :include-supplied-p t)))))
,@(cdr (pop forms))))))
+ (unless (getf slots :hostattrs)
+ (setq programmatic-warning nil))
(setf (getf slots :hostattrs)
`(lambda (plist)
,@(cddr (getf slots :hostattrs))