Variable: treemacs-buffer-name-function

treemacs-buffer-name-function is a customizable variable defined in treemacs-customization.el.

Value

treemacs-default-buffer-name

Documentation

The function used to create the name of a treemacs buffer.

Value must be a function which takes a single argument - the current scope - and returns the buffer name as a string. By default the scope is going to be the current frame, however with packages like treemacs-persp it is also possible for it to be the current perspective.

In addition, the buffer name will *always* be prefixed with treemacs-buffer-name-prefix, which is necessary to properly recognise treemacs buffers and maintain compatibility with some packages like winum.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-customization.el
(defcustom treemacs-buffer-name-function #'treemacs-default-buffer-name
  "The function used to create the name of a treemacs buffer.

Value must be a function which takes a single argument - the current scope - and
returns the buffer name as a string.  By default the scope is going to be the
current frame, however with packages like `treemacs-persp' it is also possible
for it to be the current perspective.

In addition, the buffer name will *always* be prefixed with
`treemacs-buffer-name-prefix', which is necessary to properly recognise
treemacs buffers and maintain compatibility with some packages like winum."
  :type 'function
  :group 'treemacs)