Variable: treemacs--collapsed-filewatch-index

treemacs--collapsed-filewatch-index is a variable defined in treemacs-filewatch-mode.el.

Value

#s(hash-table size 100 test equal rehash-size 1.5 rehash-threshold 0.8125 data
	      ())

Documentation

Keeps track of dirs under filewatch due to being collapsed into one.

Collapsed directories require special handling since all directories of a series need to be put under watch so as to be notified when the collapsed structure needs to change, but removing the file watch is not straightforward:

Assume a series of directories are collapsed into one as "/c1/c2/c3/c4" and a new file is created in "/c1/c2". A refresh is started and only "/c1/c2" is collapsed now, c3 and c4 are no longer part of the treemacs view and must be removed from the filewatch list. However the event that triggered the refresh was one of a file being created, so it is not possible to know that c3 and c4 need to stop being watched unless one also knows that they and c2 are under file watch because they have been collapsed.

This is why this hash is used to keep track of collapsed directories under file watch.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-filewatch-mode.el
(defvar treemacs--collapsed-filewatch-index (make-hash-table :size 100 :test #'equal)
  "Keeps track of dirs under filewatch due to being collapsed into one.

Collapsed directories require special handling since all directories of a series
need to be put under watch so as to be notified when the collapsed structure
needs to change, but removing the file watch is not straightforward:

Assume a series of directories are collapsed into one as \"/c1/c2/c3/c4\" and a
new file is created in \"/c1/c2\".  A refresh is started and only \"/c1/c2\" is
collapsed now, c3 and c4 are no longer part of the treemacs view and must be
removed from the filewatch list.  However the event that triggered the refresh
was one of a file being created, so it is not possible to know that c3 and c4
need to stop being watched unless one also knows that they and c2 are under file
watch because they have been collapsed.

This is why this hash is used to keep track of collapsed directories under file
watch.")