Function: treemacs-tag-follow-mode
treemacs-tag-follow-mode is an autoloaded, interactive and
byte-compiled function defined in treemacs-tag-follow-mode.el.
Signature
(treemacs-tag-follow-mode &optional ARG)
Documentation
Toggle treemacs-tag-follow-mode(var)/treemacs-tag-follow-mode(fun).
This is a minor mode. If called interactively, toggle the
Treemacs-Tag-Follow mode mode. If the prefix argument is
positive, enable the mode, and if it is zero or negative, disable
the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable
the mode if ARG is nil, omitted, or is a positive number.
Disable the mode if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=treemacs-tag-follow-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
This acts as more fine-grained alternative to treemacs-follow-mode(var)/treemacs-follow-mode(fun) and will
thus disable treemacs-follow-mode(var)/treemacs-follow-mode(fun) on activation. When enabled treemacs will
focus not only the file of the current buffer, but also the tag at point.
The follow action is attached to Emacs' idle timer and will run
treemacs-tag-follow-delay seconds of idle time. The delay value is not an
integer, meaning it accepts floating point values like 1.5.
Every time a tag is followed a re--scan of the imenu index is forced by
temporarily setting imenu-auto-rescan to t (though a cache is applied as long
as the buffer is unmodified). This is necessary to assure that creation or
deletion of tags does not lead to errors and guarantees an always up-to-date tag
view.
Note that in order to move to a tag in treemacs the treemacs buffer's window needs to be temporarily selected, which will reset blink-cursor-mode's timer if it is enabled. This will result in the cursor blinking seemingly pausing for a short time and giving the appearance of the tag follow action lasting much longer than it really does.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-tag-follow-mode.el
;;;###autoload
(define-minor-mode treemacs-tag-follow-mode
"Toggle `treemacs-tag-follow-mode'.
This acts as more fine-grained alternative to `treemacs-follow-mode' and will
thus disable `treemacs-follow-mode' on activation. When enabled treemacs will
focus not only the file of the current buffer, but also the tag at point.
The follow action is attached to Emacs' idle timer and will run
`treemacs-tag-follow-delay' seconds of idle time. The delay value is not an
integer, meaning it accepts floating point values like 1.5.
Every time a tag is followed a re--scan of the imenu index is forced by
temporarily setting `imenu-auto-rescan' to t (though a cache is applied as long
as the buffer is unmodified). This is necessary to assure that creation or
deletion of tags does not lead to errors and guarantees an always up-to-date tag
view.
Note that in order to move to a tag in treemacs the treemacs buffer's window
needs to be temporarily selected, which will reset blink-cursor-mode's timer if
it is enabled. This will result in the cursor blinking seemingly pausing for a
short time and giving the appearance of the tag follow action lasting much
longer than it really does."
:init-value nil
:global t
:lighter nil
:group 'treemacs
(if treemacs-tag-follow-mode
(treemacs--setup-tag-follow-mode)
(treemacs--tear-down-tag-follow-mode)))