Variable: treemacs-project-follow-mode-hook

treemacs-project-follow-mode-hook is a customizable variable defined in treemacs-project-follow-mode.el.

Value

nil

Documentation

Hook run after entering or leaving treemacs-project-follow-mode(var)/treemacs-project-follow-mode(fun).

No problems result if this variable is not bound. add-hook automatically binds it. (This is true for all hook variables.)

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-project-follow-mode.el
;;;###autoload
(define-minor-mode treemacs-project-follow-mode
  "Toggle `treemacs-only-current-project-mode'.

This is a minor mode meant for those who do not care about treemacs' workspace
features, or its preference to work with multiple projects simultaneously.  When
enabled it will function as an automated version of
`treemacs-display-current-project-exclusively', making sure that, after a small
idle delay, the current project, and *only* the current project, is displayed in
treemacs.

The project detection is based on the current buffer, and will try to determine
the project using the following methods, in the order they are listed:

- the current projectile.el project, if `treemacs-projectile' is installed
- the current project.el project
- the current `default-directory'

The update will only happen when treemacs is in the foreground, meaning a
treemacs window must exist in the current scope.

This mode requires at least Emacs version 27 since it relies on
`window-buffer-change-functions' and `window-selection-change-functions'."
  :init-value nil
  :global     t
  :lighter    nil
  :group      'treemacs
  (if treemacs-project-follow-mode
      (progn
        (unless (and (boundp 'window-buffer-change-functions)
                     (boundp 'window-selection-change-functions))
          (user-error "%s %s"
                      "Project-Follow-Mode is only available in Emacs"
                      "versions that support `window-buffer-change-functions'"))
        (treemacs--setup-project-follow-mode))
    (treemacs--tear-down-project-follow-mode)))