(assistant-render-text, assistant-eval): add :set
authorTeodor Zlatanov <tzz@lifelogs.com>
Sat, 29 May 2004 03:13:54 +0000 (03:13 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Sat, 29 May 2004 03:13:54 +0000 (03:13 +0000)
widget type, which is different because it takes and returns a
list.  Much hilarity ensues.

lisp/ChangeLog
lisp/assistant.el

index 595c93c..5a7ef97 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-29  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * assistant.el (assistant-render-text, assistant-eval): add :set
+       widget type, which is different because it takes and returns a
+       list.  Much hilarity ensues.
+
 2004-05-28  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus-art.el (gnus-button-alist): Fixed regexp for manual links.
index 02b935b..68c6baf 100644 (file)
             (variable (cadr elem))
             (type (assistant-get-variable node variable 'type)))
        (cond
-        ((eq (car-safe type) :set)
+        ((eq (car-safe type) :radio)
          (push
           (apply
            #'widget-create
-           'checklist
+           'radio-button-choice
            :assistant-variable variable
            :assistant-node node
            :value (assistant-get-variable node variable)
                        "node")))
            (cadr type))
           assistant-widgets))
-        ((eq (car-safe type) :radio)
+        ((eq (car-safe type) :set)
          (push
           (apply
            #'widget-create
-           'radio-button-choice
+           'set
            :assistant-variable variable
            :assistant-node node
-           :value (assistant-get-variable node variable)
+           :value (assistant-get-variable node variable nil t)
            :notify (lambda (widget &rest ignore)
                      (assistant-set-variable
                       (widget-get widget :assistant-node)
   (let ((bindings nil))
     (dolist (variable (assistant-get-all-variables))
       (setq variable (cadr variable))
-      (push (list (car variable) (if (eq (nth 3 variable) 'default)
-                                    nil
-                                  (nth 3 variable)))
+      (push (list (car variable) 
+                 (if (eq (nth 3 variable) 'default)
+                     nil
+                   (if (listp (nth 3 variable))
+                       `(list ,@(nth 3 variable))
+                     (nth 3 variable))))
            bindings))
     (eval
      `(let ,bindings