       (-> form first meta)))
 
 (defn xpand-fn
-  [head form src-map fn-meta path parent-path]
-  (xpand-fn-form head
-                 (xpand-all form
-                            src-map
-                            fn-meta
-                            path
-                            path)
-                 path
-                 (mk-tree-template src-map
-                                   (get-form-meta-somehow form)
-                                   fn-meta
-                                   path
-                                   parent-path)))
+  [head form src-map fn-meta path path-chain]
+  (let [path-chain' (conj path-chain path)]
+    (xpand-fn-form head
+                   (xpand-all form
+                              src-map
+                              fn-meta
+                              path
+                              path-chain')
+                   (mk-tree-template src-map
+                                     (get-form-meta-somehow form)
+                                     fn-meta
+                                     path-chain'))))
 
 (defn xpand-macro
-  [head form src-map fn-meta path parent-path]
+  [head form src-map fn-meta path path-chain]
   (let [xform (with-meta (macroexpand form) (meta form))] ;; TODO be sure this is doing something
-    (xpand-macro-form head
-                      (xpand-form xform
-                                  src-map
-                                  fn-meta
-                                  path
-                                  path)
-                      path
-                      (mk-tree-template src-map
-                                        (get-form-meta-somehow form)
-                                        fn-meta
-                                        path
-                                        parent-path
-                                        :macro? true))))
+    (let [path' (conj path :macro)
+          path-chain' (conj path-chain path)]
+      (xpand-macro-form head
+                        (xpand-form xform
+                                    src-map
+                                    fn-meta
+                                    path'
+                                    path-chain')
+                        (mk-tree-template src-map
+                                          (get-form-meta-somehow form)
+                                          fn-meta
+                                          path-chain'
+                                          :macro? true)))))
 
 (defn xpand-if
-  [form src-map fn-meta path parent-path]
+  [form src-map fn-meta path path-chain]
   (xpand-if-form (xpand-all form
                             src-map
                             fn-meta
                             path
-                            path)
-                 path
+                            path-chain)
                  (mk-tree-template src-map
                                    (get-form-meta-somehow form)
                                    fn-meta
-                                   path
-                                   parent-path)))
+                                   path-chain)))
 
 (defn xpand-let
-  [form src-map fn-meta path parent-path]
-  (xpand-let-form (xpand-all form
-                             src-map
-                             fn-meta
-                             path
-                             path)
-                  path
-                  (mk-tree-template src-map
-                                    (get-form-meta-somehow form)
-                                    fn-meta
-                                    path
-                                    parent-path)))
+  [form src-map fn-meta path path-chain]
+  (let [path-chain' (conj path-chain path)]
+    (xpand-let-form (xpand-all form
+                               src-map
+                               fn-meta
+                               path
+                               path-chain')
+                    (mk-tree-template src-map
+                                      (get-form-meta-somehow form)
+                                      fn-meta
+                                      path-chain'))))
 
 (defn dot-sym?
   [sym]

      (assoc :children (atom [])
             :inner-path nil)
      atom))

(declare produce-recent-parent-tree-atom!)

(defn get-recent-tree-at-inner-path
  [path recent-trees & {:keys [skip-closed-check]}]

(declare xpand-form)

(defn xpand-all
  [form src-map fn-meta path path-chain]
  (when-not (nil? form)
    (util/back-into form
                    (doall (map-indexed #(xpand-form %2
                                                     src-map
                                                     fn-meta
                                                     (conj path %)
                                                     path-chain)
                                        form)))))

(defn xpand-fn-form
  [head form template]
  (cons (list `tr-fn
              '$$
              `'~template
              (first form))
        (rest form)))

(defn xpand-macro-form
  [head form template]
  (list `tr-macro
        '$$
        `'~template
        (keyword head)
        form))

(defn xpand-let-binds
  [template binds]
  (vec (mapcat (fn [[b v]]
                 `(~b ~v
                      ~'_ (tr-let-bind ~template
                                       ~'$$
                                       ~b
                                       '~b
                                       '~v)))
               (partition 2 binds))))

(defn xpand-let-form
  [[_ binds & frms] template]
  `(tr-let-ret ~'$$
               '~template
               (let ~(xpand-let-binds template
                                      binds)
                 ~@frms)))

(defn xpand-if-form
  [[_ test then else] template]
  (let [template' (assoc template
                         :test-form `'~test)]
    `(tr-if-ret ~'$$
                '~template'
                (if (tr-if-test ~template'
                                ~'$$
                                ~test)
                  (tr-if-branch ~template'
                                ~'$$
                                true
                                ~then)
                  ~(when-not (nil? else)
                     `(tr-if-branch ~template'
                                    ~'$$
                                    false
                                    ~else))))))

(defn get-form-meta-somehow
  [form]
