Fix missing `without-special-symbol-access' in `funcall-with-attribute-context'
[clinton/lisp-on-lines.git] / src / standard-descriptions / inline.lisp
dissimilarity index 67%
index 9d05b65..3f349dd 100644 (file)
@@ -1,16 +1,30 @@
-(in-package :lisp-on-lines)
-
-(define-description inline ())
-
-(define-description t ()
-  ((identity :label nil)
-   (active-attributes :value (identity)))
-  (:in-description inline))
-
-(define-display :in-description inline ((description t))
-  (format *display* "~{~A ~}" 
-         (mapcar 
-          (lambda (attribute)
-            (with-output-to-string (*display*)
-              (display-attribute *object* attribute)))
-          (attributes description))))
+(in-package :lisp-on-lines)
+
+(define-description inline ())
+
+(define-description t ()
+  ((identity :label nil)
+   (active-attributes :value '(identity))
+   (attribute-delimiter :value ", ")
+   (label-formatter :value (curry #'format nil "~A: "))
+   (value-formatter :value (curry #'format nil "~A")))
+  (:in-description inline))
+
+(define-layered-class standard-attribute
+  :in-layer #.(defining-description 'inline)
+  ()
+  ())
+
+(defun display-inline (object &rest args)
+  (with-active-descriptions (inline)
+    (apply #'display *display* object args)))
+
+(defun display-inline-attribute (attribute value)
+  (if (ignore-errors (lol::attribute-active-attributes attribute))
+      (handler-case (display-inline value :attributes (lol::attribute-active-attributes attribute))
+       (error ()
+         (display-inline value)))
+      (display-inline value)))
+
+
+