[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backup method

From: Luc Teirlinck
Subject: Re: backup method
Date: Sat, 29 Jan 2005 12:42:31 -0600 (CST)

Han Boetes wrote:

   I do have one question left though: Is this patch sufficiently portable?

   Looking through files.el I found this description of what a
   temporary-file-directory looks like:

I am not _sure_, but I have the impression that `temporary-file-directory'
was exactly intended for portability reasons.  I believe that it was
intended to be the "normal" place for the OS to put temporary files.
You normally do not have to customize it because the code you quoted
normally gets it right.  If it gets it wrong, you have to customize it.

I have the impression that to get the portability you want, you would
need two new variables, that would do what I believe
`temporary-file-directory' and  `small-temporary-file-directory' are
actually intended to do, `system-temporary-file-directory' and
`system-small-temporary-file-directory'.  I do not really know whether
that would really be the correct solution.

Note that we are discussing whether or not to make backup files while
discussing a problem that has nothing at all to do with whether it is
useful or not to make backup files.  The only thing we are worried
about is whether the file should be copied or overwritten on save.
Some people _want_ and _expect_ Emacs to make backups in /temp/,
because they do make changes there that they might regret.  They then
try to use the backup file, which is not there.  I have seen "bug"
reports by people who where very inconvenienced by this (for them)
unexpected behavior.  "How come Emacs always makes backup files
_except_ when I really need them?".

Default Emacs is not an overwrite-on-save system and it is not a
copy-on-save system either.  By default, Emacs copies on save if and
only if a backup is made.  This links two unrelated questions, "Do I
need a copy in case I regret my edits" and "Does this file need to be
copied or overwritten on save".  Obviously, there are going to be
situations where this creates problems.

I believe that the correct solution in this particular case is to make
`normal-backup-enable-predicate' use a customizable list of
directories in which no backups are made, say `no-backup-directories'.
We could then tell people that if they want remove "/temp/" or
equivalent from the list, they should set `backup-by-copying' to t, or
we could use a second customizable variable
`backup-by-copying-directories', to unlink the two problems (at least
in this particular case).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]