]> code.delx.au - gnu-emacs/blobdiff - lisp/tree-widget.el
* term/rxvt.el (rxvt-register-default-colors): Add support for 88
[gnu-emacs] / lisp / tree-widget.el
index 049999a7b88809f5041e3e40bf408ae2598bf587..d29e224f549b9bce9e6c1964e14ef8d1194c6495 100644 (file)
@@ -647,14 +647,17 @@ This hook should be local in the buffer setup to display widgets.")
           (when (and (not args) xpandr)
             (setq args (mapcar 'widget-convert (funcall xpandr tree)))
             (widget-put tree :args args))
+          ;; Defer the node widget creation after icon creation.
+          (widget-put tree :node (widget-convert node))
           ;; Create the icon widget for the expanded tree.
           (push (widget-create-child-and-convert
                  tree (widget-get tree (if args :open-icon :empty-icon))
-                 ;; At this point the node widget isn't yet created.
-                 :node (setq node (widget-convert node)))
+                 ;; Pass the node widget to child.
+                 :node (widget-get tree :node))
                 buttons)
           ;; Create the tree node widget.
-          (push (widget-create-child tree node) children)
+          (push (widget-create-child tree (widget-get tree :node))
+                children)
           ;; Update the icon :node with the created node widget.
           (widget-put (car buttons) :node (car children))
           ;; Create the tree children.
@@ -696,14 +699,17 @@ This hook should be local in the buffer setup to display widgets.")
               ;; Update the icon :node with the created node widget.
               (widget-put (car buttons) :node (car children)))))
 ;;;; Collapsed node.
+      ;; Defer the node widget creation after icon creation.
+      (widget-put tree :node (widget-convert node))
       ;; Create the icon widget for the collapsed tree.
       (push (widget-create-child-and-convert
              tree (widget-get tree :close-icon)
-             ;; At this point the node widget isn't yet created.
-             :node (setq node (widget-convert node)))
+             ;; Pass the node widget to child.
+             :node (widget-get tree :node))
             buttons)
       ;; Create the tree node widget.
-      (push (widget-create-child tree node) children)
+      (push (widget-create-child tree (widget-get tree :node))
+            children)
       ;; Update the icon :node with the created node widget.
       (widget-put (car buttons) :node (car children)))
     ;; Save widget children and buttons.  The tree-widget :node child