Function: treemacs-toggle-node-prefer-tag-visit
treemacs-toggle-node-prefer-tag-visit is an interactive and
byte-compiled function defined in treemacs-interface.el.
Signature
(treemacs-toggle-node-prefer-tag-visit &optional ARG)
Documentation
Same as treemacs-toggle-node but will visit a tag node in some conditions.
Tag nodes, despite being expandable sections, will be visited in the following conditions:
* Tags belong to a .py file and the tag section's first child element's label
ends in " definition*". This indicates the section is the parent element in
a nested class/function definition and can be moved to.
* Tags belong to a .org file and the tag section element possesses a
'org-imenu-marker text property. This indicates that the section is a
headline with further org elements below it.
The prefix argument ARG is treated the same way as with treemacs-toggle-node.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-interface.el
(defun treemacs-toggle-node-prefer-tag-visit (&optional arg)
"Same as `treemacs-toggle-node' but will visit a tag node in some conditions.
Tag nodes, despite being expandable sections, will be visited in the following
conditions:
* Tags belong to a .py file and the tag section's first child element's label
ends in \" definition*\". This indicates the section is the parent element in
a nested class/function definition and can be moved to.
* Tags belong to a .org file and the tag section element possesses a
\\='org-imenu-marker text property. This indicates that the section is a
headline with further org elements below it.
The prefix argument ARG is treated the same way as with `treemacs-toggle-node'."
(interactive)
(run-hook-with-args
'treemacs-after-visit-functions
(treemacs-do-for-button-state
:on-root-node-open (treemacs--collapse-root-node btn arg)
:on-root-node-closed (treemacs--expand-root-node btn)
:on-dir-node-open (treemacs--collapse-dir-node btn arg)
:on-dir-node-closed (treemacs--expand-dir-node btn :recursive arg)
:on-file-node-open (treemacs--collapse-file-node btn arg)
:on-file-node-closed (treemacs--expand-file-node btn arg)
:on-tag-node-open (treemacs--visit-or-expand/collapse-tag-node btn arg t)
:on-tag-node-closed (treemacs--visit-or-expand/collapse-tag-node btn arg t)
:on-tag-node-leaf (progn (other-window 1) (treemacs--goto-tag btn))
:on-nil (treemacs-pulse-on-failure "There is nothing to do here."))))