From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: Conditional link export? Date: Sun, 08 Nov 2015 18:03:39 +0000 Message-ID: <87si4gs70k.fsf@gmail.com> References: <87ziyri8lk.fsf@gmail.com> <878u6buupy.fsf@gmail.com> <87d1vmgdt6.fsf@gmail.com> <87fv0hubym.fsf@gmail.com> <874mgwd1mi.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvUJd-0003Gc-A8 for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 13:03:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvUJa-0003vE-2O for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 13:03:45 -0500 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:38679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvUJZ-0003v9-Si for emacs-orgmode@gnu.org; Sun, 08 Nov 2015 13:03:42 -0500 Received: by wicli17 with SMTP id li17so3230043wic.1 for ; Sun, 08 Nov 2015 10:03:41 -0800 (PST) In-Reply-To: <874mgwd1mi.fsf@gmail.com> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Krehel , emacs-orgmode@gnu.org Hi Oleh, 2015ko azaroak 8an, Oleh Krehel-ek idatzi zuen: >=20 > Aaron Ecay writes: >=20 >> Extra elisp inside the org file is an important way of extending the >> power of org markup. Why don=E2=80=99t you want to use it? >=20 > Including boilerplate Elisp, all subtly different into each markup > document, just to extend the markup with the syntax that it should have > in the first place anyway. Doesn't that sound bad to you? >=20 > One-off Elisp inclusions relevant to a single document are great and > powerful, but adding boilerplate code, usually more of it that the whole > sum of the markup, doesn't sound great at all. This could be rectified > somewhat by using `require', but then we don't have a self-contained > document any more. Which is important to facilitate sharing and re-use > of Org-mode documents. I=E2=80=99m not sure I understand you. You=E2=80=99re against putting elis= p into the document, but that seems like the main thrust of your proposal. You also want self-contained documents, but insofar as these rely on new features being added to org, they will introduce dependencies on specific org versions, which is an potential obstacle to sharing and reuse. >=20 >> Not in general. For small pieces of text, you can use macros. >> Something like: >>=20 >> #+macro: ifinfo (eval (if (org-export-derived-backend org-export-current= -backend 'info) "$1" "$2")) >>=20 >> {{{ifinfo([[info:emacs#Pachages]],[[https://....]])}}} >=20 > The macro definition and call syntax looks very ugly. For aesthetic considerations when editing, check out =E2=80=98org-hide-macro-markers=E2=80=99. I think Nicolas gave you very thorough responses to the rest of your proposal. Just a one more additional comment. [...] > 2. Something like `ox-link' isn't built-in. Thorsten Jolitz=E2=80=99s org-dp library might provide you a base on which = to build such functions, if you=E2=80=99re motivated. . The readme is a little dense IMO (the docstrings are better), but you should be able to do something like: (defun ox-link (dest) (let* ((elements (split-string dest ":")) (type (nth 0 elements)) (path (mapconcat #'identity (cdr elements) ":"))) (org-dp-create 'link nil nil :type type :path path))) If you build a library of such functions and they prove useful, we could put them in org-contrib and (eventually perhaps) into core. Hope this is helpful, --=20 Aaron Ecay