Bad-ptr / persp-mode.el

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

Keep persp-mode from interfering with kill-buffer #70

Closed Stebalien closed 7 years ago

Stebalien commented 7 years ago

How do I get persp-mode to stop interfering with kill-buffer. I've set persp-kill-foreign-buffer-behavior to 'kill but it's still asking: "Remove the ... buffer from all perspectives?". I'm guessing the problem is that the buffer isn't foreign.

FYI, I'm using spacemacs if it makes a difference.

To reproduce, make two auto-persps, enter the first, open a buffer that automatically belongs to the second, and then kill it (never leaving the first perspective).

Bad-ptr commented 7 years ago

OK, you can try the develop branch for now. (see the persp-remove-buffers-from-nil-persp-behaviour variable) I will merge this to master in the end of the week(if I don't find any bugs).

Stebalien commented 7 years ago

Well, now it doesn't ask but... I can't kill the buffer at all!

Bad-ptr commented 7 years ago

Indeed, you can not kill a buffer that belongs to a perspective from another perspective. It needs to be fixed.)

Bad-ptr commented 7 years ago

I think I have fixed this 52b813a8a31c12fe0e5a5e5e2fd3e408b495887b

Stebalien commented 7 years ago

It never actually gets to persp--kill-buffer-query-function-foreign-check as (persp-contain-buffer-p buffer persp) returns t (everything belongs to the nil buffer). Unfortunately, this means foreign-check-passed gets set totand, further down,(eq 'kill foreign-check-passed)isnil`.

Bad-ptr commented 7 years ago

Yes, you are right. Thanks. I just committed a (possible:)) fix.

Stebalien commented 7 years ago

Thanks! It appears to work now.

(I'm leaving this open in case you prefer to keep issues open until fixed in master.)

Bad-ptr commented 7 years ago

I have changed the code a bit https://github.com/Bad-ptr/persp-mode.el/commit/c0249bd2201e361c55bbbab978a28dab288f6bd6 Hope this will not break it for you).

Stebalien commented 7 years ago

I haven't noticed any regressions.

Bad-ptr commented 7 years ago

Fixed in master, closing this.