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: Tue, 23 May 2017 19:07:16 +0000 Message-ID: References: <87h96eh4qb.fsf@nicolasgoaziou.fr> <871sxigkhk.fsf@nicolasgoaziou.fr> <87twaef3iq.fsf@nicolasgoaziou.fr> <874lybp5ua.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="001a114b25ece4a456055035b2fe" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dDF9f-0006Va-C7 for emacs-orgmode@gnu.org; Tue, 23 May 2017 15:07:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dDF9Y-0005Q1-VH for emacs-orgmode@gnu.org; Tue, 23 May 2017 15:07:34 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:33103) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dDF9Y-0005Pt-Du for emacs-orgmode@gnu.org; Tue, 23 May 2017 15:07:32 -0400 Received: by mail-lf0-x22b.google.com with SMTP id m18so55435367lfj.0 for ; Tue, 23 May 2017 12:07:29 -0700 (PDT) In-Reply-To: <874lybp5ua.fsf@nicolasgoaziou.fr> 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 --001a114b25ece4a456055035b2fe Content-Type: multipart/alternative; boundary="001a114b25ece4a450055035b2fc" --001a114b25ece4a450055035b2fc Content-Type: text/plain; charset="UTF-8" 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 ===== (Note that NEWLINE is not an inbuilt macro.) On Thu, Mar 30, 2017 at 5:06 AM Nicolas Goaziou wrote: > org-setupfile-ht -> org--setupfile-cache > > if it is meant to be inserted in "org.el" proper, or > `org-setupfile--cache' if you want to create a new "org-setupfile.el" > library. > I ended up updating org-file-contents. So now that is org--file-cache. > Nitpick : 'equal -> #'equal > Done. > Hash table to store SETUPFILE contents. > Done. > `org--setupfile-clear-cache' or `org-setupfile--clear-cache' depending > on the location of the function. > This is an interactive, a user-facing function; do we want to add double-dashes in that name? The function is now called org-file-clear-cache. > file path -> file name > Done. > > If SETUPFILE is a file path, use `org-file-contents' to get the file > > contents. > > Then, we might want to generalize `org-file-contents' instead (i.e., let > `org-file-contents' handle remote locations). WDYT? > That was my first thought, but was leery on modifying the org-file-contents. I have now done that. > Mind the double spaces at the end of sentences. > Done. > They are not equivalent, but could `org-file-remote-p', or > `file-remote-p' be used instead? > I tried (org-file-remote-p "http://foo.bar") but it returned nil. Looks like both org-file-remote-p and file-remote-p will not work for URLs. > > (cache (when (and is-url (not nocache)) > > (gethash setupfile org-setupfile-ht))) > > (cache (and is-url (not nocache) (gethash setupfile org-setupfile-ht))) > Of course :) > > (re-search-forward "\n\n") ; 2 consecutive new-line chars > `re-search-forward' -> `search-forward' > Correct, regexp is not needed in that case. > > (funcall (if noerror 'message 'error) > (if noerror #'message #'error) > Done. > > > "Unable to fetch SETUPFILE from `%s'" > > `%s' -> %S > setupfile is always a string so I used %s. If setupfile is not a string (may be nil?), then the very first string-match-p will through an error. Is there a specific reason for using %S? I did not use %S because I did not want the double-quotes to be printed around the string in the echo area. > > setupfile))))) > > (setq contents (org-file-contents setupfile noerror))) > > I think it is clearer if wrapped like this: > > (contents > (cond (cache) > (is-url > (let (url-retrieve-header) > ...)) > (t (org-file-contents setupfile noerror)))) > That indeed is pretty sweet. I have made that change. > > (when contents > > (save-excursion > > (insert contents))))) > > This may not be necessary at this point if we merge `org-file-contents' > with the above. > Correct. The attached patch has everything integrated in org-file-contents. > > Question: > > > > - All the places where the content of SETUPFILE is inserted in a temp > > buffer, it is assumed that the file is retrieved from disk and not from > URL. > > > > Example in ox.el: > > > > ((equal key "SETUPFILE") > > (let ((file > > (expand-file-name > > (org-unbracket-string "\"" "\"" (org-trim val))))) > > ;; Avoid circular dependencies. > > (unless (member file files) > > (with-temp-buffer > > (setq default-directory > > (file-name-directory file)) > > (insert (org-file-contents file 'noerror)) > > (let ((org-inhibit-startup t)) (org-mode)) > > (funcall get-options (cons file files)))))) > > > > > > Note the use of expand-file-name, (member file files), default-directory, > > (funcall get-options (cons file files)). > > (member file files), (cons file files) and `expand-file-name' are used > to avoid reading over and over the same setup file. In particular, they > prevent circular dependencies. > > You can ignore `expand-file-name' and replace `file' with `uri', i.e., > it is straightforward to extend the code to remote file names. > > `default-directory' is slightly more tricky, as it is used to properly > read recursively setup files with relative file names. I think our best > bet is to to check if current file name is local or remote, and ignore > `default-directory' setting in the latter case. > Do we need to update the code using org-file-contents in these places: lisp/org-capture.el 692: (setq txt (org-file-contents file)) lisp/ox-man.el 519: (setq code-block (org-file-contents out-file)) 764: (setq code-block (org-file-contents out-file)) contrib/lisp/ox-groff.el 1084: (setq code-block (org-file-contents out-file)) 1521: (setq code-block (org-file-contents out-file)) -- Kaushal Modi --001a114b25ece4a450055035b2fc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for the= detailed review.

I have attached a pa= tch following your recommendation. Please review it.

Here's a MWE to show the use of this new feature:

=3D=3D=3D=3D=3D
= #+TITLE: Heading{{{NEWLINE}}}Sub-heading
=3D=3D=3D=3D=3D

(Note that NEWLINE is not an inbuilt macro.)

On Thu, Mar 30, 2017 at 5:06 AM Nicolas Goazi= ou <mail@nicolasgoaziou.fr= > wrote:
org-setupfile-ht -> = org--setupfile-cache

if it is meant to be inserted in "org.el" proper, or
`org-setupfile--cache' if you want to create a new "org-setupfile.= el"
library.

