emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Oleh Krehel <ohwoeowho@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: Conditional link export?
Date: Sun, 08 Nov 2015 18:03:39 +0000	[thread overview]
Message-ID: <87si4gs70k.fsf@gmail.com> (raw)
In-Reply-To: <874mgwd1mi.fsf@gmail.com>

Hi Oleh,

2015ko azaroak 8an, Oleh Krehel-ek idatzi zuen:
> 
> Aaron Ecay <aaronecay@gmail.com> writes:
> 
>> Extra elisp inside the org file is an important way of extending the
>> power of org markup.  Why don’t you want to use it?
> 
> 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?
> 
> 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’m not sure I understand you.  You’re against putting elisp 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.

> 
>> Not in general.  For small pieces of text, you can use macros.
>> Something like:
>> 
>> #+macro: ifinfo (eval (if (org-export-derived-backend org-export-current-backend 'info) "$1" "$2"))
>> 
>> {{{ifinfo([[info:emacs#Pachages]],[[https://....]])}}}
> 
> The macro definition and call syntax looks very ugly.

For aesthetic considerations when editing, check out
‘org-hide-macro-markers’.

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’s org-dp library might provide you a base on which to
build such functions, if you’re motivated.
<https://github.com/tj64/org-dp>.  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,

-- 
Aaron Ecay

  parent reply	other threads:[~2015-11-08 18:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 13:02 Conditional link export? Oleh Krehel
2015-11-06 13:24 ` Aaron Ecay
2015-11-06 13:26   ` Aaron Ecay
2015-11-07 13:05   ` Oleh Krehel
2015-11-07 14:21     ` Aaron Ecay
2015-11-07 16:23       ` Achim Gratz
2015-11-08 14:09       ` Oleh Krehel
2015-11-08 14:27         ` Nicolas Goaziou
2015-11-08 14:56           ` Oleh Krehel
2015-11-08 15:04             ` Nicolas Goaziou
2015-11-08 15:35               ` Oleh Krehel
2015-11-08 16:06                 ` Nicolas Goaziou
     [not found]                   ` <m2k2ps9x9o.fsf@andrew.cmu.edu>
     [not found]                     ` <8737wg6zi3.fsf@nicolasgoaziou.fr>
     [not found]                       ` <m2ziy6vsw2.fsf@andrew.cmu.edu>
     [not found]                         ` <87io4tpsu2.fsf@nicolasgoaziou.fr>
2015-11-22 23:08                           ` John Kitchin
2015-11-08 18:03         ` Aaron Ecay [this message]
2015-11-06 13:28 ` John Kitchin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87si4gs70k.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ohwoeowho@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).