Bad-ptr / persp-mode.el

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

persp-kill not killing all buffers for a perspective #100

Closed namdnguyen closed 5 years ago

namdnguyen commented 5 years ago

Is there a way to kill all buffers when killing a perspective with persp-kill? Looking at the persp-kill function, the default behavior says that it will kill the perspective and all of the buffers added to the killed perspective, unless it's called with a universal argument. If called with the universal argument, it sets the optional variable, dont-kill-buffers, and it doesn't kill all buffers in a perspective.

However, when it's killing buffers, it's actually using persp-remove-buffer, which means that it's removed from the killed perspective, but they persist on other perspectives where it's added. This behavior is consistent with what you would expect by calling persp-kill with the universal argument. My expectation for calling persp-kill normally is that it would use persp-kill-buffer on all of the buffers in a perspective to truly kill the buffer.

Is there a reason, the buffers are removed, rather than killed, as the prompts and messages suggest?

15cm commented 5 years ago

Please read suggested-configuration for information about the persp-autokill-buffer-on-remove variable.

namdnguyen commented 5 years ago

Ah, I didn't see that in the README. Thank you! I'll take a look!

namdnguyen commented 5 years ago

Changing the value for the variable persp-autokill-buffer-on-remove did it for me. It was set to nil, and I changed it to t. The other option is kill-weak, which kills buffers from weak perspectives only. I'm not quite sure what constitutes a weak perspective. Does it refer to the 'nil' perspective that contains all buffers across all perspectives? Can you have more than one non-weak perspective? If so, how would you create that, in contrast to creating a regular, weak perspective?

Let me see if I understand the the difference between setting persp-autokill-buffer-on-remove to nil or kill-weak. Let's say you have a buffer that exists on 2 different, weak perspectives, and on the 'nil' perspective, by default.

Finally, if persp-kill (keybound to C) is ran with the universal argument, then it's effectively killing the perspective with persp-autokill-buffer-on-remove temporarily set to nil. If persp-autokill-buffer-on-remove is already set to nil, then calling persp-kill is identical to calling it with the universal argument. Is this correct?