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 IB+7Mh4092IvAAAAbAwnHQ (envelope-from ) for ; Sat, 13 Aug 2022 07:18:22 +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 iB32MR4092KvfwAAG6o9tA (envelope-from ) for ; Sat, 13 Aug 2022 07:18:22 +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 6948035C44 for ; Sat, 13 Aug 2022 07:18:22 +0200 (CEST) Received: from localhost ([::1]:59068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMjXR-0003Ez-D5 for larch@yhetil.org; Sat, 13 Aug 2022 01:18:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMjWC-0003D7-Uj for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 01:17:04 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:55884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMjWB-0001nr-6N for emacs-orgmode@gnu.org; Sat, 13 Aug 2022 01:17:04 -0400 Received: by mail-pj1-x1035.google.com with SMTP id a8so2667746pjg.5 for ; Fri, 12 Aug 2022 22:17:02 -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=YtMIJFG4deZcOU4WlZYahJYTWDUwl4XqV493urdDuMM=; b=i0UpGMRV0rq6tEVHnYygKB/pvH9J6PdMQF9kbd3Tf09PQ+yUOns0UNj445CnXVU5zV CxNWCGbhb//kkJr5GNMxckjcyiMZAdFGKASTVchcrQ38Ss1LY9P+6CjWj/X65UkCCJNc fTlVO0pF/UTGl9493XQHddIXkCjk0KxkApaSTReOrn1KKAZ2FefuJZ/apT6oOWB/iZBT Nw6QJSf8TU3xKFDeaKUsyZiMPHyk9jeb/87P1SVbui0v5bCewCz4tci3X21yqgl1hPUy X+POGZxIidVKu+IYHcBanHMN/c+4RkrkTtxl/hWs8F2rCmMWkxjz0B0vmvwBIQKdCgXT ZgLA== 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=YtMIJFG4deZcOU4WlZYahJYTWDUwl4XqV493urdDuMM=; b=ly29e3AcH4ANOlezaJgMZnLkKhYu0Tm1NHBp6B/1FPuiuZcjyIp9n5YKfJIuQsM42R F4Z9QqCZgw+4PRfGwce+BBCRzE06y4oZabzlpTLafBolZj/cCRVGJkH3y1cDWEC6vHtp 3n47UOurBw9D2HHUGgDS2uCpVzzwKO/0PvCY2BkNmsmJObUb+8gazmJYfikR2+UVvL27 3IX23cyzlOKslZcDvRdPwEDFjLNsZj6lOHR4MT0sqa8j3jYRQach07hO1x+PnDZThYyc WKnDjowCiraBtf73FO2n1TIYgJl9L4I1x9Yccn2csHaF/oUqIjxcchdKEUrT1ZX4cbKB Rf2g== X-Gm-Message-State: ACgBeo2za3qpJYMbezbzz1pU21kcuwjZvqqPnYO4SFZEZtIKeaDskKBJ WaVuEqwsvdm+r3IVBkHRxZo= X-Google-Smtp-Source: AA6agR6eKPTy+CGS7ApsZiRTcVxX1v19qM/LNJi6j+RQwQXScRakbcae/NbRKqabB3xLevgADy3m5g== X-Received: by 2002:a17:903:264b:b0:16d:b891:593 with SMTP id je11-20020a170903264b00b0016db8910593mr7528573plb.133.1660367821476; Fri, 12 Aug 2022 22:17:01 -0700 (PDT) Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id n14-20020a170902d2ce00b0016c2cdea409sm2723031plc.280.2022.08.12.22.16.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Aug 2022 22:17:00 -0700 (PDT) From: Ihor Radchenko To: Janek F Cc: Max Nikulin , "emacs-orgmode@gnu.org" Subject: Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)] In-Reply-To: <8g4g55i6XsG-C0vN8LdPLL-p4BxnXTCU8wzPQ1eSYSFQu_Bl8joOYGD53lfOvoA7Po9TfZXdNXYsuOM_ToD8IVAZyr8SKxk2Yl2OpN4Xb1g=@pm.me> References: <8g4g55i6XsG-C0vN8LdPLL-p4BxnXTCU8wzPQ1eSYSFQu_Bl8joOYGD53lfOvoA7Po9TfZXdNXYsuOM_ToD8IVAZyr8SKxk2Yl2OpN4Xb1g=@pm.me> Date: Sat, 13 Aug 2022 13:17:58 +0800 Message-ID: <87zgg87md5.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=yantar92@gmail.com; helo=mail-pj1-x1035.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=1660367902; 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=YtMIJFG4deZcOU4WlZYahJYTWDUwl4XqV493urdDuMM=; b=dDAB44T2XRhbT8z16vnNXsuIzzpcQkwuF4z6LeL3pM6tLWQ+ReK1rjOYv0slvuOX77Qz3/ T5Af64APj6am77EgNAv4vItG5Cj8+otLwh3EHrD5V0ARcjjfvGMN4kfXdTEdygYOKN7mjL /D3Ski+xOO+wWBLwkewgBuolQu0p0S9s4lrbH7XEiZ0Pt0nhlh+RdZVT2awjkTNUfOVcbf eww6Kg/kQTyS4/iCydh7bY6uZrc2ROADdIrArnhNB49dOXg3gxfvZmG9/EjVQFwZXu9tqQ MwB+G89/uuqLoYeogLQUUiKsLLBQVil+kYlPI6wR8rZQDoSQbniZsLs3qynFnQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660367902; a=rsa-sha256; cv=none; b=BXg1QQvPCaC7HOg/Qs2yt6z2B8n5qV1JIIEYxsRaWrlUh4XX/HQhYwFOMVwva3hCxvb0Kl YCp8+JbPyOWwMNCvjE5+jUo38r5qnMdni61fuCeyOKkNYieUG98Qo7EJC/ArQGoHAUkFMh fZXvpb1y9CzOedalfM/OXgZa709dB7ivd6LUGGJnAIoMogC3xXv58baHviQuEMdivmWnqD lF8NwL9bH5h6GytHlPWCqL3YYIPvEWHkSLHldqtg5Rjky7LkNVQZBXEWKN8ABJaLW4ArW9 zSvV8lMo5JESj1wkM0DWGX4T6F99Ns8Y5wsjNGrUP23hAa7ZQiXUYgFfWMyKMw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i0UpGMRV; 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: -6.86 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=i0UpGMRV; 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: 6948035C44 X-Spam-Score: -6.86 X-Migadu-Scanner: scn0.migadu.com X-TUID: TUq2aoE+/iGZ Janek F writes: > Considering the other messages, let's not get lost in details, the default function does not need to consider all edge cases. It simply should not error out on ids in a different format. You are indeed right, but we may use multiple different approaches to achieve this. Some are more simplistic, some are less. We are trying to find a balance between less hassle for users and not overthinking things. The simplest approach would be wrapping the function calls into (ignore-errors ...), which would avoid errors when we just try to check the existence of the attachment dir. However, it may raise unexpected errors for non-standard/copy-pasted IDs for users who did not customize this area. The approach I am proposing is handling unexpected IDs inside the default functions and bringing errors in user-defined functions to the attention of user - I feel that it will be more useful than ignoring errors. We could use yet another approach and use a global fallback if no available function can generate an ID, but we may run into tricky cases because the first function in the list has a special meaning - it _must_ generate a path from ID or the user may run into unexpected breakage in some cases when custom IDs are being used. -- 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