From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id EL8nGFPjvmbg7gAAe85BDQ:P1 (envelope-from ) for ; Fri, 16 Aug 2024 05:27:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id EL8nGFPjvmbg7gAAe85BDQ (envelope-from ) for ; Fri, 16 Aug 2024 07:27:47 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=I7qOQ0xg; 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=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723786067; h=from:from:sender:sender:reply-to: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=4oym1rqOjDCJSVrXzktNYBheBV8F5h6BYX3oDa/P5aU=; b=HuYiliNmy9XfsR86z6eX2JI9UDyw7IZbFn64XxOWQVnlRImunbw+v9XrIO4JUGCe33L9nq o+h46ikwOGrV7iZ5Owhozdfpa3UsSzMVfkp1zFe9gJABEdVPzb664K+Inb2cdYbZ8KEDne 3hnp3svDNSCU6NBUzFJwyr8FPhZT9YXpcy6p1FfmuvPMk3VVw0qBMuquYQ7Ji85u3xgaBr dAR+9cEr4HCMbjFLrmZpvSBU9cisFJy9THb9g2PT5DqnSD9bJnsYIlNtJTk7+Wuxc+p02H FILK8ZmywORmnPs/3C+4VIbrHLp4HE5TWjmKav/wlZGTPafIk64ymOukgHvBew== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=I7qOQ0xg; 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=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723786067; a=rsa-sha256; cv=none; b=s5qQyt7kV9vr337XUWBIKjDmWON8PpO02pHBaqsodRTOZHnpBJMGFZsPFkQ8gLLrjrqLzK YwcG2u3YET1s+s25Fu66s5hDkQqGZUG+ySapfoDHQwONH8CwG76BAAs91979OOwLm5cAf+ AudZPBXYFZNMudIcwb8ToPvusq8c8a4WDiH6+WmY9GvKV7Vaodx/8eFUADHloCHYgg8vqq EKU2BvHMR8apXQtQ5Q4vDRWtvu3P2yiREqgHcrkgb4MGNO47Nj1KZCwc/3p5nr3jYiN8k5 9w4ZErEl1FekKr8GJQOBXU4WT5kGcHSO014K0ifBbADn8vM0tsc9vBUNMsN23w== 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 97BAE258DB for ; Fri, 16 Aug 2024 07:27:46 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sepUJ-0006Yr-FY; Fri, 16 Aug 2024 01:26:59 -0400 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 1sepUH-0006YP-A1 for emacs-orgmode@gnu.org; Fri, 16 Aug 2024 01:26:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sepUH-0005lC-0K for emacs-orgmode@gnu.org; Fri, 16 Aug 2024 01:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=To:Subject:Date:From:In-Reply-To:References: MIME-Version; bh=4oym1rqOjDCJSVrXzktNYBheBV8F5h6BYX3oDa/P5aU=; b=I7qOQ0xgKvAi /c0RvWAnS85PjrOUdM15JKlk1AgkscAuTaSF+tVNg1dr7RGZWleMB5ovkBWiAVAtMOHqtydWtr1TH ASuq3c+93cxjg5yHjJon9q6T5adSN3wbrg0i1UuOTXPPB8A0xxbHqYjiHjZ6pa/ZoAhcu725nvc0q Qkm/oN9nYwweUUr7V6QmHReZitcxC61ZhkeHvoDGsgJT8aELzYuIRHb8WMoiy9MqpIImVFkM9LGpo V5KrNgDvp1cGdjnHcHpg8KOoKmx2nZTo1pXY+j/Klr2Yte+Y8hPQLHtZD9C1Wk64wlG7P+u+oTKlj PP/cZU+xXwFJHmaCn2TF/Q==; X-Gm-Message-State: AOJu0YxeUvHgwY+8y+Tat24yJy1P1NMvkNO63IzGVoVcsHm0Q0Y44aOY KyeLIVlU5+Et1FBpMnLdAti5z2PdLggKRLTwyCu35F8ftWeHIFUxIlmQY9aO58xVziQtOyCrZZ+ 5E32UKHz2o8dnyLd88V67PzztaSw= X-Google-Smtp-Source: AGHT+IHR8ASeU3uxeG8f9EM7wNbukNR+yVE5Olg6aexIlgSPW1HFBcbNPuB9TK7YrU7n2r9sYkZWX8bCnuSF/SLCgzM= X-Received: by 2002:a05:6102:5127:b0:493:977c:5f11 with SMTP id ada2fe7eead31-497799e6ac3mr1303690137.5.1723786016074; Thu, 15 Aug 2024 22:26:56 -0700 (PDT) MIME-Version: 1.0 References: <87ikwxmszy.fsf@localhost> In-Reply-To: <87ikwxmszy.fsf@localhost> From: Robert Weiner Date: Fri, 16 Aug 2024 01:26:30 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: How to fully control parsing of Org mode links during export To: Ihor Radchenko Cc: emacs-org list Content-Type: multipart/alternative; boundary="000000000000283a3f061fc635f4" 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: , Reply-To: rswgnu@gmail.com 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 X-Spam-Score: -10.00 X-Migadu-Queue-Id: 97BAE258DB X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -10.00 X-TUID: 2QAs41ADXoK3 --000000000000283a3f061fc635f4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you for the pointers on this, Ihor. That led me down a much better path that worked. In the end, I just had the export function for my specific link type and had to add a before advice on org-element--generate-copy-script since it lacks a hook at its end. I would suggest adding one as this seems to be the place if you want to change the markup in the copied buffer before Org formats it for export. Is there any other existing hook that runs before formatting in this copied buffer? Thanks. -- Robert On Mon, Jul 22, 2024 at 9:53=E2=80=AFAM Ihor Radchenko wrote: > Robert Weiner writes: > > > I could really use some help from Org export experts. I have > > been trying to tweak export link parsing to do what I want > > without any success. Here is a summary of the issues and related > > questions I have. > > You generally should not need to modify the _parser_. > What you may need to do is modifying the exporter. > For example, by defining a custom export backend. Or export filter. > See "13.17 Advanced Export Configuration" section of the manual. > > > 3. When exporting from an Org file and I have defined the html export > > syntax for mytype: to html, I want this: > > [[mytype:MyLink]] > > [[Testing]] > > to be converted into this: > > MyLink > > Testing > > but instead Org export produces: > > MyLink.html">mytype: > href=3D"Testing.html">Testing > > This has nothing to do with Org mode exporter. What is produced for > custom link types totally depends on the custom :export function you > defined for your link. > > > 2. How can I get the exporter to run in my current Emacs process and > > spawn a new Emacs so that I can easily debug in-process? I think I > have > > turned off the async export option but it still runs async and I can= 't > > step through the exporter functions. > > Async is disabled by default. So, something in your config enables > it. > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000283a3f061fc635f4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you for the pointers on this, Ihor.=C2= =A0 That led me down a much better path that worked.=C2=A0 In the end, I ju= st had the export function for my specific link type and had to add a befor= e advice on org-element--generate-copy-script since it lacks a hook at its = end.=C2=A0 I would suggest adding one as this seems to be the place if you = want to change the markup in the copied buffer before Org formats it for ex= port.=C2=A0 Is there any other existing hook that runs before formatting in= this copied buffer?

