-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support saving backup and autosave files in configurable directories #83
base: master
Are you sure you want to change the base?
Support saving backup and autosave files in configurable directories #83
Conversation
Thank you for working on this. A few comments/questions:
|
I will do this now.
Partially for that reason, partially because I just wasn't sure of the benefit of having the unit (is there one?).
Here I was unsure, because the docs say that, "The
I will do this. This is forcing me to think about how to make my informal tests actually work with the |
The unit is for the rest of the framework. The framework also tries to guarantee that all of the preferences are initialized before any of the other code runs to make it easier to reason about ordering (i.e., you don't have to), which is why preference initialization goes in main. re unmarshalling: yes, that's right, sorry. But I think a I just now noticed that main.rkt was reindented. Please do not do that. Also, I don't see handling for the case that the user-specified directory does not exist. This wasn't (really) needed before because the save file itself handled that. But now there needs to be a fallback so that the autosave file doesn't either silently fail to be created (or pop up an error message every N seconds when the autosave is tried). |
I tried to make sure the directory exists by checking |
The directory might not exist later when the auto save (or backup) file is
being saved.
|
Which makes me think of another problem: what happens if there are multiple
files with the same name (but in different directories)?
There probably needs to be some kind of table saying which one is which.
Which also means we probably need more care to support concurrency than is
currently present.
…On Sun, Nov 12, 2017 at 9:34 AM Robby Findler ***@***.***> wrote:
The directory might not exist later when the auto save (or backup) file is
being saved.
|
If I understand the question properly, I think this is handled because (when there is a non-false preference value) the functions derive the filename from the complete path to the original file. It is conceivably possible to engineer a collision, but the Emacs configuration I'm inspired by seems to just ignore this without problems in practice. |
Oh, I see Under Windows, the path length limit seems to be 260 chars, which seems plausible enough that probably something should be done to deal with that. Have you considered hashing the path? (I'm not sure it would be better, but it seems worth considering.) Also, instead of using |
Someone reminded me of this pull request at RacketCon. I'm writing this mostly to remind myself to look at it again when I get home. I don't immediately remember what the remaining issues were, but ideally I'd love to get at least this much done in time for 7.1, if perhaps not making a UI. |
Modifies
path-utils:generate-autosave-name
andpath-utils:generate-backup-name
to respond to preferences stored under'path-utils:autosave-dir
and'path-utils:backup-dir
, respectively, which can be used to designate a directory for saving the corresponding automatically-generated files, rather than saving them in the same directory as the originals.This functionality is inspired by Emacs' ability to be configured to do likewise with backup and autosave files.