From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Optional argument for `file-local-copy' Date: Sun, 30 Nov 2014 18:24:09 +0100 Message-ID: <87k32cbo06.fsf@gmx.de> References: <871tom5jou.fsf@gmx.de> <83bnnqb1lo.fsf@gnu.org> <20141129140856.GA3752@acm.acm> <83a93aax58.fsf@gnu.org> <20141129153320.GC3752@acm.acm> <87d2853q5i.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1417368284 28637 80.91.229.3 (30 Nov 2014 17:24:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2014 17:24:44 +0000 (UTC) Cc: Alan Mackenzie , Eli Zaretskii , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 30 18:24:37 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xv8Ee-0003JA-4a for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2014 18:24:36 +0100 Original-Received: from localhost ([::1]:51083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv8Ed-0002Ah-GO for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2014 12:24:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv8EU-00029V-4R for emacs-devel@gnu.org; Sun, 30 Nov 2014 12:24:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xv8EM-0008Lh-2A for emacs-devel@gnu.org; Sun, 30 Nov 2014 12:24:26 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:61616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xv8EL-0008LX-Oc; Sun, 30 Nov 2014 12:24:17 -0500 Original-Received: from detlef.gmx.de ([93.209.66.135]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MdaiW-1XXxbM3cWS-00PJsR; Sun, 30 Nov 2014 18:24:13 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 30 Nov 2014 09:11:49 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:EaaVFG/2j7QLV1RYdsbqozo3rbdvXwtqapOFMy3rxPYX/wx0Tt0 9vUu/gBh6lDS/mdeeGlneR5TfgDrgj1bJ79VdbM84ngggVm6n4SwEIz7ALcMVeR2ZUNALeY gnLHoWQ36QF8GHnqg7OXJvXXKak5GkvawtTX+NX54FIVmZWljPV09yFzO6U3dxBEF+e8XO3 gCGBaJmFMnrvKZZuVx3bw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:178526 Archived-At: Stefan Monnier 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.