emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Dauer <mick.dauer@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Expand macros in links
Date: Tue, 27 Dec 2022 17:12:18 +0100	[thread overview]
Message-ID: <CAP7OBxKSehnuVWDCdMMUJ3_GNDH57qWh_bUiaNJVMF0Cr6fixw@mail.gmail.com> (raw)
In-Reply-To: <87lems26cl.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 1768 bytes --]

I'm aware of this theoretical conflict. But I see the risk as very low
compared to the value of not having to make a lot of customizations for
export and internal link handling. It should just work out of the box.

If you deem necessary there would still be the possibility to define a
global switch for this. This could then still have the 100% save default,
while still being easy to "configure".

If you want to go so far you could mitigate the risk of a conflict by
"escaping" the macro brackets. {{{{{{not-a-macro}}}}}} would be treated as
{{{not-a-marco}}} without expansion. Or any other escape sequence to bring
the conflict probability to 0.0000001.

Am Di., 27. Dez. 2022 um 16:51 Uhr schrieb Ihor Radchenko <
yantar92@posteo.net>:

> Michael Dauer <mick.dauer@gmail.com> writes:
>
> > I mean something like:
> > * Heading
> > [[http:abc{{{input-file}}}]
> >
> > When exporting it to html then the link is not replaced.
>
> This is to be expected, and I do think that Org is doing it right by not
> replacing macros in links.
>
> You cannot exactly control what is inside link path - if an actual
> website link happens to contain {{{...}}} pattern, you will have no
> options left how to prevent Org from replacing that pattern.
>
> If you want to generate link paths programmatically, you can instead
> define custom links types or link abbreviations. See
> https://orgmode.org/manual/Link-Abbreviations.html and
> https://orgmode.org/manual/Adding-Hyperlink-Types.html
>
> You can control custom link export as well.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

[-- Attachment #2: Type: text/html, Size: 2732 bytes --]

  reply	other threads:[~2022-12-27 16:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-27 15:22 Expand macros in links Michael Dauer
2022-12-27 15:30 ` Ihor Radchenko
2022-12-27 15:44   ` Michael Dauer
2022-12-27 15:50     ` Ihor Radchenko
2022-12-27 16:12       ` Michael Dauer [this message]
2022-12-27 16:20         ` Ihor Radchenko
2022-12-27 16:23           ` Michael Dauer
2022-12-27 16:27             ` Ihor Radchenko

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=CAP7OBxKSehnuVWDCdMMUJ3_GNDH57qWh_bUiaNJVMF0Cr6fixw@mail.gmail.com \
    --to=mick.dauer@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /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).