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, 25 May 2017 15:15:47 +0000 Message-ID: References: <87h96eh4qb.fsf@nicolasgoaziou.fr> <871sxigkhk.fsf@nicolasgoaziou.fr> <87twaef3iq.fsf@nicolasgoaziou.fr> <874lybp5ua.fsf@nicolasgoaziou.fr> <87shjtb5wd.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="94eb2c19d222ba471805505ab2f4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDuUd-0000z5-4F for emacs-orgmode@gnu.org; Thu, 25 May 2017 11:16:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDuUb-0006yU-C8 for emacs-orgmode@gnu.org; Thu, 25 May 2017 11:16:03 -0400 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:36640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDuUa-0006yB-Re for emacs-orgmode@gnu.org; Thu, 25 May 2017 11:16:01 -0400 Received: by mail-lf0-x22f.google.com with SMTP id h4so85756953lfj.3 for ; Thu, 25 May 2017 08:16:00 -0700 (PDT) In-Reply-To: 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: Nicolas Goaziou Cc: emacs-org list --94eb2c19d222ba471805505ab2f4 Content-Type: multipart/alternative; boundary="94eb2c19d222ba471405505ab2f2" --94eb2c19d222ba471405505ab2f2 Content-Type: text/plain; charset="UTF-8" I have attached an updated and rebased patch with most of your suggestions implemented. Comments below. On Thu, May 25, 2017 at 7:43 AM Kaushal Modi wrote: > On Thu, May 25, 2017, 6:15 AM Nicolas Goaziou > wrote: > >> Interactive functions do not have double-dashes in their names. However, >> I have concerns about this interactive status. Given than the function >> is not properly documented in the manual, there is little chance it will >> be actually used. And if it isn't, it could return surprising results. >> >> Another idea would be to replace NOCACHE with CLEAR-CACHE. When this is >> non-nil, the cache is reset at the beginning of the function. The point >> is to reset the cache the first time the function is called, but not on >> recursive calls, which ensures any file is retrieved only once. > > > Here is my use case for org-file-clear-cache: > > Let's say I have a file where I have a SETUPFILE retrieved from a URL. Now > the upstream version changes but my cache is still on the older version. So > I need to clear the hash. The org-file-clear-cache simply does that. > > With the function being interactive, I just do > > - M-x org-file-clear-cache > - C-c C-e h h (or whatever I am exporting to) > > If you suggest a node where I should put that in the manual, I can add > that to my updated patch. I'll all add more explanation to the doc-string > of that function. > > Now, if the CLEAR-CACHE argument is added to org-file-clear-cache, how do > we control the cache clearing interactively from outside? > > Also, how do we implement the resetting of the cache only the first time > the function is called? Wouldn't that need an extra alist defvar to record > the state of whether the function is already called specifically for that > file? I think that would unnecessary complicate the logic. > > Another idea is that we have a defcustom like org-file-never-cache. When > non-nil, that will always do a fresh URL download. This will be or'ed with > the NOCACHE inside org-file-contents. This, though, makes it a bit > inconvenient for the user to use the latest upstream version when they > need... They might need to set org-file-never-cache to t momentarily, > probably via Local Variables, before an export. > > Of > > course the cache doesn't survive to multiple exports, but at least it is >> transparent to the user. >> > > Sorry, I didn't follow that. Did you mean that the cache doesn't survive > between emacs sessions? Because the cache will actually survive between > multiple exports. > This issue is still open. I have just added a bit more info to the docstring of org-file-clear-cache. I grepped org.texi but found no reference of org-file-contents. So may be we need to add a section for that, and there I can explain org-file-clear-cache in more detail. What would be a good node for that? > (if (re-search-forward "HTTP.*\\s-+200\\s-OK" nil t) >> ;; URL retrieved correctly. Move point to after the >> ;; url-retrieve header, update the cache `org--file-cache' >> ;; and return contents. >> (progn >> (search-forward "\n\n" nil 'move) > > I have integrated most of your refactored version except for this portion. Above will do a false match if that "HTTP.." string is present in the FILE body too! I have retained my version of only that part where the search happens only inside the url-retrieve header. The search is also faster in the case of failure as it does not have to search through the whole file before declaring a fail.. as only the header is searched. > -- Kaushal Modi --94eb2c19d222ba471405505ab2f2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I have attached an updated and rebased patch with most of = your suggestions implemented.

