Function: treemacs--create-dir-button-strings

treemacs--create-dir-button-strings is a byte-compiled function defined in treemacs-rendering.el.

Signature

(treemacs--create-dir-button-strings PATH PREFIX PARENT DEPTH)

Documentation

Return the text to insert for a directory button for PATH.

PREFIX is a string inserted as indentation. PARENT is the (optional) button under which this one is inserted. DEPTH indicates how deep in the filetree the current button is.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-rendering.el
(define-inline treemacs--create-dir-button-strings (path prefix parent depth)
  "Return the text to insert for a directory button for PATH.
PREFIX is a string inserted as indentation.
PARENT is the (optional) button under which this one is inserted.
DEPTH indicates how deep in the filetree the current button is."
  (inline-letevals (path prefix parent depth)
    (inline-quote
     (let ((dir-name (file-name-nondirectory ,path)))
       (list
        ,prefix
        (treemacs-icon-for-dir dir-name 'closed)
        (propertize (->> dir-name (funcall treemacs-directory-name-transformer))
                    'button '(t)
                    'category 'treemacs-button
                    'help-echo nil
                    'keymap nil
                    :default-face 'treemacs-directory-face
                    :state 'dir-node-closed
                    :path ,path
                    :key ,path
                    :symlink (file-symlink-p ,path)
                    :parent ,parent
                    :depth ,depth))))))