Hi Nicolas,
Thanks for one more round of detailed feedback.
I have attached the revised patch.
On Tue, Jun 13, 2017 at 8:43 AM Nicolas Goaziou <
address@hidden> wrote:
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.
OK. Done.
The last sentence is not correct. C-c C-c on any settings line resets
the cache, not specifically on "#+SETUPFILE".
I have rephrased it.
I'm worried about this test, and some other below. They require a proper
internet access.
Makes sense.. While this feature does need internet access, running 'make test' shouldn't.
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)))))
Thanks. I have used that snippet at applicable places.