From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CDQFAF0R/2IgYwAAbAwnHQ (envelope-from ) for ; Fri, 19 Aug 2022 06:28:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6CCoOlwR/2L01QAAG6o9tA (envelope-from ) for ; Fri, 19 Aug 2022 06:28: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 783B832EDC for ; Fri, 19 Aug 2022 06:28:12 +0200 (CEST) Received: from localhost ([::1]:52808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOtcB-0000Rh-JR for larch@yhetil.org; Fri, 19 Aug 2022 00:28:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54024) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOtbT-0000RJ-Rt for emacs-orgmode@gnu.org; Fri, 19 Aug 2022 00:27:27 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]:44588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOtbS-0006vw-0S for emacs-orgmode@gnu.org; Fri, 19 Aug 2022 00:27:27 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-11c59785966so4038185fac.11 for ; Thu, 18 Aug 2022 21:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=KWUPsw3ZUMX1cGSZcgYb//lIwKCvcgw7iZKmqB0CUZc=; b=MXfnYKxUSFxryTaatGuX6oftklSKJZZrWJO3UtBqlj2YLvbkrOiayMgRccX/T4Zd8P SBFWVvVcC6SsAjnjROchBOAqHudFB2WxWlBQB0z6+ydE9A7pgLiClZ0tViZ5td6G6AKw PBs4adDWcnJQayJNCuk72G8W5pQX0e+CsoaCjZKP+KwS4YDOyseEv2S/y7jePRsWjOqk iZgbwCDT+kS8uG/ZmyHlomzlkQe7o3O2qws0KVSQz/p2lPcU8cN7yLNhdOPrlES+/KzW IN8lOZohPZR0Gpp7fTpNsH2RmJmv1d55J0XH+xQe16LPag2LPP0pTqY/6O1ckd31Ob18 8p5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=KWUPsw3ZUMX1cGSZcgYb//lIwKCvcgw7iZKmqB0CUZc=; b=DEzi7/KTY/uj0+5Xb0ZjHOOPXNw8TPLc/Sse1P/5lNIw/rVbU1XsAbc0Mkpw1PlnuM sJO6RWybf73ZBXXdi03xn9mGisWDAnt0f/lqA2WxXgiY0CWuFqyR6uy9Vhkbya5nvthq Le1kEBxki7P4bvkUwmgIsJwbOwKcSIqvT8SnIA3M6J9bnk9pL+AXXODlKiE5Up3u3TON 1iL32FttI7cvk6xExLI6pRUZrhUJlgQY3M9Rx/RDDBGb8CxK2xcXNgVKBRmd3+sTOO/x MYDKuZks/rXY4iNmuErpCry2bgJyeveIYo5P+T8BLMIKYalKi9jYBxORrKESHJWsSsfI 2XRw== X-Gm-Message-State: ACgBeo1dq8BzUL+BlWxCat2e5/5PlHKqXjtpF3sPx0EBFrq33SYbrQ6T f7q9QV6IY/rrSdNelSr0nUo= X-Google-Smtp-Source: AA6agR6anPejLMWVcbMyGbbP5Az+MCrk+jDmWD54p/Cr/FaVZ5RPvF2CPVBOwbPJTNQdDtoATx57rA== X-Received: by 2002:a05:6870:5820:b0:11c:b6d0:b84c with SMTP id r32-20020a056870582000b0011cb6d0b84cmr1503072oap.236.1660883243594; Thu, 18 Aug 2022 21:27:23 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id 64-20020aca0743000000b003431d9b3edfsm821066oih.2.2022.08.18.21.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 21:27:22 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v2] ol-info: Define :insert-description function In-Reply-To: References: <87zgl1npow.fsf@localhost> <877d4flu3x.fsf@heagren.com> <87cze5e84m.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> Date: Fri, 19 Aug 2022 12:28:28 +0800 Message-ID: <87zgg0q2kz.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=yantar92@gmail.com; helo=mail-oa1-x2d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" 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=1660883292; 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=KWUPsw3ZUMX1cGSZcgYb//lIwKCvcgw7iZKmqB0CUZc=; b=kb3DdEPLFNTIzxB+vHp28mOGxKm50agP8Ahh9KBqgL4QBVcaug+QYH1NqEb8/CGaJHWZdv Kvs01ROgPKlQ20DSWgVmefV1VIJosVsD0utM/XjJHb+ZaRf36FPi+PrNn2I9go93bd9xaR UG/khccsVE3yzqnyv088ekn8iLJKJB+w97I5+8XLexdk/l0eWCGgxYfW16vik+q9ALmW6I Cx9muuy44WMF6RGmHUZIl4U2+h1pryLtuOGfX8KFmvvKVExnLpyhuoUEi7GYYeNvosFP2T gdvaIkNjw6mR8oMNc0Nv6ITWvbRuUNc0qqO/V6fcb0oQzuFq7SN/iSsFDPBA3Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660883292; a=rsa-sha256; cv=none; b=nIamG4jxqkqRAHYpzFzgpJsr4P8xoN04LPyN7jFQOAHdizckFjpB77t5SH6WzLaV2+Ob6n ETy9xh+svHR/QDCIhJRvri7qZqTn+9gUgQRCwe5liuHDRc0a6aXVvK172VHNaIweYfeucH O/T6SbTfuGUce9IN+VGnI1BG6Mf3tnsK8km76g+I4WslsC/gmd887Vq4QnM23iD6l2EPz3 m0OrtW41EPkT5hGw2b6mtru5Nus7lS2fGVVQEqoXYTYigcQ9BttRBtX1GEdW640a9gMneE 3fZXsjCXXFYA/AdszCnKOq9kRjw/31ZQt9Uau7M9jvDFsNgWToD27NNujYLlqw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MXfnYKxU; dmarc=pass (policy=none) header.from=gmail.com; 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: -3.35 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=MXfnYKxU; dmarc=pass (policy=none) header.from=gmail.com; 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: 783B832EDC X-Spam-Score: -3.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: +JHUoXL2hKLS Max Nikulin writes: > I have rewritten the patch to use `pcase' and to fix allowed separators > between file name and node. Thanks! > +(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. > + (if (not path) > + '("dir" . "Top") "dir" is not a file. Also, it is not very clear what "dir" is referring to. Maybe you can add a comment pointing to `org-info-other-documents'? > + (string-match "\\`\\([^#:]*\\)\\(?:[#:]:?\\(.*\\)\\)?\\'" path) > + (let* ((node (match-string 2 path)) > + ;; `string-trim' modifies match Here and is several other places, including docstrings, please make sure that the sentences end with "." and are separated with " ". > + (cons > + ;; Fallback to "org" is an arbirtrary choice > + ;; and added because "(dir)filename" does not work as "filename". Should this be documented? Or at least mentioned that the behaviour is undefined. And if it is undefined you should not test it in the tests. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92