Function: treemacs-resort
treemacs-resort is an interactive and byte-compiled function defined
in treemacs-interface.el.
Signature
(treemacs-resort &optional ARG)
Documentation
Select a new permanent value for treemacs-sorting and refresh.
With a single prefix ARG use the new sort value to *temporarily* resort the
(closest) directory at point.
With a double prefix ARG use the new sort value to *temporarily* resort the
entire treemacs view.
Temporary sorting will only stick around until the next refresh, either manual
or automatic via treemacs-filewatch-mode(var)/treemacs-filewatch-mode(fun).
Instead of calling this with a prefix arg you can also directly call
treemacs-temp-resort-current-dir and treemacs-temp-resort-root.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-interface.el
(defun treemacs-resort (&optional arg)
"Select a new permanent value for `treemacs-sorting' and refresh.
With a single prefix ARG use the new sort value to *temporarily* resort the
\(closest\) directory at point.
With a double prefix ARG use the new sort value to *temporarily* resort the
entire treemacs view.
Temporary sorting will only stick around until the next refresh, either manual
or automatic via `treemacs-filewatch-mode'.
Instead of calling this with a prefix arg you can also directly call
`treemacs-temp-resort-current-dir' and `treemacs-temp-resort-root'."
(interactive "P")
(pcase arg
;; Resort current dir only
(`(4)
(treemacs-temp-resort-current-dir))
;; Temporarily resort everything
(`(16)
(treemacs-temp-resort-root))
;; Set new permanent value
(_
(-let (((sort-name . sort-value) (treemacs--sort-value-selection)))
(setq treemacs-sorting sort-value)
(treemacs-without-messages (treemacs-refresh))
(treemacs-log "Sorting method changed to '%s'."
(propertize sort-name 'face 'font-lock-type-face)))))
(treemacs--evade-image))