Function: treemacs-safe-button-get

treemacs-safe-button-get is a macro defined in treemacs-macros.el.

Signature

(treemacs-safe-button-get BUTTON &rest PROPERTIES)

Documentation

Safely extract BUTTON's PROPERTIES.

Using button-get on a button located in a buffer that is not the current buffer does not work, so this function will run the property extraction from inside BUTTON's buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-macros.el
(defmacro treemacs-safe-button-get (button &rest properties)
  "Safely extract BUTTON's PROPERTIES.

Using `button-get' on a button located in a buffer that is not the current
buffer does not work, so this function will run the property extraction from
inside BUTTON's buffer."
  `(with-current-buffer (marker-buffer ,button)
     ,(if (= 1 (length properties))
           `(treemacs-button-get ,button ,(car properties))
         `(--map (treemacs-button-get ,button it) ,properties))))