Thanks. -- Robert

On Mon, Jul 22, 2024= at 9:53=E2=80=AFAM Ihor Radchenko <yantar92@posteo.net> wrote:
Robert Weiner <rsw@gnu.org> writes:

> I could really use some help from Org export experts.=C2=A0 I have
> been trying to tweak export link parsing to do what I want
> without any success.=C2=A0 Here is a summary of the issues and related=
> questions I have.

You generally should not need to modify the _parser_.
What you may need to do is modifying the exporter.
For example, by defining a custom export backend. Or export filter.
See "13.17 Advanced Export Configuration" section of the manual.<= br>
> 3. When exporting from an Org file and I have defined the html export<= br> >=C2=A0 =C2=A0 syntax for mytype: to html, I want this:
>=C2=A0 =C2=A0 =C2=A0 [[mytype:MyLink]]
>=C2=A0 =C2=A0 =C2=A0 [[Testing]]
>=C2=A0 =C2=A0 to be converted into this:
>=C2=A0 =C2=A0 =C2=A0 <a href=3D"MyLink.html">MyLink<= /a>
>=C2=A0 =C2=A0 =C2=A0 <a href=3D"Testing.html">Testing&l= t;/a>
>=C2=A0 =C2=A0 but instead Org export produces:
>=C2=A0 =C2=A0 =C2=A0 <a href=3D"<a href=3D"MyLink.html&= quot;>MyLink</a>.html">mytype:<a
> href=3D"Testing.html">Testing</a></a>

This has nothing to do with Org mode exporter. What is produced for
custom link types totally depends on the custom :export function you
defined for your link.

> 2. How can I get the exporter to run in my current Emacs process and >=C2=A0 =C2=A0 spawn a new Emacs so that I can easily debug in-process?= =C2=A0 I think I have
>=C2=A0 =C2=A0 turned off the async export option but it still runs asyn= c and I can't
>=C2=A0 =C2=A0 step through the exporter functions.

Async is disabled by default. So, something in your config enables
it.

--
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>
--000000000000283a3f061fc635f4--