>>>> "Hrvoje" == Hrvoje Niksic
<hniksic(a)srce.hr> writes:
Hrvoje> 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
>
Hrvoje>
"c:\\Winnt\\Profiles\\AichnerA\\autosave\\#c:\\Winnt\\Profiles\\AichnerA\\N
Hrvoje> ews\\drafts\\drafts\\1#"
Hrvoje> Is that the default? Why is auto-save-directory set to
Hrvoje> anything other than nil? It defaults to nil under Unix.
Hello Hrvoje,
Umpf! Thanks for pointing this out. As a service to he XEmacs
community I load sample.emacs from within my site-start.el and go from
there. This way I notice if some recommended practice changes or
sample.emacs breaks so some reason or other.
sample.emacs changes auto-save defaults.
Yesterday I tried customizing the variables in question via
customize-variable but these customizations didn't show up in .emacs.
Today, encouraged by your mail, I tried again and all is just dandy!
All the customizations are there:
cd C:\Winnt\Profiles\AichnerA\
egrep -ni "auto-save|custom" .emacs NUL
Compilation started at Sun Oct 11 23:15:54 1998
.emacs:124:(custom-set-variables
.emacs:137: '(auto-save-timeout 30 t)
.emacs:168: '(auto-save-interval 100)
.emacs:170: '(auto-save-directory nil)
.emacs:200: '(auto-save-file-format t)
.emacs:262: '(auto-save-offer-delete t)
grep finished (22 matches found) at Sun Oct 11 23:15:55
My analysis of what happened yesterday is this:
I probably had set the variables with
set-variable before invoking
customize-variable.
Since custom didn't change the variable, it didn't care to save it
when I pushed the "Save" button.
We can write this off as a cockpit error, I guess.
Thanks for your help, Hrvoje!
Adrian
Hrvoje> Perhaps under Windows we should default `auto-save-hash-p'
Hrvoje> so that setting `auto-save-directory' works? But I don't
Hrvoje> like doing that if there is another solution, because the
Hrvoje> docs say that auto-save-hash-p defeats
Hrvoje> `recover-all-files'.
Thanks for pointing this out. I agree that nil is a good default
worth keeping.
> 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.
Hrvoje> That "workaround" is actually the default behaviour under
Hrvoje> 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?
Hrvoje> No, because then you wouldn't be able to differentiate
Hrvoje> between the autosave for c:\foo and the autosave for
Hrvoje> d:\foo.
Yep.
> (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 ...)
Hrvoje> What on earth do you mean by that? Are you sure you
I thought the comment indicated the variable couldn't be changed and
saved via customize. This was probably due to my cockpit error,
described above.
Hrvoje> understood the quoted comment?
Probably not.
> 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.
Hrvoje> `M-x customize-variable RET auto-save-directory RET'
Hrvoje> should also work.
Yes, it does today, now that I did it right.
> 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 ...)?
Hrvoje> Is `defcustom' defined at the time auto-save is loaded?
Dunno.
> Question: Why can't auto-save-timeout be a (defcustom ...)
Hrvoje> auto-save-timeout *is* a customizable variable. I'm not
Hrvoje> sure why it's not initialized via `defcustom'. However,
Hrvoje> `M-x customize-variable RET auto-save-timeout RET' will do
Hrvoje> the right thing.
Same as above. This works fine.
Hrvoje> -- Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER
Hrvoje> Zagreb, Croatia
Hrvoje> --------------------------------+--------------------------------
Hrvoje> If anything goes wrong, blame the random-number generator!
--
Adrian Aichner
Applications Engineer
Teradyne GmbH
Semiconductor Test Group Telephone +49/89/41861(0)-208
Dingolfinger Strasse 2 Fax +49/89/41861-217
D-81673 MUENCHEN E-mail adrian.aichner(a)teradyne.com