Autosave to temporary file #11

Open
brandondrew opened this Issue Jun 2, 2014 · 31 comments

Comments

Projects
None yet

It would be extremely useful if this gave the option to save to a temporary file rather than the regular file, since overwriting the on-disk version of a file is not always desired, but preserving a copy of all changes made in memory is always useful.

itaylor commented Aug 7, 2014

+1
I really miss this feature from Sublime Text.

In Sublime Text, I can make changes to a file, not save them and quit Sublime. Sublime has saved my changes into a temp file somewhere. When I reopen Sublime, my file is reopened with the changes I'd made to it, but the original file is still unsaved on disk. This makes it so that you never have to worry about your computer crashing/battery dying with unsaved changes... all buffers are preserved until I throw them away, and the real file is never modified until I say I'm ready (by hitting save).

itaylor commented Aug 7, 2014

There's another discussion going that I think overlaps with this feature.
https://discuss.atom.io/t/saving-sessions-onquit/4021

+1

@itaylor you described exactly what I came here looking for.

Coming back from Sublime, I quite Atom without bothering new files and data in them. I realize I lost my work.

Old habit is to blame...!

+1 really need to not lose data when the app or the computer shuts down without notice!

+1

lambdafu commented Mar 3, 2015

I gave atom.io a try the other day and lost all pending edits after a system crash. Autosaving to temporary files is a must have feature, so I am back to good ol' emacs.

Poetro commented Mar 9, 2015

+1

👍

+1

+ this.axe

teheavy commented Sep 11, 2015

+1

Meligy commented Sep 12, 2015

+1 .. Some 3rd party tried to do it in save-session but it does need an insider to make it integrate properly, for example, it doesn't detect the different between tab close (no save required), and entire app close (save should hppen), as in save-session#121

This is the number one gripe I have with Atom and the feature I miss most from Sublime Text. 👍

zenna commented Nov 24, 2015

+1

+1 this would be awesome.

wbecker commented Jan 14, 2016

Notable changes in 1.4.0 says that "Untitled documents in a project are now serialized and restored."

Does this fix / relate to this issue?

@wbecker It covers my needs perfectly, at least. Thanks for pointing it out! 👍

Meligy commented Jan 14, 2016

Does "in a project" mean anything specific?

Owner

lee-dohm commented Jan 14, 2016

@Meligy Any time you open Atom you are implicitly in a project. A project is implicitly defined based on the list of root folders. So if you do atom ~/foo that is one project. Then later if you open a new session of atom with atom ~/bar that is a different project.

+65535

Meligy commented Jan 25, 2016

Well, it's not working for me. It seems to work when I have a folder open in sidebar, but if I remove last folder from project, restart, and try to lave a file open and restart again, it's gone.

I have tried that with latest Atom beta (1.5 beta) on latest Mac, and with Atom release (1.4) on Windows 10. Same behaviour.

I think maybe it only saves unsaved changes to already (previously) saved files, but the file was never saved (never existed on disk or had a location path), it doesn't restore it. And the option to save temporary version to disk before saving files doesn't seem to change this.

Owner

lee-dohm commented Jan 25, 2016

@Meligy you're right, we're still working on preserving the state of untitled buffers. You can find links to all the current stuff about them here atom/atom#9968.

We are supporting your idea with save-workspace package. Where we are saving whole workspace with project. Please look at out project and we will be appreciate if you'll get us valuable suggestions and, sure, welcome to contribute! 😄

Need this feature, I thought it like Sublime Text, it works fine at begin. But after few days working, I lost all files in Atom

Pretty sure https://github.com/atom/autosave does the trick these days. If you open atom in a given directory, then changes to that set of tabs should be saved, along with unsaved tabs as well. That said, a system crash would still wipe out the unsaved tabs, so best to "name and save" each tab, including any temporary ones. I also like https://atom.io/packages/file-watcher for rare file conflicts.

phord commented Jun 2, 2017

@jeffmcneill Since version 1.4, Atom keeps "untitled" windows just fine even when there's a crash. It does this even if autosave is disabled. Autosave is used to save the contents to the original file instead of to a hidden Atom-state-cache.

asbjornu commented Jun 8, 2017

@phord: Does that work with or without any projects?

phord commented Jun 8, 2017

@asbjornu It works with projects. It does not work without a project. Also, I didn't realize this issue was about the autosave plugin when I replied; I thought I was replying to an issue on atom/atom.

Here's something funny: If you open atom without a project, open an unnamed file, type something into it, and then exit Atom, you get this dialog:

'untitled' has changes, do you want to save them?
Your changes will be lost if you close this item without saving.
image

Here's what the buttons do:
Save: A save dialog appears so you can name the file and save it. [*]
Cancel: No save dialog appears and Atom exits immediately
Don't save: No save dialog appears and Atom exits immediately

[*] If you choose "Save" but then don't actually save the file (because you canceled the Save dialog), Atom exits immediately.

As far as I can tell, there is no difference between the "Cancel" and "Don't Save" buttons. For that matter, "Save + Cancel" also is the same.

In all cases, when you reopen Atom without a project, you will have an 'untitled' file open again with no contents.

g3blv commented Aug 6, 2017

It is not quite clear to me if unsaved filed are (auto) saved or not saved as temporary files.

@rsese rsese referenced this issue in atom/atom Nov 28, 2017

Closed

[Suggestion] Autosaves on exit #16280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment