From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uJLwMq1z+GI85gAAbAwnHQ (envelope-from ) for ; Sun, 14 Aug 2022 06:01:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kOUMMq1z+GLIDAEAG6o9tA (envelope-from ) for ; Sun, 14 Aug 2022 06:01:49 +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 932A1FA66 for ; Sun, 14 Aug 2022 06:01:48 +0200 (CEST) Received: from localhost ([::1]:36416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oN4ot-0005wf-34 for larch@yhetil.org; Sun, 14 Aug 2022 00:01:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oN4mh-0005vE-CL for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 23:59:31 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:51832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oN4me-0008Oj-LY for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 23:59:30 -0400 Received: by mail-pj1-x1030.google.com with SMTP id t22so4333210pjy.1 for ; Sat, 13 Aug 2022 20:59:28 -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=Y51kxY3dr66K5vQGijJjh8w4Q/7c+R64ImxKNkpVt2I=; b=FsJpma/pHZRCapgcKLfPZl6nMlLR1U+KqqkMN42HwWY+E5eR5N7XfCcLmYx5H8Vfqd ++GRBWNtNIrUR75wJqBKDRTD1Adb7okOaJe5Gcn6Vt1N+U0AZTr+p7rI7/cGE6wObq3n XgnLUKivLdIqaefIgTdXLESHihJbgGh7Dt7FgwbHqlq9+GIzqdNQJzcetvKgKtOlnm0M WldY0Hkzqz7P5qRKG/I6yhD30HrVTptbI5tL4Uh5+vNLA2V6Mcxd9cpco0eo4NFUcM4+ O0iH91c6ZmW7C1DsXwTr4HUAspOC15QFl/e3IIIbpuu8ejXBOLm4laT40AEcOPDyM4Yp ZLZg== 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=Y51kxY3dr66K5vQGijJjh8w4Q/7c+R64ImxKNkpVt2I=; b=4hQhzRhrt2vgnEjSa6JjjSKF6FfD4EHEDl1TYNR5UtwYAXZsKQeHb2plRF0D7GWoB1 WYMnCkg4rsFVwSHZv8eflWoSar0iaQ7lVocSA/hiOQZvoGaK8cpx0Il46jPMCoQTKt6x ktm6JepdOo6y7MtvQaqPLxH5ohyaoCe7h2cpf0SePFLVGGblzq073g7LyWfcMCt3Olqc B7j1F3SKXgh+sVveTsMb11OUnAIxr5nCS4T61IxGKonq49S9uRIw7MxPaPCFa1s1dJ9+ olf8fnQeafsATxOfUaGMJ2f4kmooGFWltGyOJRIYIo5ubHbsvW/CLJrtn+vbUMmH2gF1 142w== X-Gm-Message-State: ACgBeo3L4WA5Hph0ejgShdYmFxlU3uFZrP1GXcPjcIRaHghRBdSO82Ui J1uC++j7vZDKv0j9lNfhxC0= X-Google-Smtp-Source: AA6agR7slLEdMfzVo3Wq6bW/pjgsyKZX4bfcT8rtYZTpLhRdpx1mTqnCXhMfsK+8yGipf9gOr49aNg== X-Received: by 2002:a17:90b:4b0a:b0:1f5:f2c3:645c with SMTP id lx10-20020a17090b4b0a00b001f5f2c3645cmr12146910pjb.10.1660449567001; Sat, 13 Aug 2022 20:59:27 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id a6-20020a170902710600b0016ed20eacd2sm4439042pll.150.2022.08.13.20.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 20:59:26 -0700 (PDT) From: Ihor Radchenko To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)] 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> Date: Sun, 14 Aug 2022 12:00:26 +0800 Message-ID: <87bksn1nl1.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1030.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=1660449708; 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=Y51kxY3dr66K5vQGijJjh8w4Q/7c+R64ImxKNkpVt2I=; b=V1Wf0rUr0MvtbUIlv4NxqsHf3O5vvdln+KHcki/I9wpG5kgCMT9dz7cm4SSzhQXfERKvfk OS7DelixX/9fagV6PhJdmc16I7KJ/JjnxSH512b/OoCXF3FmNM8ETuqLoXuKnXjpahkKZc Brg4iUJlKocKp2OObHuQgs4GdX3uW7jQtDsl3Sri90peVRFbOE7NV83uvGoREC8COgDnzY P7mJ8WKyQCagF/g5DYWNX0eGISMiLt3X2CJD6iRahbY/97qXUNS23ViAqutKhmPpAdqeTl qrhSgDLgCTIKX27v/bRQJx/sLOF0usu8t0Gnv28CX5NoK/7xvE2SepLz2X+psA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660449708; a=rsa-sha256; cv=none; b=VjNKrAoPvQW0P+sklAG/5rJkOqV9mOlCnVkXtCrD6qReX8puaOlM/t12n+q/HmAFjPIgEX 045d25dUG9fDNZQFOcTpGxpC9ivWGIYs0LAbTV8U8n/RoG1uIEMyJQ/zLEB3LSsqH+vVbc Q+pnsX/t61nSK1l+spNx9wZg5wkdhsp14pDK3J3ZiVP/jtxPDPY9dTxunYPouY2Omc1JiI h2OzSJzAKuxGme0OXWgwcr4gbwcih8M474sQ44NUPcuV0UNj7Nl6KQ662UC8L9R+PNNqcP si6az2eATQPFPJ741gImNQ1BxwR7jT36f+PGfC3vj9SDps2ExBCS0VU1q+k9Sg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="FsJpma/p"; 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: -8.36 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="FsJpma/p"; 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: 932A1FA66 X-Spam-Score: -8.36 X-Migadu-Scanner: scn0.migadu.com X-TUID: NnxIVAt4i/82 Max Nikulin writes: >> I do not think that it is a good idea. We currently promise to use the >> first function in the list to generate the IDs. Other functions are >> mostly a fallback to catch the existing attach dirs created in the past >> using different ID scheme. > > My idea is to add an extra check that filters out nil values. I do not > mind to signal a user error if first entry from > `org-attach-id-to-path-function-list' returns nil and paths returned by > other function do not exist. This would be possible, in addition to the patch above. Or do you mean the default ts/uuid format functions to return nil to short IDs as well? >> I guess that one option could be demanding a non-nil return value when >> generating a new attach dir (without TRY-ALL argument) and wrapping >> things into (ignore-errors ...) otherwise. > > I am against `ignore-errors' because it makes harder bug hunting using > debug on errors. Agreed. > I would prefer to force users to justify strategy for non-standard IDs > as early as possible. The goal is to avoid manual actions to change > directory structure when users have hundreds of folders. My experience > that users may easily face performance issues with ~1000 files per > directory. The reason is either lack of optimization for such case in > particular application or a bug introduced in a new version. I am not sure if we can solve this kind of issue reliably. The only idea is enforcing [1-9][0-9]\{5\} for ts IDs. And we cannot do much about IDs prefixed with the same constant string. -- 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