I ended up updating org-file-c= ontents. So now that is org--file-cache.
=C2=A0
Nitpick : 'equal -> #'equal

Done.
=C2=A0
Hash table to store SETUPFILE contents.

Done.
=C2=A0
`org--se= tupfile-clear-cache' or `org-setupfile--clear-cache' depending
on the location of the function.

This i= s an interactive, a user-facing function; do we want to add double-dashes i= n that name? The function is now called org-file-clear-cache.
=C2= =A0
file path -> file name

Done.
=C2=A0
> If SETUPFILE is a file path, use `org-file-contents' to= get the file
> contents.

Then, we might want to generalize `org-file-contents' instead (i.e., le= t
`org-file-contents' handle remote locations). WDYT?

That was my first thought, but was leery on modifying the = org-file-contents. I have now done that.
=C2=A0
Mind the double spaces at the end of sentences.

Done.
=C2=A0
They are not equivalent, but could `org-file-remote-p', o= r
`file-remote-p' be used instead?

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (cache (when (and is-url (n= ot nocache))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(g= ethash setupfile org-setupfile-ht)))

=C2=A0 (cache (and is-url (not nocache) (gethash setupfile org-setupfile-ht= )))

=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(re-search-forward "\n\n") ; 2 consecutive new-l= ine chars
`re-search-forward' -> `search-forward'

