emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Allow #+SETUPFILE to point to an URL for the org file


From: Kaushal Modi
Subject: Re: [O] Allow #+SETUPFILE to point to an URL for the org file
Date: Fri, 09 Jun 2017 16:59:43 +0000

I have attached the updated patch, rebased to master.


On Sun, May 28, 2017 at 3:36 AM Nicolas Goaziou <address@hidden> wrote:
This is a good idea. We could even display a read-only buffer with the
contents of the document, using new `org-file-contents'.

Anyway, this can be done in a different patch.

Thanks. I was on the fence about whether I should open the cached file in a read-only buffer.. but then the function was named `org-edit-special'.. the "edit" part. But if you are fine, I can work on that in a different commit.
 
> +indirectly through a file included using @samp{#+SETUPFILE: filename/URL}

filename/URL > file name or URL

> address@hidden #+SETUPFILE: file/URL

file/URL > file name or URL

> +reset the temporary file cache.  Org also parses and loads the file/URL

file/URL > document

> +during normal exporting process.  Org parses the contents of this
> file/URL as

file/URL document

> +buffer for these lines and update the information.  Also reset the org file

org > Org

Done.
 
> +(defvar ffap-url-regexp)             ;Silence byte-compiler

I think this can go at the beginning of the "org.el".

Done.
 
> +    ;; Reset the cache of files downloaded by `org-file-contents'.
> +    (clrhash org--file-cache))

Note that we can still implement a non-interactive
`org-reset-setupfile-cache' function and call it here instead. (clrhash
org--file-cache) may be a bit low level at this point.

Done, except that I named the function org-reset-file-cache as the file cache can be updated by org-file-contents function in general for any file.
 
Otherwise, LGTM. Would you want to throw in some tests? You can use
cl-letf to bind `url-retrieve-synchronously' to a function returning
a buffer containing some dumb (valid or invalid) output.

Done! I, though used invalid URLs in the test. (If they become valid at some point in distant future (I doubt), then we can update the test :))
--

Kaushal Modi

Attachment: 0001-Allow-org-file-contents-to-fetch-file-contents-from-.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]