Function: treemacs--reentry

treemacs--reentry is a byte-compiled function defined in treemacs-rendering.el.

Signature

(treemacs--reentry PATH &optional GIT-FUTURE FLATTEN-FUTURE)

Documentation

Reopen dirs below PATH.

GIT-FUTURE and FLATTEN-FUTURE are passed through from the previous branch build.

PATH: Node Path GIT-INFO: Pfuture | Map<String, String>

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-rendering.el
(defun treemacs--reentry (path &optional git-future flatten-future)
  "Reopen dirs below PATH.
GIT-FUTURE and FLATTEN-FUTURE are passed through from the previous branch build.

PATH: Node Path
GIT-INFO: Pfuture | Map<String, String>"
  (-when-let* ((dom-node (treemacs-find-in-dom path))
               (reopen-list (treemacs-dom-node->reentry-nodes dom-node)))
    ;; get rid of the reentry-remnant so it wont pollute the actual dom
    (setf (treemacs-dom-node->reentry-nodes dom-node) nil)
    (dolist (to-reopen-dom-node reopen-list)
      ;; the dom-node in the reentry-remnant and the one currently in the dom
      ;; are different, we need to make sure the latter is present, otherwise
      ;; the file has since been deleted
      (let* ((reopen-path (treemacs-dom-node->key to-reopen-dom-node))
             (actual-dom-node (treemacs-find-in-dom reopen-path)))
        (when (and actual-dom-node
                   (treemacs--should-reenter? reopen-path))
          ;; move the next level of the reentry-remnant to the new reopened dom
          ;; so the process can continue
          (setf (treemacs-dom-node->reentry-nodes actual-dom-node)
                (treemacs-dom-node->reentry-nodes to-reopen-dom-node))
          (treemacs--reopen-node
           (treemacs-goto-node reopen-path)
           git-future
           flatten-future))))))