From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id aDcDJq5SNmWhWQEAauVa8A:P1 (envelope-from ) for ; Mon, 23 Oct 2023 13:02:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aDcDJq5SNmWhWQEAauVa8A (envelope-from ) for ; Mon, 23 Oct 2023 13:02:06 +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 4D9A261114 for ; Mon, 23 Oct 2023 13:02:06 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698058926; a=rsa-sha256; cv=none; b=qj3O7MOTaDWLJnjnta+LUuDu4bIjcaKAWnhfxlVQbww15yPQ6lDXqnhKrcCws6QnAtjcNU UrTrrRWf3ouFgc13SdnpVDtIi3t+5elTQ9dgZ70PQNeHWybk3kP6j3XARyW7SFxCkVfKIp RfFaNk9paikm5cdbJzxPSKlwDzLh0+DytV7hCy6cprHj4wlHQ70p0dt/HO2Gn1FIF55pQL O2pfEothqHkn4UupBqJAgOlVnP47+BnBKKdfpmYAI812+kvuZvBRjtTLYJMh9B4o6Rdk7z A9SkQ45OXhD+a6F2NJacPU+KcR/qa0MKvX6JvV9ihs1lqfcduocdPXyWX+aBeQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698058926; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=2IY+cEvICSYh7VZHstSDG9HAfUlhDImFflaMdxMJCfg=; b=J0QoGJVHBuXWRRxyndwezJcTf52xT35kkFi0uDJqPeT4HEQKLrDZ/cn/pewOlMd2LyqUgy wdBGrBsGVdFR3FxgmZNKJqW5qyY4M0Z6niL4t25D11rMMtmIxTbvRw2vaW0jNuwblaBINF +DKEKRISVMwfl+GBbWl5nZgvd3lxsdjQNidSXGHzgRJC5vr3+5RUSWP5fWmPmmKb+gszwz LEwIwzQn8IgImct2h++ygLmFPs8BiZ4F8klfvm+fjvctubU0qwp5TeSWSTgC0ALZ/Q7vkw CrX6uvfKlX/8Vz2sdxP9SWVMLbE9wy8dlgAYuf11pC5fUbKe5dykoOk3ktvU1g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qusgA-0000s5-Sd; Mon, 23 Oct 2023 07:01:02 -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 1qusg9-0000rw-Et for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 07:01:01 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qusg7-0005zG-TO for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 07:01:01 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qusg5-0002OU-I9 for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 13:00:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [RFC][PATCH] Allow to export to ascii custom link types as notes Date: Mon, 23 Oct 2023 18:00:47 +0700 Message-ID: References: <874jijaukf.fsf@localhost> <8734y1aeae.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <8734y1aeae.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-Scanner: mx1.migadu.com X-Migadu-Spam-Score: 2.30 X-Spam-Score: 2.30 X-Migadu-Queue-Id: 4D9A261114 X-TUID: tt/Ova7ug+Hs On 23/10/2023 16:17, Ihor Radchenko wrote: > Max Nikulin writes: > > WRT cons vs. plist, I am mostly neutral. Slightly in favour of plist for > future extensibility. > > I am not sure what you mean by callback. Originally I had an idea that :export should call some function that adds a note to info. Now I have another proposal. Instead of returning a cons, :export function should return result of some new function, e.g. (org-ascii-make-link-with-note NOTE DESCRIPTION), so a `cons' or a plist becomes an implementation detail that may be changed any time. The only inconvenience is necessity to declare this function to allow lazy loading of ox-ascii and perhaps to avoid circular dependencies. > 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=man§ion=all) internal heading (See section 1) 1 Heading ═════════ --- >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. > > 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 square brackets around link descriptions, it is specifics of ox-ascii. Square brackets are sometimes added for inline links, sometimes they are not. Square brackets are always added for links as notes. I would avoid duplicated square brackets when links are formatted as notes and for inline links when description is formatted with brackets.