Function: treemacs-with-current-button

treemacs-with-current-button is a macro defined in treemacs-macros.el.

Signature

(treemacs-with-current-button ERROR-MSG &rest BODY)

Documentation

Execute an action with the current button bound to 'current-btn'.

Log ERROR-MSG if no button is selected, otherwise run BODY.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-macros.el
(defmacro treemacs-with-current-button (error-msg &rest body)
  "Execute an action with the current button bound to \\='current-btn'.
Log ERROR-MSG if no button is selected, otherwise run BODY."
  (declare (debug (form body)))
  `(-if-let (current-btn (treemacs-current-button))
       (progn ,@body)
     (treemacs-pulse-on-failure ,error-msg)))