Adrian Aichner <aichner(a)ecf.teradyne.com> writes:
Hello auto-save experts!
Having trouble with auto-save on Windows NT natively build XEmacs, I
found some facts and more questions.
---------------------------------------------------------------
auto-saving in XEmacs NT native build does not work by default:
---------------------------------------------------------------
auto-save-directory
"c:\\Winnt\\Profiles\\AichnerA\\autosave\\"
will cause an illegal
buffer-auto-save-file-name
"c:\\Winnt\\Profiles\\AichnerA\\autosave\\#c:\\Winnt\\Profiles\\AichnerA\\News\\drafts\\drafts\\1#"
Is that the default? Why is auto-save-directory set to anything other
than nil? It defaults to nil under Unix.
Perhaps under Windows we should default `auto-save-hash-p' so that
setting `auto-save-directory' works? But I don't like doing that if
there is another solution, because the docs say that auto-save-hash-p
defeats `recover-all-files'.
Workaround:
Setting auto-save-directoy to nil, which makes files being auto-saved
in the same directory as buffer-file-name, making file names legal
when TEMP or TMP contain a drive spec.
That "workaround" is actually the default behaviour under Unix.
Question:
How could this problem be fixed? I suppose buffer-auto-save-file-name
should have any embedded drive:\ or \\computer-name component
stripped?
No, because then you wouldn't be able to differentiate between the
autosave for c:\foo and the autosave for d:\foo.
(defcustom auto-save-directory nil
;; Don't make this user-variable-p, it should be set in .emacs and
;; left at that. In particular, it should remain constant across
;; several Emacs session to make recover-all-files work.
;; However, it's OK for it to be customizable, as most of the
;; customizable variables are set at the time `.emacs' is read.
;; -hniksic
I fail to see how and why a user of the trusting kind should have to
figure out that his customization of auto-save-directory (even
though one can set it for the current session) does not get saved in
(custom-set-variables ...)
What on earth do you mean by that? Are you sure you understood the
quoted comment?
Only by looking at the above source-code will one get the hint that
one has to (setq auto-save-directory nil) in ones .emacs file.
`M-x customize-variable RET auto-save-directory RET' should also work.
Question:
Why shouldn't the following initialization code for auto-save-interval
(put 'auto-save-interval 'custom-type 'integer)
(put 'auto-save-interval 'factory-value '(300))
(custom-add-to-group 'auto-save 'auto-save-interval 'custom-variable)
be made into a plain (defcustom ...)?
Is `defcustom' defined at the time auto-save is loaded?
Question:
Why can't auto-save-timeout be a (defcustom ...)
auto-save-timeout *is* a customizable variable. I'm not sure why it's
not initialized via `defcustom'. However, `M-x customize-variable RET
auto-save-timeout RET' will do the right thing.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
If anything goes wrong, blame the random-number generator!