From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0CvgLSRGAmNZigAAbAwnHQ (envelope-from ) for ; Sun, 21 Aug 2022 16:50:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AKjQLCRGAmMSQwEAG6o9tA (envelope-from ) for ; Sun, 21 Aug 2022 16:50:12 +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 6BD8610C06 for ; Sun, 21 Aug 2022 16:50:12 +0200 (CEST) Received: from localhost ([::1]:53796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPmHD-0001xc-JL for larch@yhetil.org; Sun, 21 Aug 2022 10:50:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPmGK-0001xS-M8 for emacs-orgmode@gnu.org; Sun, 21 Aug 2022 10:49:16 -0400 Received: from ciao.gmane.io ([116.202.254.214]:59342) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPmGJ-00047E-5i for emacs-orgmode@gnu.org; Sun, 21 Aug 2022 10:49:16 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1oPmGH-0004N5-C3 for emacs-orgmode@gnu.org; Sun, 21 Aug 2022 16:49:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [PATCH v2] ol-info: Define :insert-description function Date: Sun, 21 Aug 2022 21:49:05 +0700 Message-ID: References: <87zgl1npow.fsf@localhost> <87tu7gkb4l.fsf@heagren.com> <87y1ws6o0c.fsf@localhost> <87k08bjw0t.fsf@heagren.com> <47248a4f-10aa-0980-c054-563f30c05aaa@gmail.com> <87mtd0gthe.fsf@heagren.com> <78b97c9e-fced-0ee4-f3f2-3cbe81080ffa@gmail.com> <87sfms9dx7.fsf@localhost> <87v8rmd53g.fsf@localhost> <871qu9xv8q.fsf@heagren.com> <0da49392-26c6-8ba3-f657-647522d59342@gmail.com> <87zggrg2om.fsf@heagren.com> <87edy3t8o0.fsf@localhost> <87tu6zf2o1.fsf@heagren.com> <871qu3rpt9.fsf@localhost> <8bbccdb4-52f4-b9b5-eb10-252bb15108ec@gmail.com> <87a68hn9es.fsf@localhost> <87zgg0q2kz.fsf@localhost> <877d33nzjd.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US In-Reply-To: <877d33nzjd.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.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661093412; 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=U3fTpbkFk7vtv3XjB9Fjvc+sgr9jgh0jcuNsALyvXTQ=; b=gCNWkBliGvs3U1woubAWfh9YiQaPEgiE1+8micCiV2wK6GVXe6wXvl+MvVNC6WKIR4XgYl dTqflRuE5yLNqHSDEaC962e1D3E6m6KL4I5SDURCZtBgC9Fiiawow+nf1kQ78O5JnHJyu3 1BUFvU22TdpBkq8O5Z61iT4VTxqFBHG/kyMKl+aibGHR0qkAyLi1PO62EdMOZSfyDeS/Mj K6qETeQ3bxyPHUOCNE/IMzHMf9dtJfTWBFomePekjdphe/8MPPR4qpaIJPRXzFd5MjlDrP Uufunh7wwxgHzwBz2ugW+IylrLpBoM2msQQ623ct/mzmKCqjPl5ZDsDFm29FKA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661093412; a=rsa-sha256; cv=none; b=ATh5G/qTJU4LtjRz9ioO72V0ICtq9GlrmsMXiw0RsNQuVETAkzK+cca4M3XEwLciVRoDx/ xCzaqE4wxQTSP6+w2bA9NVO24rQObBxOCS8r6KDPcTB7YkRjtmdMd4ROTqU6H4Z5UzRRtp 7Q01Skm7PBD++sCySR4tOUZfYZUr98xKKkKspxgxkoVycp6Q76VVLtAy3sw+lN/k1C9g4o PwvcXMn5MWXRPAZZZUmwwkrmkZLxbMZU9xsMAQEtCAousK4MwThcioP0mdx8gq7H/IcbCE 1q9i+othaNPSghKJazRSrWnPfdt7hNFglPIV0Yqs1wjiYAkqifOs/jC3lusZOg== 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" X-Migadu-Spam-Score: 4.37 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" X-Migadu-Queue-Id: 6BD8610C06 X-Spam-Score: 4.37 X-Migadu-Scanner: scn1.migadu.com X-TUID: I1oohKRlN+SY On 20/08/2022 14:29, Ihor Radchenko wrote: > Max Nikulin writes: > >> On 19/08/2022 11:28, Ihor Radchenko wrote: >>> Max Nikulin writes: >>> >>>> +(defun org-info--link-file-node (path) >>>> + "Extract file name and node from info link PATH. >>>> + >>>> +Return cons consisting of file name and node name or \"Top\" if node >>>> +part is not specified. Components may be separated by \":\" or by \"#\"." >>> >>> It looks like the docstring does not match what the function actually >>> returns. >> >> It returns a cons, doesn't it? Is it confusing that separator for >> components is related to the argument? > > It is confusing that cons consist of _file name_ and node name. > However, the function may return non-file as car of the cons. "dir" should not appear in well-formed links . If a user adds "info:" links then it is unlikely that their has never used info and has never seen directory index. Moreover I do not see real problem since it is considered as a virtual info file: https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/info.el#n2344 (add-to-list 'Info-virtual-files '("\\`dir\\'" ; ... After all, it is an internal function and I am still unsure that I have chosen the best variant. I believed that underspecified behavior here may give less harm than making some 3rd party code relying on the proposed variant. I can drop "(dir)" special case to consider incomplete links as invalid ones. The only problem is test cases for escaping of various characters since they use links without file name as the input, but they may be easily adjusted by adding some file name. There is huge room for improvements in "ol-info.el", e.g. other virtual files such as "(*History*)" may signal an error during HTML export.