Function: treemacs-COLLAPSE-action

treemacs-COLLAPSE-action is an interactive and byte-compiled function defined in treemacs-interface.el.

Signature

(treemacs-COLLAPSE-action &optional ARG)

Documentation

Run the appropriate COLLAPSE action for the current button.

In the default configuration this usually means to close the content of the currently selected node. A potential prefix ARG is passed on to the executed action, if possible.

This function's exact configuration is stored in treemacs-COLLAPSE-actions-config.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-interface.el
(defun treemacs-COLLAPSE-action (&optional arg)
  "Run the appropriate COLLAPSE action for the current button.

In the default configuration this usually means to close the content of the
currently selected node.  A potential prefix ARG is passed on to the executed
action, if possible.

This function's exact configuration is stored in
`treemacs-COLLAPSE-actions-config'."
  (interactive "P")
  (-when-let (state (treemacs--prop-at-point :state))
    (--if-let (cdr (assq state treemacs-COLLAPSE-actions-config))
      (progn
        (funcall it arg)
        (treemacs--evade-image))
      (treemacs-pulse-on-failure "No COLLAPSE action defined for node of type %s."
        (propertize (format "%s" state) 'face 'font-lock-type-face)))))