From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id CCEtJ2liNmUeFAAA9RJhRA:P1 (envelope-from ) for ; Mon, 23 Oct 2023 14:09:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id CCEtJ2liNmUeFAAA9RJhRA (envelope-from ) for ; Mon, 23 Oct 2023 14:09:13 +0200 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 50BD64401D for ; Mon, 23 Oct 2023 14:09:12 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YaJHMiVg; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698062952; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=A9WCjQeQg4LsIyxNkIJQsfHDMx90tSJGkm2UJ3TfOHU=; b=ITL8zZ2ZcNWJkO0hlbYRNEXuDtpKY2pj9kh2QrPXEkd66m35GKUBJxJrpfHmPMnQV+g2RO c8AyGMqYkJGceeSj8XP7JxWoO17nRfRW3X1wKCHHpf6b6z9y9WKKmiWRm74WJtxyDtx32y ubvQCS/dh//CSEzUQEI8KYrRzoMPOAIKUmlDCHcsXiWJHiIOUHe/7yK04HxeZdyst5OJgm AjUYYuLOJJEAi4gjLEzSpiASbNfjKTPYzv05aRGrbIApBf8DoHPKUL8P1VFBP0ZqwTY5CK n1jPH1caO0O1tOvIKCGHNIejYd3gqLhdJ5zdwTxSmI2hNUG7CI9un1U3SdQsIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=YaJHMiVg; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698062952; a=rsa-sha256; cv=none; b=b3lgwGZlOW6ehhYUpPlHGkB9Rp+JXo/bSnOwRKfKvW3zo7P/eyzfbzm5n3J108wffAct48 VAs065CDt8alNkSe+vODK9IFqV6geqgYxMrLg5yPmEe1xQrsyEXW6K55+esdyyrW4l7+8J 9ukFHYu0gt+gth2R/BteVj20bNxEsewhvAvQG7j0ythxKfwJLwUoSXzp0gjHikATr7O2dL TeAcDvOJDslpXZRjnOrHpiA8tV5M2VUbtIy4uer1/vaCo0fSj8S9equboBSd5ImJ7rMdy8 dUr2iN7CpveOHtYStELRXWTrNtAulOeeXhhX7QcOTN7UtYOH4U3brk4RP+lEmQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qutjA-0002vS-Ad; Mon, 23 Oct 2023 08:08:14 -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 1qutif-0002BZ-Bk for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 08:07:44 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qutic-0002bD-89 for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 08:07:40 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2CEB6240101 for ; Mon, 23 Oct 2023 14:07:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698062855; bh=+wuZpGYoQCye/d5hHUZ0jju0JRQPxrOwJaVETi/ge7k=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=YaJHMiVgmn9+9euV+Vz1YkwVBkvGDAMv61FYrKKOAGCVY25Yy5h/+rlKsLN4qX3dT txy2DybAZcTsIvAq+fueVSXGc14h9DTQdP+qtuv6OU+qcJ5/Fe9lCoB5fPmkx0AA2K V9Ym++j+0mdGzw1X8NscjODfJxh3fawYRoljhvI3D5bIk0VaOYTWRI3ihf6GzGFD+Z 7M7C4krrn2f3Hd414MeRvWK3/Twcu0ctzNUVx/dhueFqQqkd+wa/0ZTUDEM3tdepn3 feFN7bE2ZXiku5/AxOe6yI1uCR1Vd5PN/kb2t44qaDZezHXsW7UDuczf6GZjM3Gc0P 0Z6K9s2/qUJiw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SDYpt4sytz9rxK; Mon, 23 Oct 2023 14:07:34 +0200 (CEST) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [RFC][PATCH] Allow to export to ascii custom link types as notes In-Reply-To: References: <874jijaukf.fsf@localhost> <8734y1aeae.fsf@localhost> Date: Mon, 23 Oct 2023 12:09:17 +0000 Message-ID: <87lebt8rrm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 X-Migadu-Spam-Score: -9.30 X-Spam-Score: -9.30 X-Migadu-Queue-Id: 50BD64401D X-Migadu-Scanner: mx2.migadu.com X-TUID: J1ngEygICEMF Max Nikulin writes: >> I am not sure what you mean by callback. > > Originally I had an idea that :export should call some function that=20 > adds a note to info. Now I have another proposal. Instead of returning a= =20 > cons, :export function should return result of some new function, e.g.=20 > (org-ascii-make-link-with-note NOTE DESCRIPTION), so a `cons' or a plist= =20 > becomes an implementation detail that may be changed any time. Then, `org-ascii-make-link-with-note' may as well receive and modify INFO plist. This way, ((org-export-custom-protocol-maybe link desc 'ascii i= nfo))=20 cond form will work without changes as `org-ascii-make-link-with-note` will do all the necessary processing. > ... The only=20 > inconvenience is necessity to declare this function to allow lazy=20 > loading of ox-ascii and perhaps to avoid circular dependencies. This is not a problem. If lazy loading is desired, one may simply use (require 'ox-ascii) inside :export function to trigger loading when necessary. >> May you provide an example when the angle brackets are not added? > > angle and square brackets inconsistency > > --- 8< --- > # (require 'ol-man) > # (setq org-ascii-links-to-notes nil) > > - web :: [[http://orgmode.org][Org mode]] > - man :: [[man:man][man]] > - internal :: [[Heading][heading]] > > * Heading > --- >8 --- > --- 8< --- > web > [Org mode] () > man > man (http://man.he.net/?topic=3Dman§ion=3Dall) This is probably a bug in ol-man. > internal > heading (See section 1) I see no problem here - internal links are special, and it makes sense to drop angle brackets, unlike external web links that are often marked with angle brackets in the wild. > 1 Heading > =E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90=E2=95=90= =E2=95=90 > --- >8 --- > >>>>> + (if (string-match-p "\\`\u200b*\\[.*\\]\u200b*\\'" anchor) >>>>> + anchor >>>>> + (format "[%s]" anchor)) >>>> >>>> This is out of scope of the patch, isn't it? >>> >>> Not really. >>=20 >> Do you mean "this is out of scope"? > > I mean, it is a related change. E.g. ox-html and ox-latex do not add=20 > square brackets around link descriptions, it is specifics of ox-ascii.=20 > Square brackets are sometimes added for inline links, sometimes they are= =20 > not. Square brackets are always added for links as notes. I would avoid=20 > duplicated square brackets when links are formatted as notes and for=20 > inline links when description is formatted with brackets. I did not mean unrelated to ox-ascii. I meant unrelated to "add new feature allowing more flexibility for :export property of links when exporting to ASCII". I see handling anchors as a bugfix that should be discussed and committed separately. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at