Bad-ptr / persp-mode.el

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

persp-kill does not remove perspective from the hash that gets saved to a file #21

Closed synic closed 8 years ago

synic commented 8 years ago

perp-kill does not remove the perspective from the file that gets saved when you save perspectives. So, even though the perspective is closed in memory and you can't see it in emacs, when you restart emacs and reload the perspective file, the perspective will be back.

Here's the spacemacs ticket: https://github.com/syl20bnr/spacemacs/issues/3775

Bad-ptr commented 8 years ago

ok.

synic commented 8 years ago

I think you may misunderstand. This is not an enhancement, its a bug. If you are using persistent perspectives, you cannot remove a layout from the saved file.

Bad-ptr commented 8 years ago

hm... you are right. Looks like an error in the logic of how persp-save-state-to-file works. It is interesting that nobody(including me) noticed this before.)

Bad-ptr commented 8 years ago

I think that setting the persp-auto-save-persps-to-their-file to nil will work(until I come up with a better solution). Could you try it?

synic commented 8 years ago

Yup, that seems to work, though I'm a little confused why. What does that setting do? How is it different than just saving the perspective to a file?

Bad-ptr commented 8 years ago

Should be fixed by c44bbf818135593f9ccea1f95a2f92223e9e0eca.

What does that setting do?

There is a function persp-load-from-file-by-names by which you can load a subset of perspectives from a file. When the persp-auto-save-persps-to-their-file is t these loaded perspectives will have a persp-file parameter pointing to the file from where they were loaded, so that they will be saved to that file by the persp-save-state-to-file function(perspectives without the persp-file parameter will be saved to a file passed as an argument to the persp-save-state-to-file).

synic commented 8 years ago

Yes, it is fixed now. Thank you!