Function: treemacs--on-file-deletion
treemacs--on-file-deletion is a byte-compiled function defined in
treemacs-core-utils.el.
Signature
(treemacs--on-file-deletion PATH &optional NO-BUFFER-DELETE)
Documentation
Cleanup to run when treemacs file at PATH was deleted.
Do not try to delete buffers for PATH when NO-BUFFER-DELETE is non-nil. This is necessary since interacting with magit can cause file delete events for files being edited to trigger.
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-core-utils.el
(define-inline treemacs--on-file-deletion (path &optional no-buffer-delete)
"Cleanup to run when treemacs file at PATH was deleted.
Do not try to delete buffers for PATH when NO-BUFFER-DELETE is non-nil. This is
necessary since interacting with magit can cause file delete events for files
being edited to trigger."
(inline-letevals (path no-buffer-delete)
(inline-quote
(progn
(treemacs--delete-annotation ,path)
(unless ,no-buffer-delete (treemacs--kill-buffers-after-deletion ,path t))
(treemacs--stop-watching ,path t)
;; filewatch mode needs the node's information to be in the dom
(unless (with-no-warnings treemacs-filewatch-mode)
(treemacs-run-in-every-buffer
(treemacs-on-collapse ,path t)))
(when (treemacs--non-simple-git-mode-enabled)
(treemacs-run-in-every-buffer
(treemacs-update-single-file-git-state (treemacs--parent-dir ,path))))))))