I created a patch for the feature request: "#501 Auto-save untitled buffers".
Altough the settings "Autosave untitled buffers" exists, but not working like described in the feature request.
My patch extends this feature, when "Autosave untitled buffers" checked (default):
- the untitled buffers will be autosaved when closing jedit, without a question prompt
- the autosave for an untitled buffer saved to <jedit_settings_dir>/autosave, and reloaded after a restart (the state persisted to the perspective.xml)
- closing an untitled buffer by hand removes the autosave file</jedit_settings_dir>
Tested on windows7 and linux also.
The patch is against revision 24609.
Please review.
Thanks!
I am glad that this feature will appear in the next release. Your guidance was very helpfull. I think I will ask Andrew for a post on webup8 once the debs are available.
Hmm. It doesn't seem to work for me. I have the "Backup, Autosave directory" set to:
/Users/eberry/Library/jEdit/backups.I opened a new untitled buffer, from while editing a file that is on my Desktop. I see a file
#Untitled-1#on my desktop, and a back up in/Users/eberry/Library/jEdit/backups/Users/eberry/Desktop.From my understanding, I should only see the backup file in the backups directory, correct? May be an issue specific to Macs?
Now I have 2 copies of the untitled buffer on my file system, and one of them in the place I didn't want it to be (on my Desktop - this could have been Dropbox, or Google Drive, or any other file sharing folder).
Nevermind, it looks like it was an artifact from a previous Untitled buffer, the content was old, and the file didn't delete itself when I closed the buffer in jEdit.
Closing all Untitled buffers, and manually deleting them from the file system, then trying again from scratch shows that the Untitled buffers don't get persisted in the same directory of the current-buffer.
Nice work!