Bad-ptr / persp-mode.el

named perspectives(set of buffers/window configs) for emacs
400 stars 44 forks source link

prevent new perspective to be automatically created by projectile #82

Open LucaMarconato opened 6 years ago

LucaMarconato commented 6 years ago

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?

Bad-ptr commented 6 years ago

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))))
LucaMarconato commented 6 years ago

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.