Comments below.

On Thu, May 25, 2017 at 7:43 AM Ka= ushal Modi <kaushal.modi@gmail= .com> wrote:
On Thu, May 25, 2017, 6:15 AM Nicolas Goaziou = <mail@nicola= sgoaziou.fr> wrote:
Interactive functions do not have double-dashes in their names. However, I have concerns about this interactive status. Given than the function
is not properly documented in the manual, there is little chance it will be actually used. And if it isn't, it could return surprising results.<= br>
Another idea would be to replace NOCACHE with CLEAR-CACHE. When this is
non-nil, the cache is reset at the beginning of the function. The point
is to reset the cache the first time the function is called, but not on
recursive calls, which ensures any file is retrieved only once.

Here is my use case for org-file-clear-cache:

Let's say I have a file where I have a SETUPFILE= retrieved from a URL. Now the upstream version changes but my cache is sti= ll on the older version. So I need to clear the hash. The org-file-clear-ca= che simply does that.=C2=A0

With the function bein= g interactive, I just do=C2=A0

- M-x org-file-clea= r-cache
- C-c C-e h h (or whatever I am exporting to)
<= br>
If you suggest a node where I should put that in the manual, = I can add that to my updated patch. I'll all add more explanation to th= e doc-string of that function. =C2=A0

Now, if = the CLEAR-CACHE argument is added to org-file-clear-cache, how do we contro= l the cache clearing interactively from outside?=C2=A0

=
Also, how do we implement the resetting of the cache only the first ti= me the function is called? Wouldn't that need an extra alist defvar to = record the state of whether the function is already called specifically for= that file? I think that would unnecessary complicate the logic.=C2=A0

Another idea is that we have a defcustom like org-file= -never-cache. When non-nil, that will always do a fresh URL download. This = will be or'ed with the NOCACHE inside org-file-contents. This, though, = makes it a bit inconvenient for the user to use the latest upstream version= when they need... They might need to set org-file-never-cache to t momenta= rily, probably via Local Variables, before an export.=C2=A0

<= /div>
=C2=A0Of
course the cache doesn't survive to multiple exports, but at least it i= s
transparent to the user.

Sorry, I= didn't follow that. Did you mean that the cache doesn't survive be= tween emacs sessions? Because the cache will actually survive between multi= ple exports.=C2=A0

This issue is stil= l open. I have just added a bit more info to the docstring of org-file-clea= r-cache.

I grepped org.texi but found no reference= of org-file-contents. So may be we need to add a section for that, and the= re I can explain org-file-clear-cache in more detail. What would be a good = node for that?
=C2=A0
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (if (re-search-forward "HTTP.*\\s-+200\\s-OK" nil t) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; URL retrieved correctly= .=C2=A0 Move point to after the
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; url-retrieve header, up= date the cache `org--file-cache'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; and return contents. =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (search-forward &qu= ot;\n\n" nil 'move)

=
I have integrated most of your refactored version except for this port= ion. Above will do a false match if that "HTTP.." string is prese= nt in the FILE body too! I have retained my version of only that part where= the search happens only inside the url-retrieve header. The search is also= faster in the case of failure as it does not have to search through the wh= ole file before declaring a fail.. as only the header is searched.
--

Kaushal Modi

--94eb2c19d222ba471405505ab2f2-- --94eb2c19d222ba471805505ab2f4 Content-Type: application/octet-stream; name="0001-Allow-org-file-contents-to-fetch-file-contents-from-.patch" Content-Disposition: attachment; filename="0001-Allow-org-file-contents-to-fetch-file-contents-from-.patch" Content-Transfer-Encoding: base64 Content-ID: <15c402d6d6fce4967311> X-Attachment-Id: 15c402d6d6fce4967311 RnJvbSBiOTg3N2FlNDNiYjhlODNlMWNlY2ZkZjBkYWI1MDY1NTc0YzhkYzg1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tO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