persp-mode.el icon indicating copy to clipboard operation
persp-mode.el copied to clipboard

prevent new perspective to be automatically created by projectile

Open LucaMarconato opened this issue 8 years ago • 2 comments

I am using projectile and the projectile bridge. I do not like that every time I use projectile-find-file or other projectile function, a new perspective with name [p] name_of_the_project is automatically created. I read at auto-perspective paragraph and I tried commenting out some parts of persp-mode-projectile-bridge.el but no look. How can I do this?

LucaMarconato avatar Sep 15 '17 11:09 LucaMarconato

try something like this:

(with-eval-after-load "persp-mode-projectile-bridge-mode"
(when persp-mode-projectile-bridge-mode
  (remove-hook 'find-file-hook
                 #'persp-mode-projectile-bridge-hook-find-file)
  (remove-hook 'projectile-find-file-hook
                 #'persp-mode-projectile-bridge-hook-switch))
(add-hook 'persp-mode-projectile-bridge-mode
 #'(lambda ()
      (remove-hook 'find-file-hook
                 #'persp-mode-projectile-bridge-hook-find-file)
      (remove-hook 'projectile-find-file-hook
                 #'persp-mode-projectile-bridge-hook-switch))))

Bad-ptr avatar Sep 17 '17 17:09 Bad-ptr

First of all, thank you. Unfortunately this does not completely solve the problem. If I open a file from a folder in which there is a .projectile file, a new perspective, whose name starts with [p], is added. Also when I reopen emacs, all the [p] perspectives are recreated, even if I deleted all of them before closing emacs. In these days I will try to remove some more hooks like you did in the code you posted.

LucaMarconato avatar Sep 24 '17 23:09 LucaMarconato