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

2017-06-13 Thread Kaushal Modi
On Tue, Jun 13, 2017 at 5:32 PM Nicolas Goaziou wrote: > > I have attached the revised patch. > > LGTM. Thank you for the work! > Yay! Pushed to master. Thanks for the super reviews. It was a great learning experience. -- Kaushal Modi

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

2017-06-13 Thread Nicolas Goaziou
> I have attached the revised patch. LGTM. Thank you for the work! Regards,

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

2017-06-13 Thread Kaushal Modi
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 wrote: > It should be something like > > * lisp/org.el (org--file-cache): New variable > (org-reset-file-cache): > (org-file-url-p): New function

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

2017-06-13 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I have attached the same patch with one more test; rebased to master. Great. Thank you. > * lisp/org.el (org--file-cache): New internal variable to store > downloaded files' cache. > > * lisp/org.el (org-reset-file-cache): New function to clear the above > file ca

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

2017-06-12 Thread Kaushal Modi
I have attached the same patch with one more test; rebased to master. On Fri, Jun 9, 2017 at 12:59 PM Kaushal Modi wrote: > I have attached the updated patch, rebased to master. > -- Kaushal Modi 0001-Allow-org-file-contents-to-fetch-file-contents-from-.patch Description: Binary data

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

2017-06-09 Thread Kaushal Modi
I have attached the updated patch, rebased to master. On Sun, May 28, 2017 at 3:36 AM Nicolas Goaziou 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. >

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

2017-05-28 Thread Kaushal Modi
On Sun, May 28, 2017, 3:36 AM Nicolas Goaziou wrote: > Hello, > > Kaushal Modi writes: > > > I have attached a patch, rebased to master and with all suggestions > > implemented. > > Thank you. > > > There are some additional changes in the patch this time: > > - Prevent org-edit-special from att

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

2017-05-28 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I have attached a patch, rebased to master and with all suggestions > implemented. Thank you. > There are some additional changes in the patch this time: > - Prevent org-edit-special from attempting to open the "file" for editing > if the value is a URL. This is

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

2017-05-26 Thread Kaushal Modi
Thanks for another round of review. I have attached a patch, rebased to master and with all suggestions implemented. There are some additional changes in the patch this time: - Prevent org-edit-special from attempting to open the "file" for editing if the value is a URL. - Silence byte-compiler f

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

2017-05-26 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I have attached an updated and rebased patch with most of your suggestions > implemented. Thank you. >> 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 b

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

2017-05-25 Thread Kaushal Modi
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, >>

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

2017-05-25 Thread Kaushal Modi
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. A

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

2017-05-25 Thread Nicolas Goaziou
Correcting myself, Nicolas Goaziou writes: > (cond >(cache) >(is-url > (with-current-buffer (url-retrieve-synchronously file) > (goto-char (point-min)) > (if (re-search-forward "HTTP.*\\s-+200\\s-OK" nil t) > ;; URL retrieved correc

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

2017-05-25 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > I have attached a patch following your recommendation. Please review > it. Thank you. Comments follow. >> `org--setupfile-clear-cache' or `org-setupfile--clear-cache' depending >> on the location of the function. > > This is an interactive, a user-facing function;

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

2017-05-23 Thread Kaushal Modi
Thanks for the detailed review. I have attached a patch following your recommendation. Please review it. Here's a MWE to show the use of this new feature: = #+SETUPFILE: https://cdn.rawgit.com/kaushalmodi/.emacs.d/master/misc/org-setupfile.org #+TITLE: Heading{{{NEWLINE}}}Sub-heading =

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

2017-03-30 Thread Nicolas Goaziou
Hello, Kaushal Modi writes: > Here is my implementation.. it is still not baked into org.el, etc and > provided as a complete patch; I have some questions.. Thank you. > (defvar org-setupfile-ht (make-hash-table :test 'equal) org-setupfile-ht -> org--setupfile-cache if it is meant to be inse

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

2017-03-13 Thread Kaushal Modi
On Thu, Dec 8, 2016 at 5:40 PM Nicolas Goaziou wrote: > Kaushal Modi writes: > > You can use something like `url-insert' and `url-retrieve' or > `url-retrieve-synchronously'. > Thanks. I am using url-retrieve-synchronously. > > Sure, but SETUPFILE still accepts local file names. So I was point

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

2016-12-08 Thread Nicolas Goaziou
Kaushal Modi writes: > Hmm, is there a way to read a file from a URL to a variable directly? Or > did you mean to download the file first, read that into a temp buffer and > then delete the temp file? You can use something like `url-insert' and `url-retrieve' or `url-retrieve-synchronously'. >

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

2016-12-08 Thread Kaushal Modi
On Thu, Dec 8, 2016 at 4:48 PM Nicolas Goaziou wrote: > Kaushal Modi writes: > > What about storing the contents of the file in a variable instead of > cluttering the temp directory? > Hmm, is there a way to read a file from a URL to a variable directly? Or did you mean to download the file fir

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

2016-12-08 Thread Nicolas Goaziou
Kaushal Modi writes: > 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. What about storing the contents

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

2016-12-08 Thread Nicolas Goaziou
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. Regards, -- Nicolas Goaziou

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

2016-12-08 Thread John Kitchin
+1. I would use it like an xml dtd if I could ;). Kaushal Modi writes: > Anyone? > > On Sat, Dec 3, 2016, 12:23 PM Kaushal Modi wrote: > >> Hello, >> >> I would like to put my common org config in github so that I can access it >> from anywhere/any machine. >> >> Currently I have >> >> #+SETUPF

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

2016-12-08 Thread Kaushal Modi
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 buff

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

2016-12-08 Thread Kaushal Modi
Anyone? On Sat, Dec 3, 2016, 12:23 PM Kaushal Modi wrote: > Hello, > > I would like to put my common org config in github so that I can access it > from anywhere/any machine. > > Currently I have > > #+SETUPFILE: ~/org/common/config.org > > I would like to do something like > > #+SETUPFILE: http

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

2016-12-03 Thread Kaushal Modi
Hello, I would like to put my common org config in github so that I can access it from anywhere/any machine. Currently I have #+SETUPFILE: ~/org/common/config.org I would like to do something like #+SETUPFILE: https://cdn.rawgit.com/path/to/config.org I can probably add an async shell executi