Fix wrong-type-arg: stringp, nocache errors

Fix old usage of doom-project-name and doom-project-root.
This commit is contained in:
Henrik Lissner 2018-09-28 23:47:36 -04:00
parent cae5009925
commit e7fc1d3290
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 8 additions and 7 deletions

View file

@ -46,7 +46,8 @@ they are absolute."
;;;###autoload ;;;###autoload
(defun doom-project-name (&optional dir) (defun doom-project-name (&optional dir)
"Return the name of the current project." "Return the name of the current project."
(let ((project-root (projectile-project-root dir))) (let ((project-root (or (projectile-project-root dir)
(if dir (expand-file-name dir)))))
(if project-root (if project-root
(funcall projectile-project-name-function project-root) (funcall projectile-project-name-function project-root)
"-"))) "-")))

View file

@ -552,8 +552,7 @@ This be hooked to `projectile-after-switch-project-hook'."
(if (+workspace-buffer-list) (if (+workspace-buffer-list)
(let* (persp-p (let* (persp-p
(persp (persp
(let* ((default-directory +workspaces--project-dir) (let ((project-name (doom-project-name +workspaces--project-dir)))
(project-name (doom-project-name 'nocache)))
(or (setq persp-p (+workspace-get project-name t)) (or (setq persp-p (+workspace-get project-name t))
(+workspace-new project-name)))) (+workspace-new project-name))))
(new-name (persp-name persp))) (new-name (persp-name persp)))
@ -569,7 +568,7 @@ This be hooked to `projectile-after-switch-project-hook'."
'success)) 'success))
(with-current-buffer (switch-to-buffer (doom-fallback-buffer)) (with-current-buffer (switch-to-buffer (doom-fallback-buffer))
(setq default-directory +workspaces--project-dir) (setq default-directory +workspaces--project-dir)
(message "Switched to '%s'" (doom-project-name 'nocache))) (message "Switched to '%s'" (doom-project-name +workspaces--project-dir)))
(unless current-prefix-arg (unless current-prefix-arg
(funcall +workspaces-switch-project-function +workspaces--project-dir))) (funcall +workspaces-switch-project-function +workspaces--project-dir)))
(setq +workspaces--project-dir nil)))) (setq +workspaces--project-dir nil))))

View file

@ -9,9 +9,10 @@
(dolist (project (treemacs-workspace->projects (treemacs-current-workspace))) (dolist (project (treemacs-workspace->projects (treemacs-current-workspace)))
(treemacs-do-remove-project-from-workspace project)) (treemacs-do-remove-project-from-workspace project))
(with-current-buffer origin-buffer (with-current-buffer origin-buffer
(treemacs-do-add-project-to-workspace (let ((project-root (or (doom-project-root) default-directory)))
(treemacs--canonical-path (doom-project-root)) (treemacs-do-add-project-to-workspace
(doom-project-name)) (treemacs--canonical-path project-root)
(doom-project-name project-root)))
(setq treemacs--ready-to-follow t) (setq treemacs--ready-to-follow t)
(when (or treemacs-follow-after-init treemacs-follow-mode) (when (or treemacs-follow-after-init treemacs-follow-mode)
(treemacs--follow))))) (treemacs--follow)))))