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 14:44:25 +0000 Message-ID: References: <87h96eh4qb.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f403045dd8f43b5244054326ad35 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cEzx8-00005B-DX for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 09:45:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cEzx5-0008Uz-46 for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 09:45:42 -0500 Received: from mail-ua0-f171.google.com ([209.85.217.171]:35577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cEzx4-0008Ul-Ui for emacs-orgmode@gnu.org; Thu, 08 Dec 2016 09:45:39 -0500 Received: by mail-ua0-f171.google.com with SMTP id 12so449913925uas.2 for ; Thu, 08 Dec 2016 06:45:38 -0800 (PST) In-Reply-To: <87h96eh4qb.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 --f403045dd8f43b5244054326ad35 Content-Type: text/plain; charset=UTF-8 On Thu, Dec 8, 2016 at 9:31 AM Nicolas Goaziou wrote: > Hello, > > Kaushal Modi writes: > > > Anyone? > > Apparently not. > > Note that it could drastically slow down opening buffers with a mediocre > connection since SETUPFILE is read every time buffer set-up is > refreshed, e.g., when the buffer is opened. > > Here are a couple of ideas: - Let's assume that if the current file name is /path/to/foo.org, the SETUPFILE is always downloaded to /tmp/path_to_foo_config.org for brevity. The function that sets that temp file should be a defcustom. - 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. - 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? -- Kaushal Modi --f403045dd8f43b5244054326ad35 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Thu, De= c 8, 2016 at 9:31 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Kaushal Modi <kaushal.modi@gmail.com> writes:

> Anyone?

Apparently not.

Note that it could drastically slow down opening buffers with a mediocre connection since SETUPFILE is read every time buffer set-up is
refreshed, e.g., when the buffer is opened.


Here are a couple of ideas= :

- Let's assume that if the current file name= is /path/to/foo.org, the SETUPFILE is alway= s downloaded to /tmp/path_to_foo_= config.org for brevity. The function that sets that temp file should be= a defcustom.
- Now, the referenced SETUPFILE should be downloade= d only if that (1) That file is being fetched for the first time in that em= acs session, or (2) that temp file does not exist.
- Add a defun = to force reload the SETUPFILE from the referenced URL, in which case the te= mp 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 men= tioned forced reload of SETUPFILE and download the latest version of SETUPF= ILE.

Thoughts?
-= -

Kaushal = Modi

--f403045dd8f43b5244054326ad35--