Fix wrong-type-argument: treemacs-workspace error
Caused by changes upstream.
This commit is contained in:
parent
b100fe332b
commit
519330fcb1
1 changed files with 15 additions and 12 deletions
|
@ -3,20 +3,23 @@
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +treemacs/toggle ()
|
(defun +treemacs/toggle ()
|
||||||
"Initialize or toggle treemacs.
|
"Initialize or toggle treemacs.
|
||||||
|
|
||||||
* If the treemacs window is visible hide it.
|
* If the treemacs window is visible hide it.
|
||||||
* If a treemacs buffer exists, but is not visible show it.
|
* If a treemacs buffer exists, but is not visible show it.
|
||||||
* If no treemacs buffer exists for the current frame create and show it.
|
* If no treemacs buffer exists for the current frame create and show it.
|
||||||
* If the workspace is empty additionally ask for the root path of the first
|
* If the workspace is empty, add the current project to it automatically."
|
||||||
project to add."
|
|
||||||
(interactive)
|
(interactive)
|
||||||
(require 'treemacs)
|
(require 'treemacs)
|
||||||
(pcase (treemacs-current-visibility)
|
(let ((origin-buffer (current-buffer)))
|
||||||
(`visible (delete-window (treemacs-get-local-window)))
|
(cl-letf (((symbol-function 'treemacs-workspace->is-empty?)
|
||||||
(`exists (treemacs-select-window))
|
(symbol-function 'ignore)))
|
||||||
(`none
|
(treemacs--init))
|
||||||
(let ((project-root (doom-project-root 'nocache)))
|
;;
|
||||||
(when project-root
|
(treemacs-do-add-project-to-workspace
|
||||||
(unless (treemacs--find-project-for-path project-root)
|
(treemacs--canonical-path (doom-project-root 'nocache))
|
||||||
(treemacs-add-project-at (treemacs--canonical-path project-root)
|
(doom-project-name 'nocache))
|
||||||
(doom-project-name 'nocache))))
|
;;
|
||||||
(treemacs--init project-root)))))
|
(setq treemacs--ready-to-follow t)
|
||||||
|
(when (or treemacs-follow-after-init treemacs-follow-mode)
|
||||||
|
(with-current-buffer origin-buffer
|
||||||
|
(treemacs--follow)))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue