From 8049914e0ed85dd32f79650fa140ea4a6c8d62c9 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 24 Feb 2020 20:46:58 -0500 Subject: [PATCH] Fix #2591: fix project switch hooks not running When :ui workspaces was enabled. --- modules/ui/workspaces/autoload/workspaces.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/ui/workspaces/autoload/workspaces.el b/modules/ui/workspaces/autoload/workspaces.el index 74ee32b89..3175fcf84 100644 --- a/modules/ui/workspaces/autoload/workspaces.el +++ b/modules/ui/workspaces/autoload/workspaces.el @@ -526,6 +526,12 @@ This be hooked to `projectile-after-switch-project-hook'." (when dir (setq +workspaces--project-dir dir)) (when (and persp-mode +workspaces--project-dir) + (with-temp-buffer + ;; Load the project dir-local variables into the switch buffer, so the + ;; action can make use of them + (setq default-directory +workspaces--project-dir) + (hack-dir-local-variables-non-file-buffer) + (run-hooks 'projectile-before-switch-project-hook)) (unwind-protect (if (and (not (null +workspaces-on-switch-project-behavior)) (or (eq +workspaces-on-switch-project-behavior t) @@ -550,6 +556,7 @@ This be hooked to `projectile-after-switch-project-hook'." (+workspace-rename (+workspace-current-name) (doom-project-name +workspaces--project-dir))) (unless current-prefix-arg (funcall +workspaces-switch-project-function +workspaces--project-dir))) + (run-hooks 'projectile-after-switch-project-hook) (setq +workspaces--project-dir nil))))