From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Alan Mackenzie <acm@muc.de>, Eli Zaretskii <eliz@gnu.org>,
emacs-devel@gnu.org
Subject: Re: Optional argument for `file-local-copy'
Date: Sun, 14 Dec 2014 11:22:40 +0100 [thread overview]
Message-ID: <877fxuedjj.fsf@gmx.de> (raw)
In-Reply-To: <jwvk31yfcgm.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 11 Dec 2014 10:22:11 -0500")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Yes, but how will you write the code so that the temp/cached files
> don't linger indefinitely?
>
> Don't get me wrong: I like the idea, but I think we need to think a bit
> more about how to handle the cache and deletion, in order to design the
> API correctly.
>
> Here's the problem I currently see:
> - OT1H you currently have the caller as the one responsible for the
> deletion of the file.
> - OTOH it's the handler that decides where to put the file.
> That seems to make it difficult to get a good behavior. E.g. you might
> want to keep the file for a long time (across sessions) in a special
> "cache" subdirectory somewhere, but this decision can't be made by the
> handler (because the caller will have to delete the file without knowing
> it's meant to be kept) and it can't be made by the caller either
> (because it can't tell the handler where to put the file).
Currently, `file-local-copy' keeps the files in `temporary-file-directory'.
One could use a subdirectory of that.
And I don't know whether such local copies shall be kept over Emacs
session boundaries. In the Tramp case, it might be acceptable to remove
all local file copies for a given remote host, when the connection to
that host is (re-)established.
> Maybe a better option is to change the optional argument so that it's
> not just a boolean but it's actually the name of a "candidate local
> copy" (i.e. it's the name of the local copy kept in the cache managed
> by the caller), tho maybe we'd need more info (e.g. the full
> file-attributes).
The mapping of a remote file name to the local copy could be managed
inside the `file-local-copy' machinery. And whether we always need
file-attributes I'm not sure. One implementation inside Tramp could be
to install a file notifications handler for the remote file if possible.
We will be informed then, when the remote file changes, and the local
file is out-dated.
> Stefan
Best regards, Michael.
next prev parent reply other threads:[~2014-12-14 10:22 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-29 11:29 Optional argument for `file-local-copy' Michael Albinus
2014-11-29 13:03 ` Eli Zaretskii
2014-11-29 14:08 ` Alan Mackenzie
2014-11-29 14:39 ` Eli Zaretskii
2014-11-29 15:33 ` Alan Mackenzie
2014-11-29 16:24 ` Thien-Thi Nguyen
2014-11-30 5:22 ` Stefan Monnier
2014-11-30 11:04 ` Michael Albinus
2014-11-30 14:11 ` Stefan Monnier
2014-11-30 17:24 ` Michael Albinus
2014-12-02 14:18 ` Stefan Monnier
2014-12-02 14:53 ` Michael Albinus
2014-12-02 20:55 ` Stefan Monnier
2014-12-02 21:24 ` Michael Albinus
2014-12-02 22:30 ` Stefan Monnier
2014-12-09 13:32 ` Michael Albinus
2014-12-10 14:15 ` Stefan Monnier
2014-12-11 9:20 ` Michael Albinus
2014-12-11 15:22 ` Stefan Monnier
2014-12-14 10:22 ` Michael Albinus [this message]
2014-12-14 13:46 ` Stefan Monnier
2014-12-14 14:24 ` Michael Albinus
2014-12-14 22:37 ` Stefan Monnier
2014-12-15 7:41 ` Michael Albinus
2014-11-30 10:54 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877fxuedjj.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=acm@muc.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.