From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 WBh0DAQ6NmXs8gAAauVa8A:P1 (envelope-from ) for ; Mon, 23 Oct 2023 11:16:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WBh0DAQ6NmXs8gAAauVa8A (envelope-from ) for ; Mon, 23 Oct 2023 11:16:52 +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 809586B0C7 for ; Mon, 23 Oct 2023 11:16:51 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=NySDZVUt; 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=1698052612; 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=Z27KV9uyCzNUA9jqNZhLe9uDA+cvevhRqNlUqUyGoSA=; b=isiQMky8rE2A6wf+Eulfswmsu4IU2+ij9I7myKv74MwMggnkiaEey6NQs/Z6dAMthNuof7 hMcWrbugxqvI6aa/w7qPHNd3E+TV8d4lg4b0ZkiGslL8N35QwZtAFIiZMOuxBbRUEY/Kut rfpbogXCYEbHGewWxVW1mVAPj7+oU211UgZLleRdCvRUsr0MAvXHVFMRHA4ODW9kxbveHi +Y85zpQZG4f0GOQXQx8O93uiEuTaIQYa28eKrcjCo1nkrirTc9GXwZ6xbBF91YYe24ND0w t3UdEzo74LCR+9Q4kP/5/JHw+AKW08d8cr9kwZY/W7SeBCN+0ArntpQhANCc9Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698052612; a=rsa-sha256; cv=none; b=gHpM0qdkIO9+rQBMvclNUdYtMJ+8Yh78B5eut2KVF/XU95t2LcNGhCnDT452FT1sbATycc tEnL4zDoT/S4wkLX9DPzZKCrqrRwMomwTJ7InkJU0l6Bn/fO2bzRa5vuIHxsNoW7XcNSh0 gE85QtQJlkq5+Rcy1FNrREaDij8oyYhIygGi9InezrPWD9LAD7BBkz3q13VWxTCr0FFT/X vMvIUhGK+fK6a+DbFWEHMAVWxxgkIbiCp81eTS6QtL6eCkslqNOcpq9JTmyMzFplhHTNtE rUkSmcCT0GLAoNWBsMYvyi04aK2TOvmVoqmYYtlCwPNFTkI9SBlsSoNGORM3+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=NySDZVUt; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qur2R-0006sa-W5; Mon, 23 Oct 2023 05:15:56 -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 1qur2O-0006sL-Vb for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 05:15:53 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qur2L-000178-Hq for emacs-orgmode@gnu.org; Mon, 23 Oct 2023 05:15:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id D14D7240027 for ; Mon, 23 Oct 2023 11:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1698052546; bh=iNYiHX6Uw2P52Su77J1+my4qmnAOs01MU/Gn3kKLw4Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=NySDZVUtnqZZVrQvkSGfgRYBcvp7YSAl5YrHfQB6rpnnhKUXO6iJQ9gO+A7lJXXoG IWFKbSPo3zF5TcmkyDSBrdv18SxkW9EUU+gFnvfDlI473YxTssdkZkrzP9p545K+dZ Z5MwmzRUgoJ+YtPZ3bdLZCsVLnu1zsBJiNz0ZuICCOYs2TBkXb/+xLipXBhIl+NE98 kfkXjnfWjRoDIQwevwAlI9GXO/eKZDf7xPWKtMkIH1IZ/fALI+lDCYTnz3OGjbFPky jLb9E7HmF0YTx1NHnhqSvA8o64CsXMPYxN34SBFHpycqTjwTL25p1aDzIL6/duvXJ3 NfDKyW31S54Yw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SDV0f2xpBz9rxQ; Mon, 23 Oct 2023 11:15:46 +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> Date: Mon, 23 Oct 2023 09:17:29 +0000 Message-ID: <8734y1aeae.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -9.31 X-Migadu-Queue-Id: 809586B0C7 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -9.31 X-TUID: iwJpI8eWcM1d 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 see no problem with special return value of the link :export function. In fact, I thought of similar approach globally, allowing :export function to return AST data that will be further processed. 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. >>> 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. May you provide an example when the angle brackets are not added? >>> 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'. It is already the case. `org-export-data' maintains export cache under :exported-data hash table in INFO plist. So, the second call to `org-export-data` will be cached. > 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] I see no reason to change the existing behaviour here. Yes, I do not see much harm, but changing the defaults is something we should only do when there is a clear benefit. Harm may not always be anticipated by us in advance. >>> + (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 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. May you show an example? > ... 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. I do not think that we need to handle zero-width spaces on backend level. If we want to deal with them, it should be done globally, in ox.el. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at