Browse Source

Fixed persp mode naming bug

master
Josh Wolfe 1 year ago
parent
commit
66dd2d08b2
No account linked to committer's email address
1 changed files with 11 additions and 1 deletions
  1. 11
    1
      emacs/.emacs.d/README.org

+ 11
- 1
emacs/.emacs.d/README.org View File

@@ -1377,6 +1377,7 @@ or don't exist for the language.
:config
(defvar wolfe/persp-default-workspace "main")
(defvar wolfe/persp-shared-buffers '("*scratch*" "*Messages*"))
(defvar wolfe/projectile-project-to-switch nil)

(setq wg-morph-on nil ;; switch off animation
persp-autokill-buffer-on-remove 'kill-weak
@@ -1405,9 +1406,18 @@ or don't exist for the language.
(persp-window-switch . nil)
(persp-frame-switch . nil)))))

(defun wolfe/projectile-switch-project-by-name (counsel-projectile-switch-project-by-name &rest args)
(setq wolfe/projectile-project-to-switch (car args))
(apply counsel-projectile-switch-project-by-name args)
(setq wolfe/projectile-project-to-switch nil))
(advice-add #'counsel-projectile-switch-project-by-name :around #'wolfe/projectile-switch-project-by-name)

(defun wolfe/persp-create-project-persp ()
(let ((frame (selected-frame))
(name (projectile-project-name)))
(name (file-name-nondirectory
(directory-file-name
(file-name-directory
wolfe/projectile-project-to-switch)))))
(with-selected-frame frame
(persp-add-new name)
(persp-frame-switch name)

Loading…
Cancel
Save