-
Notifications
You must be signed in to change notification settings - Fork 14
Description
As exposed in Issue #23, I also sometimes accidentally kill my *scratch* buffer, resulting in the content of persistent-scratch-save-file and the latest backup being overwritten by "nil". The solution by the OP of that Issue helps to make a backup when killing the buffer and updating the file name for future updates. However, one still needs to manually persistent-scratch-restore-from-file the contents from the old file.
I was wondering whether a(n additional) solution would be to check whether the *scractch* buffer actually exists before writing anything to file (main file or backup). If I understand correctly, (get-buffer "*scratch*") will return nil if the buffer does not exist, and perhaps this could be used to decide whether to write anything at all.
I apologise for my poor knowledge of elisp; I didn't succeed in making a version/patch to actually test this and create a pull request.