aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-04 16:52:53 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-05 17:25:13 -0700
commitb5b11a65664638f1f72d6300eb79661c41965d29 (patch)
treeb164dca884bcf1e6a78b8c4d7bee790444612efa /src/property.lisp
parentc4611b8d420a67ab32e8c7a3d81dcb1104bc96ed (diff)
downloadconsfigurator-b5b11a65664638f1f72d6300eb79661c41965d29.tar.gz
include name of property in programmatic application warning
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/property.lisp b/src/property.lisp
index c6512cd..9816ce8 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -295,16 +295,17 @@ parsing FORMSV and pushing SETPROP keyword argument pairs to plist SLOTSV."
;; new hostattrs should not be used programmatically
;; in this way, so issue a warning.
,@(and (getf ,slotsv :hostattrs)
- '((programmatic-apply-hostattrs)))
+ `((warn 'programmatic-apply-hostattrs
+ :property ',,name)))
(consfigure (cons ',,name args)))))))))))))
-(define-condition programmatic-apply-hostattrs (simple-warning) ())
-
-(defun programmatic-apply-hostattrs ()
- (warn 'programmatic-apply-hostattrs
- :format-control
- "Calling property which has :HOSTATTRS subroutine programmatically.
-Use DEFPROPLIST/DEFPROPSPEC to avoid trouble."))
+(define-condition programmatic-apply-hostattrs (warning)
+ ((property :initarg :property))
+ (:report (lambda (condition stream)
+ (format stream "Calling property ~S,
+which has :HOSTATTRS subroutine, programmatically. Use DEFPROPLIST/DEFPROPSPEC
+to avoid trouble."
+ (slot-value condition 'property)))))
(defmacro ignoring-hostattrs (form)
"Where FORM is a programmatic call to a property which has a :HOSTATTRS