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
Tested on windows7 and linux also.
The patch is against revision 24609.
Please review.
Thanks!
Submitted | roti - 2017-02-17 17:34:49.113000 | Assigned | ezust |
---|---|---|---|
Priority | 5 | Labels | untitled autosave |
Status | pending | Group | |
Resolution | remind |
2017-03-19 20:53:15.322000 ezust |
- **assigned_to**: Alan Ezust |
---|---|
2017-03-27 23:23:31.193000 ezust |
- **status**: open --> pending-rejected |
2017-03-27 23:23:31.552000 ezust |
I tried applying the patch to the svn trunk but it did not apply cleanly for MiscUtilities.java.
|
2017-03-31 15:28:16.015000 roti |
Please find the updated patch against rev. 24670 attached. saveUntitled_170331.patch (21.2Kio) |
2017-05-05 19:44:21.790000 roti |
Hi Alan,
|
2017-05-05 20:40:07.896000 ezust |
I am so sorry for not getting around to this!! I do plan to put it into |
2017-05-08 13:18:39.791000 ezust |
- **status**: pending-rejected --> open |
2017-05-08 14:45:19.231000 ezust |
Just tried this verison of the patch. it does not apply cleanly either :-(
svn-patch.log (2.0Kio) |
2017-05-09 09:57:17.997000 roti |
This is against 24674, and I tested it also. saveUntitled_24674.patch (20.5Kio) |
2017-05-09 16:40:53.130000 ezust |
That applies cleanly and I am testing it now. |
2017-05-09 17:49:12.796000 ezust |
Testing it with Editpane Scope Buffersets, there is an inconsistency. It bugs me,
so I am hesitant to commit the patch as-is.
|
2017-05-13 21:04:50.995000 roti |
I added a simple solution for this:
saveUntitled_24674_01.patch (21.0Kio) |
2017-05-13 21:33:06.493000 ezust |
Oh I like your solution very much. Elegant.
|
2017-05-13 21:39:00.446000 ezust |
- **status**: open --> closed-accepted |
2017-05-13 21:39:00.766000 ezust |
Committed revision 24675.
|
2017-05-31 14:43:06.716000 ezust |
Hrotkó,
|
2017-06-01 21:03:55.319000 roti |
Are you testing it with a clean new settings dir? I tested with new settings dir, and it works. I think it should work like this, because this feature is not released yet. |
2017-06-01 21:13:55.563000 ezust |
The problem is the location of new untitled buffers is not being set correctly anymore.
|
2017-06-03 23:27:24.451000 ezust |
- **status**: closed-accepted --> pending-remind |
2017-06-06 22:19:29.463000 roti |
I think, the untitled buffers should all go into one directory by default, even if
we do not set the autosave/backup dir explicitly. For example in this way one can
easily find them after a long time, even without using jEdit.
saveUntitled_24699.patch (562B) |
2017-06-06 22:43:00.512000 ezust |
The problem is that I want to be able to create a new file in the same directory as
the currenly editing file, and my workflow looks like this:
|
2017-06-07 14:12:39.336000 ezust |
ok I committed that and the change will be in the next daily build.
|
2017-06-12 20:20:21.823000 roti |
I created a patch, that works exactly as you described:
saveUntitled_24704.patch (9.0Kio) |
2017-06-12 20:35:46.833000 ezust |
This is *almost* what I meant, so thank you for addressing my issues.
|
2017-06-13 01:13:57.960000 ezust |
Be sure to update to r24713 because I made more changes to the code that you modified previously. |
2017-06-13 21:19:45.118000 ezust |
It seems something else that has changed since jEdit 5.4 is the creation of a new
untitled buffer when projectviewer changes projects (in the case where only project
files were opened, and we have close open project files on project change, and also
remember open files enabled).
|
2017-06-16 07:19:48.471000 roti |
I created a patch for "Project Viewer opens an empty buffer".
|
2017-06-16 11:50:27.540000 ezust |
What i meant to say is "when an autosaved untitled is restored from the backup/autosave
directory, its previous path should be restored, instead of the path to the autosave/backup
location."
|
2017-06-16 15:43:23.842000 ezust |
Why would someone want untitled autosaves to be stored differently from regular autosaves?
|
2017-06-20 21:11:57.932000 roti |
I had some misunderstanding of your wording lastly, but now I understand all requirements,
and created the patch for that.
saveUntitled_24718.patch (7.9Kio) |
2017-06-21 00:07:52.629000 ezust |
|
2017-06-21 00:09:05.096000 ezust |
It sounds like the option you want is "location of new untitled buffers", regardless
of autosave/backup dir.
|
2017-06-24 14:05:49.347000 ezust |
I don't like this patch. You are adding a new field to the perspective when it is
not necessary. Just save the correct location of the original UNTITLED buffer in the
perspective, and then SEARCH for autosaves checking where getAutosaveDirectory()
tells you to go for that buffer.
|
2017-06-28 20:51:03.792000 roti |
Ok, from your perspective, what is left to be done for this feature to be accepted? |
2017-06-28 20:56:43.306000 ezust |
I just want to see the correct buffer path saved and restored from the perspective,
untitled or not when autosave is used.
|
2017-06-28 21:02:40.183000 roti |
I think, now the code in trunk, restores the correct path. I tested it now.
|
2017-06-28 21:30:36.893000 ezust |
Trunk does not save the correct location of the untitled buffer to the perspective.
|
2017-06-29 21:42:36.762000 roti |
I tested your requirement, and the full behavior is only possible with my patch: saveUntitled_24718.patch.
|
2017-06-30 00:12:14.158000 ezust |
I am testing your patch and so far, it seems to work as I asked as long as I don't
look into the perspective file :-)
|
2017-06-30 13:32:24.257000 ezust |
The problem you are trying to solve: allowing for the user to change autosave directories
and using the old one for existing buffers, is not a solution that works for non-untitled
buffers.
|
2017-07-02 16:18:01.617000 ezust |
There are a lot of public functions you've added to jEdit's API just to make it possible
to treat untitled buffers differently from regular ones. I personally think many of
them can be removed if we store untitled autosaves the same way as regular autosaves.
|
2017-07-02 16:31:46.205000 ezust |
The default behavior could be set to have the backup location pre-set to something
sensible, such as the jEditSettingsDirectory/backups, but that is just a simple value/1-liner
we add to the jedit.props file. Then the default behavior won't leave behind autosaves
or backups everywhere.
|