From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Allow #+SETUPFILE to point to an URL for the org file Date: Thu, 08 Dec 2016 23:40:45 +0100 Message-ID: <87twaef3iq.fsf@nicolasgoaziou.fr> References: <87h96eh4qb.fsf@nicolasgoaziou.fr> <871sxigkhk.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cF7Mr-0003TI-RM for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:40:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cF7Mq-0006In-Pq for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:40:45 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:49392) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cF7Mq-0006IG-Dg for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 17:40:44 -0500 In-Reply-To: (Kaushal Modi's message of "Thu, 08 Dec 2016 22:07:39 +0000") 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: Kaushal Modi Cc: emacs-org list Kaushal Modi writes: > 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? You can use something like `url-insert' and `url-retrieve' or `url-retrieve-synchronously'. > This proposal was for the case where we have > > #+SETUPFILE: http://foo.bar/config.org > > So it cannot be local to begin with. Sure, but SETUPFILE still accepts local file names. So I was pointing out that you need to check if the URL is a local file name before proceeding. In particular, this check needs to happen when using "C-c '" (which may display URL contents in a read-only buffer, BTW). > 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." Is it necessary? File contents could be stored in, e.g., a hash table, url being the key. The file is downloaded only if the entry doesn't exist in the table and the user didn't force download.- > 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. Great. Thank you. Regards,