From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uM0TL4ZWNWV+jwAAG6o9tA:P1 (envelope-from ) for ; Sun, 22 Oct 2023 19:06:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uM0TL4ZWNWV+jwAAG6o9tA (envelope-from ) for ; Sun, 22 Oct 2023 19:06:14 +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 83D1246697 for ; Sun, 22 Oct 2023 19:06:14 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697994374; 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=SLavAilwgUmrblhIQkriI2+PGifW5xMNTCulUNKmRaw=; b=BNL2ByDpYMYLaJva4CyjhxyZRZ5N7OPoyET2+aDEB/CyPEPQN4MLkBAEmlF9n8Opvlnrx3 DTdPS+U3XrIA1V/UfYQ+n6CVWV2V3mQXJN4wZ7oh7ZOG5afudTbCIXxC1EkQARVGX2Qmrp bg2sCx9La3+9gTn/wCX1xAs2oZiRl65oPfaGb9AXI0mwCFYl2ZwyQDyU/UubwFGXmtLGof sXiHQV2HdVLwhmF+a8jqxJR/WG3UKbdzgN6sfj0R5mNdwpDwvEI00gmaIW0o7cAbLOC52i twFP58VAsHPZa9k7wCXC8VzJJj9rMGSL7AnA9z2i065+HOPVC1RsvtoqdvIbDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697994374; a=rsa-sha256; cv=none; b=M3feD+62MatWMI7dAqzb4Tb0YILEQqenLKBi5Fd5ujHyJLj5Lsp1rtAl059n3E0Fs9PBhz NksSxvos2f+qPd+3XEcEDgSW8MLHUX+w1PfHySffVEaWwUoRdlDsuLlYrRFwEBEkP8Szsg 1mvmm/vhAWneP/izkMYn6W+z4u9bT2jGGPxZI/G7XppuejT3dMVQi1fPBslbSiE4VAuagO I8fX6s24kdgv7dk+1W5HLo9aJjey3D3E0cqsmv94sLhWKIXrmEfjGm7j15hEB36aotG4KT tT4hBAuF052yQ+lppAcQ+q6jybaeAWIZQJILcUMyMZ7nXxalvOJx7lmcegdGyQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qubth-000161-LG; Sun, 22 Oct 2023 13:05:53 -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 1qubtg-00014h-5Y for emacs-orgmode@gnu.org; Sun, 22 Oct 2023 13:05:52 -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 1qubte-0005hA-JI for emacs-orgmode@gnu.org; Sun, 22 Oct 2023 13:05:51 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qubta-0002fM-So for emacs-orgmode@gnu.org; Sun, 22 Oct 2023 19:05:46 +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 00:05:35 +0700 Message-ID: References: <874jijaukf.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <874jijaukf.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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -0.61 X-Migadu-Queue-Id: 83D1246697 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -0.61 X-TUID: bIaIdVH/WoJ7 On 22/10/2023 16:13, Ihor Radchenko wrote: > Max Nikulin writes: > >> For ascii backend :export function from `org-link-parameters' may return >> (PATH . DESCRIPTION) `cons' instead of string. > > This is non-standard. We should document it somewhere in the manual. Currently the question is whether it is acceptable or it should be changed to e.g. plist or even to use a callback. >> I believe that parenthesis should be skipped in the case of angle >> brackets "()", but I do not change this behavior. There is some >> inconsistency in respect to brackets for description of inline links, >> but it is preserved as well. > > May you elaborate? I believe, parenthesis are not necessary when angle brackets are added around URI. Anyway currently behavior is not consistent and angle brackets are not added in some cases. I would prefer to stick to angle brackets and to drop parenthesis when <> are present. >> I do not like that :export functions are called twice: for text and for >> note. In my opinion it is better to collect links in a property of INFO >> to later format notes at the end of the heading. I would consider more >> dense style of notes with list markers instead of empty line as separator. > > Again, may you elaborate? List of links is added by `org-ascii--describe-links' that iterates over links earlier handled by `org-ascii-link', so :export function is called twice for each link having this property. I would consider collecting links in some property of the INFO argument instead. As a result `org-ascii--describe-link' would reuse results of formatters called by `org-ascii-link'. Currently list of links is formatted as [Description 1] [Description 2] From my point of view it would not harm to have more dense formatting - [Description 1] - [Description 2] >> + (if (string-match-p "\\`\u200b*\\[.*\\]\u200b*\\'" anchor) >> + anchor >> + (format "[%s]" anchor)) > > This is out of scope of the patch, isn't it? Not really. > I can see the motivation, but we should probably move this change to a > separate patch and discussion thread. In the case of inline links brackets are sometimes added around description, sometimes not. To keep current behavior I have decided that it is better to suppress duplicated brackets implicitly than to add an extra argument that controls adding [] explicitly. I do not insist on "\u200b*" that allows to handle duplication due to brackets in Org documents [[https://orgmode.org][\u200b[Org]\u200b]]. However I would prefer to keep the regexp for the case of brackets added by link formatters.