From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wGv8Ip8Zq2NcHQAAbAwnHQ (envelope-from ) for ; Tue, 27 Dec 2022 17:13:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KJUVI58Zq2OXcwAA9RJhRA (envelope-from ) for ; Tue, 27 Dec 2022 17:13:19 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2AFBA369B1 for ; Tue, 27 Dec 2022 17:13:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pACZD-00018o-Te; Tue, 27 Dec 2022 11:12:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pACZA-00018f-JK for emacs-orgmode@gnu.org; Tue, 27 Dec 2022 11:12:36 -0500 Received: from mail-vs1-xe31.google.com ([2607:f8b0:4864:20::e31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pACZ7-0002kf-Jd for emacs-orgmode@gnu.org; Tue, 27 Dec 2022 11:12:36 -0500 Received: by mail-vs1-xe31.google.com with SMTP id o63so8240302vsc.10 for ; Tue, 27 Dec 2022 08:12:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SnhnNJo85KhL7LCoFsne6wZkX/mHSBKt2p5p+fYOsMY=; b=CHxY/yjKxD423RWeeGP0o8eED2LyCi8clT9rfmT+YdeKRQtS8QH+A0caVFi67IXlot WdhmoZqjLXmhVa98UNLzCIaGv4H8FPcnnj0p7QHs15y9z7g270gAAQEEbmAUbZ9e5rvu wZBViEEucPQ9PVaV42s5851QEPj2+UDOeulQQwLKitCvcf4ZG+1zbf+afda3EDs1qej6 q1ZXZziN7skRR+OLP4MN53doa9egaN4W81G4bbRkzl+UHRvZB3vFChQmb3r0eY4ZX0tX RXv3pbWbOOnaoJykhbK7OPfIaJPVCDFEOFzxQ/uM838aX0eHhmB/YID3KloM5kETbycU ypRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SnhnNJo85KhL7LCoFsne6wZkX/mHSBKt2p5p+fYOsMY=; b=pHJmy4P2JmBkhLLRCNndtC3brBTR3Nn3vzKhnN2Cq8+qB7kP+V8lFJAJ13pxOxpZjX Hes7xMORSXDiuJRLQUIq6KJRc+iHbJ6bCWAQ9FWPwleBYU1QWH2Av9dUoAWzFLmggEFs xSMbHvFAM4wKJWElQTIIBIeRINrZK2oBMGYDQHkxZ51FbwgKxkzajXviQRRcfxjjUt4L QmmR0BB5BVUoDHAanQS8djtIz3A8bMPurioqmHyTPuy8IFgx/Mg2Qwb0/9OVLPx485iu 2KCETcdfCP6N3yAIHAm5t+mOVORg3H/Shz6wbYExGPxHdiMkqV5utxSx2gqr1n+yrT4W uufA== X-Gm-Message-State: AFqh2kpjxqH8ysjmW5Xit6kVHO4Gu7KWdNiEQEaPVXQsiC1W1OoGs59F lIonDQBwKFlIG2EgWqciFdBjbHrBANWTP6auQAg= X-Google-Smtp-Source: AMrXdXu9+k5qgvHldHlcI/SsbDaVPVpVHRV/GGR4saQCDzA11tniikQI9NgDi8L6yBar9zUXekbE2l89UG/s8pj3P4Y= X-Received: by 2002:a05:6102:19a:b0:3c5:796a:c2a1 with SMTP id r26-20020a056102019a00b003c5796ac2a1mr1276637vsq.57.1672157549557; Tue, 27 Dec 2022 08:12:29 -0800 (PST) MIME-Version: 1.0 References: <87o7ro27ap.fsf@localhost> <87lems26cl.fsf@localhost> In-Reply-To: <87lems26cl.fsf@localhost> From: Michael Dauer Date: Tue, 27 Dec 2022 17:12:18 +0100 Message-ID: Subject: Re: Expand macros in links To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000bffa0b05f0d1845d" Received-SPF: pass client-ip=2607:f8b0:4864:20::e31; envelope-from=mick.dauer@gmail.com; helo=mail-vs1-xe31.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672157599; a=rsa-sha256; cv=none; b=LP8EKKdRDusrQct3NpDGbi0xGdVoFKEoJxq8mYmnGrZq5xe9DTtlKnYdHbDPPbuLZxNHr8 tmz71ndYmPR90orXsdCZ76j8ppLbsO5Vh4CxPIAeGfGbkLHg90cR99XmVbFWN++RS3TvSB V1hdrt0hKxbjjaIN2IYI8iamjUepbG3R9EXHuEgl85n5jXqT2IJrI2ckXUlNTUPubW3oiv mvfUAFWYrGAWmmF5c/OwvW1xK6JJ3W4RR1YKm1vdm4+35shojLNT9pwoJJOIwIb8orYlF1 KTj9LsTPloYgh4qtUR8v3AZlEj3akoOsg5iR6O0S1Ky5szZUqr7awtoV2NvrQQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="CHxY/yjK"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672157599; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SnhnNJo85KhL7LCoFsne6wZkX/mHSBKt2p5p+fYOsMY=; b=XGig+fxTfUO/bxkpHXwoZlf7uAeLgip5tarnYxYih0B027bdXy4jjPP4breOX8NNjqhreX adgHgtI6Rk7bZ4KQ9hWV03Hp/XoMZ/vHswpXZpwPaFYHNhVfds+oSlh2IxDDagNHe5Nvtv Dnq5Nojw32yLMN6NUjOPubHVVt7m6e3HR4iCRqBLoWlFOxdbbH7IrTDLfpUa1Do24yhnIX 9h5p0ZDc0Ptb1YLh+caBucNcnTsjj6rRPqcvD6AONVcbvrSZyRQOrJ6K2ayRZBGGAW08K/ b77kxn7GqbhwThj80dn3nYSTPUV22L3XPNfdhS46ydmPUZLVbJDkIVkvgzPZQA== X-Spam-Score: -5.70 X-Migadu-Queue-Id: 2AFBA369B1 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="CHxY/yjK"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -5.70 X-TUID: xdtyBxEAoA8u --000000000000bffa0b05f0d1845d Content-Type: text/plain; charset="UTF-8" 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 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 . > Support Org development at , > or support my work at > --000000000000bffa0b05f0d1845d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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 custo= mizations for export and internal link handling. It should just work out of= the box.

If you deem necessary there would still be the= possibility=C2=A0to 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=C2=A0could mitigat= e 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=C2=A0to 0.00= 00001.

Am Di., 27. Dez. 2022 um 16:51=C2=A0Uhr schrieb Ihor Radchenko = <yantar92@posteo.net>:
=
Michael Dauer <<= a href=3D"mailto:mick.dauer@gmail.com" target=3D"_blank">mick.dauer@gmail.c= om> 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-Ty= pes.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>
--000000000000bffa0b05f0d1845d--