It should be something like
* lisp/org.el (org--file-cache): New variable
(org-reset-file-cache):
(org-file-url-p): New function.
(org-mode-restart): Use new function.
The purpose is to know in what commit the function was introduced, not
what it does.
The last sentence is not correct. C-c C-c on any settings line resets
the cache, not specifically on "#+SETUPFILE".
I'm worried about this test, and some other below. They require a proper
internet access.
Couldn't we fake `url-retrieve-synchronously' using
`cl-letf' so as to produce a buffer with appropriate contents and return
it? Something (untested) like
(should
(string=
"foo"
(let ((buffer (generate-new-buffer "test-ox")))
(unwind-protect
(cl-letf (((symbol-function 'url-retrieve-synchronously)
(lambda (&rest _)
(with-current-buffer buffer (insert "HTTP 200 OK\n\nfoo"))
buffer)))
(org-file-contents "http://whatever"))
(kill-buffer buffer)))))
Kaushal Modi