From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Allow #+SETUPFILE to point to an URL for the org file Date: Thu, 08 Dec 2016 22:07:39 +0000 Message-ID: References: <87h96eh4qb.fsf@nicolasgoaziou.fr> <871sxigkhk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1143d6f449b44705432cded9 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cF6s3-0000fx-3c for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:08:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cF6rz-0004c2-Rr for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:08:55 -0500 Received: from mail-vk0-f51.google.com ([209.85.213.51]:33615) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cF6rz-0004ap-Lj for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:08:51 -0500 Received: by mail-vk0-f51.google.com with SMTP id 137so236613013vkl.0 for ; Thu, 08 Dec 2016 14:08:51 -0800 (PST) In-Reply-To: <871sxigkhk.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-org list --001a1143d6f449b44705432cded9 Content-Type: text/plain; charset=UTF-8 On Thu, Dec 8, 2016 at 4:48 PM Nicolas Goaziou wrote: > Kaushal Modi 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 --001a1143d6f449b44705432cded9 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
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 va= riable instead of
cluttering the temp directory?
Hmm, is there a way to read a file from a URL to a variable dir= ectly? Or did you mean to download the file first, read that into a temp bu= ffer and then delete the temp file?
=C2=A0

> - 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

<= div>#+SETUPFILE: http://foo.bar/confi= g.org

So it cannot be local to begin with.

With respect to the point about not having the file i= n 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. Th= is will be lieu of the earlier condition "(2) that temp file does not = exist."
=C2=A0

> - Add a defun to force reload the SETUPFILE from the referenced URL, i= n
> which case the temp file will be deleted and re-downloaded (as the abo= ve
> 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 lat= est
> version of SETUPFILE.
>
> Thoughts?

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

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

Than= k you for the feedback.
--

Kaushal Modi

--001a1143d6f449b44705432cded9--