makunbound when +unbound-slot+ is passed to default setter for slot attributes
[clinton/lisp-on-lines.git] / src / display.lisp
index 7de1c63..d04a131 100644 (file)
   (dolist (d activate context)
     (setf context (adjoin-layer (find-description d)
                                context))))
-  
-
 
+(defun funcall-with-attribute-context (attribute thunk)
+  (funcall-with-layer-context 
+   (modify-layer-context (current-layer-context) 
+                        :activate (attribute-active-descriptions attribute)
+                        :deactivate (attribute-inactive-descriptions attribute))
+   thunk))
 
+(defmacro with-attribute-context ((attribute) &body body)
+  `(funcall-with-attribute-context ,attribute (lambda () ,@body)))
+  
+  
 (defun display (display object &rest args &key deactivate activate &allow-other-keys)
 
   (funcall-with-layer-context 
@@ -31,7 +39,7 @@
      (apply #'display-using-description (description-of object) display object args))))
 
 (define-layered-method display-using-description 
-  :around (description display object &rest args)
+  :around ((description standard-description-object) display object &rest args)
   (declare (ignorable args))
 #+nil  (break "Entering DISPLAY for ~A on ~A using ~A" object display description)
   (let ((*display* display))
@@ -43,7 +51,6 @@
 
 
 
-
 (defun display/d (&rest args)
   (apply #'display-using-description args))
 
@@ -74,7 +81,7 @@ OMGWTF! If you didn't do this, it's a bug!" description display object args))
                        (list (first description-spec)
                             (if (eq 'description (second description-spec))
                                     'description
-                                    (defining-description (second description-spec)))))
+                                    (contextl::defining-layer (defining-description (second description-spec))))))
                   ,display-spec
                   ,object-spec &rest args)
                   (declare (ignorable args))