From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 EB79HxOmbGNeKQEAbAwnHQ (envelope-from ) for ; Thu, 10 Nov 2022 08:19:47 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qF78HxOmbGNjUgEAauVa8A (envelope-from ) for ; Thu, 10 Nov 2022 08:19:47 +0100 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 44189137B4 for ; Thu, 10 Nov 2022 08:19:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot1pw-00042V-4X; Thu, 10 Nov 2022 02:18:56 -0500 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 1ot1pm-0003ze-Le for emacs-orgmode@gnu.org; Thu, 10 Nov 2022 02:18:51 -0500 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 1ot1pi-0002RJ-F5 for emacs-orgmode@gnu.org; Thu, 10 Nov 2022 02:18:44 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 96B24240026 for ; Thu, 10 Nov 2022 08:18:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668064715; bh=0jrkue0RjJw1rPvvdtNuxfp4xjWDxb/w2/pLD+MexCw=; h=From:To:Cc:Subject:Date:From; b=c5O/tURFUNHz8jSmSO+mEIAzTGwYdhUKBqT4JmD+nXk77knx1gOAe5IC6SxA/S9SE 40/20PRm1Mg6IABBt9zpeMhx/+wx3ZqZ7FpTAOqktN5uFSWnMvDxOliRTO49H8HqfZ Mx2U6iL07+UhdF1EtkpgyjOqdpU9Daxkz0e4fAhPUuAlktRuzy/ipcesI/qNaLuV0E 6beVFM1SS04WFcQzG1eE7qmwWdIezRdPqk+LIaUgVnxFnLMWIo6//daFgVjSWc5cfm PlP4QJAekfPt2cGCK5mSeKFHTYuMokpmvgl/vuf7Nx5wrwTah1tcYbrKB8cff9gR80 52/MlnY4MxqNg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4N7CqY3MF7z9rxG; Thu, 10 Nov 2022 08:18:33 +0100 (CET) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v2] org-attach.el: ID to path functions may return nil In-Reply-To: References: <87k084v1wa.fsf@localhost> <871qtxhsm6.fsf@localhost> <87a68ce32u.fsf@localhost> <871qtodygs.fsf@localhost> <87v8qz9zui.fsf@localhost> <35cbf452-c3ed-d97f-db96-dcae57463eff@gmail.com> <87wnbc7ltm.fsf@localhost> <87bksn1nl1.fsf@localhost> <87sfk6zixs.fsf@localhost> <874jwiakpn.fsf@localhost> <87y1sm11aj.fsf@localhost> Date: Thu, 10 Nov 2022 07:19:14 +0000 Message-ID: <87a64zjmz1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1668064783; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=k7rVIj/N2PtK7HEkPv9GcGdA66ZX7NJ8wu8TbJfAsB8=; b=U7hbrKvRNIU/R7GrtuUPROgU7121w3HuPAL2y5nuXKFiI0GX25+MQ0zf2i6UXNxzr2A3gS m4yQtZPJAapcmXYq3IUp32tKQqUK1Qwcv4B+xuRACCYGriia62s2mkROkaxF4WoYTE8Esk Ahv4rCZH6WPwP9DtnTXasOGtpG5ivzqU++xjhI9m6sJoNXpbj9aC0pRHVr0vegX4BxI5+/ 5brMGMBRP5h74ePtOPsZ9MUO1bDXu0JxUwdL1Oac381kIMPWuUPapKhjMk4MjPOv8zi8SN /yHhfnFF2apR7UBFqrL0UU79PP2uuiu9yaSlMdoE/BgDHheN5y/cPuufbd3NUg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668064783; a=rsa-sha256; cv=none; b=cUyzazVuNbyPpI2ZRnOSkUBNL6io3KGdg0gVN5UOU1I5aOc7elBiPy4wggUxWrsNGE2bSJ CRufZJt9RfHJ22UshyY3A/e46Oaybkl3ifkfXcJiQ/APVM3WLBnV4EcRjTLVNwL8/U7ntA MPjKofFKuQ9cmZtiI8j7VVClN3c2PJCvlWfvS85+fH1tvHAw4KfElFBSR1J76FXUak2jZK CkDhOcTrtoX+5uq3UyYC8dixKSs7mWkPhap68gKaaVmvBWNVoyNZPDBfplVIyGj+/WmCXZ XySAiO73Y5XPUeB41lwop0TUK1n9F7yKlnsgcffySR2lTzdLNtI95B/5UICpYQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="c5O/tURF"; dmarc=pass (policy=none) header.from=posteo.net; 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: -2.22 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="c5O/tURF"; dmarc=pass (policy=none) header.from=posteo.net; 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: 44189137B4 X-Spam-Score: -2.22 X-Migadu-Scanner: scn1.migadu.com X-TUID: vtuJiSPnoJhw Max Nikulin writes: > On 08/11/2022 12:08, Ihor Radchenko wrote: >>=20 >> I feel like this makes the docstring confusing. >>=20 >> Note that `org-attach-id-to-path-function-list': > > I have tried to update the docstrings. Thanks! >>> if: No attachment directory is associated with the current node, adjust >>> =E2=80=98org-attach-id-to-path-function-list=E2=80=99 >>> >>> I do not think this message is unhelpful. >>=20 >> With your patch, such message will be displayed even when >> `org-attach-preferred-new-method' is set to something other than 'id. >> And the message will be wrong then. > > I have moved `error' call despite I have not figured out how to trigger=20 > the error for other options. The main reason is code readability. Also, one can trigger the other error for non-standard values of `org-attach-preferred-new-method' . >>> +(defun org-attach-id-fallback-folder-format (id) >>> + "May be added last to `org-attach-id-path-function-list'. >>=20 >> This is not a proper first line in a function docstring. First line must >> describe what the function does. > > I am still unsure that in this case effect is more important than=20 > purpose. The function is too specific. That's a function and should follow standards. If we do not follow standards, it will become harder to maintain Org. If we want to be really specific, we may allow a special symbol in the list indicating the fallback. I'd prefer this approach a bit better. No strong opinion though. > P.S. At first I believed that you have some objections concerning=20 > changed role of the first function in the list, not just how it is=20 > documented. I had. Most importantly, because we are changing the existing meaning of `org-attach-id-to-path-function-list'. However, the only scenario where it actually matters is the bug report at hand. So, there will be no regression. However, please add NEWS entry detailing the change in `org-attach-id-to-path-function-list' to the next version of the patch. I have no other comments apart from various grammar issues and typos. But that's easy to fix before merging. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at