unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Optional argument for `file-local-copy'
@ 2014-11-29 11:29 Michael Albinus
  2014-11-29 13:03 ` Eli Zaretskii
  0 siblings, 1 reply; 25+ messages in thread
From: Michael Albinus @ 2014-11-29 11:29 UTC (permalink / raw)
  To: emacs-devel

Hi,

I would like to introduce an optional argument REUSE-IF-ALREADY-EXISTS
for `file-local-copy'. The docstring would be something like this:

--8<---------------cut here---------------start------------->8---
file-local-copy is a compiled Lisp function in `files.el'.

(file-local-copy FILE &optional REUSE-IF-ALREADY-EXISTS)

Copy the file FILE into a temporary file on this machine.
Returns the name of the local copy, or nil, if FILE is directly
accessible.

If REUSE-IF-ALREADY-EXISTS is non-nil, if there exists already a local
copy of FILE, and if the file attributes of FILE have not been changed
since the last copy operation, the name of the existing local copy of
FILE will be returned.
--8<---------------cut here---------------end--------------->8---

A typical use case for this has been discussed on the org-mode ML
<http://thread.gmane.org/gmane.emacs.orgmode/92856/focus=92970>. The
idea there is to cache downloaded images. But this parameter could be
used for caching copies of remote files in general.

Comments?

Best regards, Michael.



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-12-15  7:41 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).