Function: treemacs--on-buffer-kill

treemacs--on-buffer-kill is a byte-compiled function defined in treemacs-scope.el.

Signature

(treemacs--on-buffer-kill)

Documentation

Cleanup to run when a treemacs buffer is killed.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-scope.el
(defun treemacs--on-buffer-kill ()
  "Cleanup to run when a treemacs buffer is killed."
  (when (eq t treemacs--in-this-buffer)
    ;; stop watch must come first since we need a reference to the killed buffer
    ;; to remove it from the filewatch list
    (treemacs--stop-filewatch-for-current-buffer)
    ;; not present for extension buffers
    (-when-let (shelf (treemacs-current-scope-shelf))
      (setf (treemacs-scope-shelf->buffer shelf) nil))))