Correct, regexp is not needed in that case.
<= div>=C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(funcall (if noerror 'message = 9;error)
=C2=A0 (if noerror #'message #'error)
<= div>

>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 "Unable to fetch SETUPFILE from `%s'"
=C2=A0 `%s' -> %S

=C2=A0
> setupfile)))))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(setq contents (org-file-contents setupfile = noerror)))

I think it is clearer if wrapped like this:

=C2=A0 (contents
=C2=A0 =C2=A0(cond (cache)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(is-url
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let (url-retrieve-header)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ...))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(t (org-file-contents setupfile noerror))= ))

That indeed is pretty sweet. I have = made that change.
=C2=A0
>= =C2=A0 =C2=A0 =C2=A0(when contents
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(save-excursion
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(insert contents)))))

This may not be necessary at this point if we merge `org-file-contents'=
with the above.

Correct. The attached p= atch has everything integrated in org-file-contents.
=C2=A0
=
> Question:
>
> - All the places where the content of SETUPFILE is inserted in a temp<= br> > buffer, it is assumed that the file is retrieved from disk and not fro= m URL.
>
> Example in ox.el:
>
>=C2=A0 ((equal key "SETUPFILE")
>=C2=A0 =C2=A0(let ((file
>=C2=A0 (expand-file-name
>=C2=A0 =C2=A0(org-unbracket-string "\"" "\"&qu= ot; (org-trim val)))))
>=C2=A0 =C2=A0 =C2=A0;; Avoid circular dependencies.
>=C2=A0 =C2=A0 =C2=A0(unless (member file files)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0(with-temp-buffer
> (setq default-directory
>=C2=A0 =C2=A0(file-name-directory file))
> (insert (org-file-contents file 'noerror))
> (let ((org-inhibit-startup t)) (org-mode))
> (funcall get-options (cons file files))))))
>
>
> Note the use of expand-file-name, (member file files), default-directo= ry,
> (funcall get-options (cons file files)).

(member file files), (cons file files) and `expand-file-name' are used<= br> to avoid reading over and over the same setup file. In particular, they
prevent circular dependencies.

You can ignore `expand-file-name' and replace `file' with `uri'= , i.e.,
it is straightforward to extend the code to remote file names.

`default-directory' is slightly more tricky, as it is used to properly<= br> read recursively setup files with relative file names. I think our best
bet is to to check if current file name is local or remote, and ignore
`default-directory' setting in the latter case.
Do we need to update the code using org-file-contents in these= places:

lisp/org-capture.el
692: = =C2=A0 =C2=A0 =C2=A0(setq txt (org-file-contents file))

lisp/ox-man.el
519: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0(setq code-block =C2=A0(org-file-contents out-file))
764: =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq code-block =C2=A0(org-file-contents= out-file))

contrib/lisp/ox-groff.el
1084: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(setq code-block =C2= =A0(org-file-contents out-file))
1521: =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(setq code-block =C2=A0(org-file-contents out-file))
<= /div>
--001a114b25ece4a450055035b2fc-- --001a114b25ece4a456055035b2fe 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: <15c36b4ba9ece4967311> X-Attachment-Id: 15c36b4ba9ece4967311 RnJvbSA5M2ZkYmM5NjUyN2I2M2IzY2ViOWMyNTcwODk1OGI5YWNjZDY2YzA2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBLYXVzaGFsIE1vZGkgPGthdXNoYWwubW9kaUBnbWFpbC5jb20+ CkRhdGU6IFR1ZSwgMjMgTWF5IDIwMTcgMTM6NDA6MjAgLTA0MDAKU3ViamVjdDogW1BBVENIXSBB bGxvdyBvcmctZmlsZS1jb250ZW50cyB0byBmZXRjaCBmaWxlIGNvbnRlbnRzIGZyb20gYSBVUkwK CiogbGlzcC9vcmcuZWwgKG9yZy0tZmlsZS1jYWNoZSk6IE5ldyBpbnRlcm5hbCB2YXJpYWJsZSB0 byBzdG9yZQpkb3dubG9hZGVkIGZpbGVzJyBjYWNoZS4KCiogbGlzcC9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biB1bmFibGUgdG8gcmVhZCB0aGUg RklMRQorZnJvbSBmaWxlIG9yIFVSTC4KKworSWYgTk9DQUNIRSBpcyBub24tbmlsLCBkbyBhIGZy ZXNoIGZldGNoIG9mIEZJTEUgZXZlbiBpZiBjYWNoZWQgdmVyc2lvbgoraXMgYXZhaWxhYmxlLiAg VGhpcyBvcHRpb24gYXBwbGllcyBvbmx5IGlmIEZJTEUgaXMgYSBVUkwuIgorICAobGV0KiAoKGlz LXVybCAob3JnLWZpbGUtdXJsLXAgZmlsZSkpCisgICAgICAgICAoY2FjaGUgKGFuZCBpcy11cmwK KyAgICAgICAgICAgICAgICAgICAgIChub3Qgbm9jYWNoZSkKKyAgICAgICAgICAgICAgICAgICAg IChnZXRoYXNoIGZpbGUgb3JnLS1maWxlLWNhY2hlKSkpCisgICAgICAgICBlcnIpCisgICAgKHBy b2cxCisgICAgICAgIChjb25kCisgICAgICAgICAoY2FjaGUpICAgICAgICAgICA7U2V0IGNvbnRl bnRzIHRvIGNhY2hlIGlmIGNhY2hlIGlzIG5vbi1uaWwKKyAgICAgICAgIChpcy11cmwKKyAgICAg ICAgICAobGV0ICh1cmwtcmV0cmlldmUtaGVhZGVyCisJCWNvbnQpCisgICAgICAgICAgICAod2l0 aC1jdXJyZW50LWJ1ZmZlciAodXJsLXJldHJpZXZlLXN5bmNocm9ub3VzbHkgZmlsZSkKKyAgICAg ICAgICAgICAgKGdvdG8tY2hhciAocG9pbnQtbWluKSkKKyAgICAgICAgICAgICAgOzsgVGFrZSBw b2ludCB0byBhZnRlciB0aGUgdXJsLXJldHJpZXZlIGhlYWRlcgorICAgICAgICAgICAgICAoc2Vh cmNoLWZvcndhcmQgIlxuXG4iKSA7MiBjb25zZWN1dGl2ZSBuZXctbGluZSBjaGFycworICAgICAg ICAgICAgICAoc2V0cSB1cmwtcmV0cmlldmUtaGVhZGVyIChidWZmZXItc3Vic3RyaW5nLW5vLXBy b3BlcnRpZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBvaW50 LW1pbikgKHBvaW50KSkpCisgICAgICAgICAgICAgIChtZXNzYWdlIHVybC1yZXRyaWV2ZS1oZWFk ZXIpIDtEdW1wIHRoZSBVUkwgcmV0cmlldmUgaGVhZGVyIHRvICpNZXNzYWdlcyoKKyAgICAgICAg ICAgICAgKGlmIChzdHJpbmctbWF0Y2gtcCAiSFRUUC4qXFxzLSsyMDBcXHMtT0siIHVybC1yZXRy aWV2ZS1oZWFkZXIpIDtVUkwgcmV0cmlldmVkIGNvcnJlY3RseQorICAgICAgICAgICAgICAgICAg KHByb2duCisgICAgICAgICAgICAgICAgICAgIChzZXRxIGNvbnQgKGJ1ZmZlci1zdWJzdHJpbmct bm8tcHJvcGVydGllcyAocG9pbnQpIChwb2ludC1tYXgpKSkKKyAgICAgICAgICAgICAgICAgICAg OzsgVXBkYXRlIHRoZSBjYWNoZSBgb3JnLS1maWxlLWNhY2hlJworICAgICAgICAgICAgICAgICAg ICAocHV0aGFzaCBmaWxlIGNvbnQgb3JnLS1maWxlLWNhY2hlKSkKKyAgICAgICAgICAgICAgICAo c2V0cSBlcnIgdCkpKQorCSAgICBjb250KSkKKyAgICAgICAgICh0IChpZiAoYW5kIGZpbGUgKGZp bGUtcmVhZGFibGUtcCBmaWxlKSkKKyAgICAgICAgICAgICAgICAod2l0aC10ZW1wLWJ1ZmZlcgor CSAgICAgICAgICAoaW5zZXJ0LWZpbGUtY29udGVudHMgZmlsZSkKKwkgICAgICAgICAgKGJ1ZmZl ci1zdHJpbmcpKQorICAgICAgICAgICAgICAoc2V0cSBlcnIgdCkpKSkKKyAgICAgICh3aGVuIGVy cgorICAgICAgICAobGV0ICgobXNnIChpZiBpcy11cmwKKyAgICAgICAgICAgICAgICAgICAgICAg IlVuYWJsZSB0byBmZXRjaCBmaWxlIGZyb20iCisgICAgICAgICAgICAgICAgICAgICAiQ2Fubm90 IHJlYWQgZmlsZSIpKQorICAgICAgICAgICAgICAoZnJvbSAoYnV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