On Thu, Dec 8, 2016 at 4:48 PM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Kaushal Modi <kaushal.modi@gmail.com> writes:

What about storing the contents of the file in a variable instead of
cluttering the temp directory?

Hmm, is there a way to read a file from a URL to a variable directly? Or did you mean to download the file first, read that into a temp buffer and then delete the temp file?
 

> - Now, the referenced SETUPFILE should be downloaded only if that (1) That
> file is being fetched for the first time in that emacs session, or (2) that
> temp file does not exist.

And (3) it isn't local?

This proposal was for the case where we have

#+SETUPFILE: http://foo.bar/config.org

So it cannot be local to begin with.

With respect to the point about not having the file in temp, we can have a flag that if set, will prevent re-downloading of the file. User can choose to reset that flag and then re-download that file. This will be lieu of the earlier condition "(2) that temp file does not exist."
 

> - Add a defun to force reload the SETUPFILE from the referenced URL, in
> which case the temp file will be deleted and re-downloaded (as the above
> condition satisfied).
>
> So under the normal circumstance where that foo.org file buffer is reverted
> multiple times in an emacs session, the same SETUPFILE downloaded to /tmp
> will be used. If the user updated the file at the referenced URL, they can
> do the above mentioned forced reload of SETUPFILE and download the latest
> version of SETUPFILE.
>
> Thoughts?

It could work. Do you want to provide an implementation?

I would like to work on this. But I will be away from my computer for about a month starting tomorrow. Will get back to this once I am back from my vacation.

Thank you for the feedback.
--

Kaushal Modi