[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Optional argument for `file-local-copy'
From: |
Michael Albinus |
Subject: |
Re: Optional argument for `file-local-copy' |
Date: |
Sun, 30 Nov 2014 18:24:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> Thanks for getting us back on track. Yes, I agree with adding such
> a functionality. But I have the impression that it's not enough: if the
> caller doesn't know whether the file is indeed being cached or not, then
> it doesn't know whether to delete it or not once it's done using it.
The caller does not need to know whether a file is cached. File name
handlers implementation shall keep *always* the information about a
local copy of a remote file (the local name, the result of
file-attributes of the remote file).
When file-local-copy is called with a non-nil REUSE-IF-ALREADY-EXISTS,
it checks whether there is a cached information about that remote file,
whether the local copy still exists, and whether the cached
file-attributes information is equal to the actual value. Then, and only
then, it reuses that local copy.
By this, any caller of file-local-copy could either ignore this new
argument, and delete the local copy after it was used, or the caller
does not delete the local copy because there is the assumption that the
local copy might be used, again. Candidates are retrieved web pages, or
remote files retrieved by a vc backend, like vc-bzr-admin-* files in
vc-bzr.el.
A problem might be to remove local copies when they are not used
anymore. This could be done when Emacs is stopped, and/or when Emacs is
started. But this shall be applied in the background, without
intervention of the user.
> Stefan
Best regards, Michael.
- Optional argument for `file-local-copy', Michael Albinus, 2014/11/29
- Re: Optional argument for `file-local-copy', Eli Zaretskii, 2014/11/29
- Re: Optional argument for `file-local-copy', Alan Mackenzie, 2014/11/29
- Re: Optional argument for `file-local-copy', Eli Zaretskii, 2014/11/29
- Re: Optional argument for `file-local-copy', Alan Mackenzie, 2014/11/29
- Re: Optional argument for `file-local-copy', Thien-Thi Nguyen, 2014/11/29
- Re: Optional argument for `file-local-copy', Stefan Monnier, 2014/11/30
- Re: Optional argument for `file-local-copy', Michael Albinus, 2014/11/30
- Re: Optional argument for `file-local-copy', Stefan Monnier, 2014/11/30
- Re: Optional argument for `file-local-copy',
Michael Albinus <=
- Re: Optional argument for `file-local-copy', Michael Albinus, 2014/11/30