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 UFjHCO5CdGN9GAEAbAwnHQ (envelope-from ) for ; Wed, 16 Nov 2022 02:54:54 +0100 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 2IjdB+5CdGMQdwEAG6o9tA (envelope-from ) for ; Wed, 16 Nov 2022 02:54:54 +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 C05E9E0C6 for ; Wed, 16 Nov 2022 02:54:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ov7ct-0005BG-P3; Tue, 15 Nov 2022 20:54:07 -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 1ov7cq-0005Am-Lq for emacs-orgmode@gnu.org; Tue, 15 Nov 2022 20:54:05 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ov7cn-0001Zu-5U for emacs-orgmode@gnu.org; Tue, 15 Nov 2022 20:54:04 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 25658240101 for ; Wed, 16 Nov 2022 02:53:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1668563639; bh=qC8TcRk0XEeJzGYfuPjT9RmWEDaR2L3+q1T8bXUwdWo=; h=From:To:Cc:Subject:Date:From; b=Soa6Y/upHusk7vpV4tJhbE6Nesw3u3aAYKMn7QSjIXlNu+E41pAnLFUpxZ4OO7Y7h c34B9KzNwhHPwKQ74qc1QUsXRTvlURaWhlN3xmUy/ZNim/NpU8zemEUQsTK1IHyH0x XthPcY3LZ5ZzByhD1/7IsQWX1FxjzKEOsw4JksgCUji2XgFVKwLqbnT5Ye+RCECLSZ o6V9UUwTOfeZPh/ldIjig1g84LuYMr4zRVSm/KceKwwR+c4bBPXhDHf6SHqzZu0u+G nzAlAJd7Ox76M0QKildUHE7LQAgskjkDr8NQTMa29Cm0M4SdJFkzUS0nx95KV/tt6K dnXWuvnZONL5w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4NBmLF3qDBz9rxK; Wed, 16 Nov 2022 02:53:57 +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: <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> <87a64zjmz1.fsf@localhost> <87sfimfc2p.fsf@localhost> <3326940f-f7a8-37f6-2dc2-f1f035f4c491@gmail.com> <878rkddjng.fsf@localhost> Date: Wed, 16 Nov 2022 01:54:38 +0000 Message-ID: <87v8nfd5pd.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.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, RCVD_IN_MSPIKE_H2=-0.001, 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=1668563693; 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=Wz7k3Rm93y0rjzyCmDZOVMlOH5apypLK8XblgO76mdU=; b=GAGU2GXuREbWebe9t2Yv73E9lpIOY4aTCIakCqBOREt1MERCWinHsKoCJVnh5IUGbrWFIo ptW6E984OsI9dffrwZeRkjzn94pxq3ZPBrZGaKa9bhM3hSO9KxX3ZaMgoI1TINWsh2yrQg KJwK3eqkfH7t5NNkz0nKGaO/Lkb2p/xS5xoQybbdOBr2RSmgQDsrr2z9qaqWTWKfnSftQK W63Tecm82/l1wdC8NWSo3cIM+2S+TnzPHwKopKlin5DMNAO3KU7o7JF0dx/QWpKCps2EvG SolLG9eshxjdier5yb5Xgap63sNWspl/pu2O1hbS7x0IJqREeK1TBDB/YijrPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1668563693; a=rsa-sha256; cv=none; b=ELjr+39dtMJsf1hkg4PdNyZDmbmNxjH4ogbeR4uyE1IS6J7o9ouG6ywbWHEPufTCi/OgiY /Lcgi2kLNp2nT+q6T7uQyBC396lBI1Ry1b/FdwtZWO5hnHp7w9NNnDdr3Qv5j5oaGlOfFX 17s+1GrUhZXzQZJ8HvkaG4+DMbB+WrppegGC5MBeun8yi72K6uGyqyHqZNEeJiS+iPLxb0 yfOBFh4RCFsyZxEwnk0rPLeIYMadKfwqCglhcInbuBbfO+bHawP+IcTBR1dAX4yiI72cUG cezJsjideYfvPIQXp8ciDUtSRoMrNnODl2SFYsuZl9mBn9LNMS0UUZjV4hxMgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Soa6Y/up"; 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: -7.04 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="Soa6Y/up"; 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: C05E9E0C6 X-Spam-Score: -7.04 X-Migadu-Scanner: scn0.migadu.com X-TUID: /whHt9KqrPUo Max Nikulin writes: >>> Please, remove a stray space in the defcustom. >> >> Hmm. Done. >> >> I just have a habit to add space in the first item in a list because it >> helps auto-indentation. > > I had an impression that something was wrong with indentation of next > entries. I thought that you referred to '(symbol ... Other stray spaces were there because I forgot to disable nameless-mode. > Sorry, but "important" entry should be before > `org-attach-id-uuid-folder-format'. My idea is the following: > - If the ID was generated by 'uuid or 'org `org-id-method' then prefer > XX/... subfolder. It is important for new attachments. Even if current > `org-id-method' is 'ts then this entry is ignored and layout is > determined by the next entry. > - If the ID is timestamp-based then prefer "YYYYMM/DDTIME" subfolder. > - Put new non-standard IDs to important/X/... subfolder whenever > particular ID is a short or a long one. > - Handle the case of `org-id-method' changed in the past from timestamp > to UUID or vice versa. Try to find attachment trying to split 2 > characters from timestamp or 6 characters from UUID. So add bare > `org-attach-id-uuid-folder-format' and `org-attach-id-ts-folder-format'. > These 2 entries may be skipped for new users or for users who never > experienced change of `org-id-method'. Agree. I now applied the updated version of the patch. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=08a8c9e67 >>>> I also added the dumb fallback to the default value. >>>> I feel that otherwise the description of too confusing. >>> >>> I am unsure concerning adding it to the default value. From my point of >>> view, it is better to ask user to clarify their intention. > >> Handling too short IDs is a different issue indeed, but why not to fix >> it as well? > > I still have a different opinion, but it should not prevent you from > committing your variant. The issue is not critical. > > The problem is not too short ID. Actually they are some ID having > unknown format, so functions designed for particular ID generation > methods may cause a mess in attachment subdirs. >>> If strict variants of functions were used above then non-standard IDs >>> would be isolated in the directory returned by the next entry >> >> Good point. >> What about using the value you provided in the NEWS as an actual default? > > It may be done by a next patch unless other issues will attract more > attention. I guess it does not heart to wait a bit. Though I do not see any issue with updating the defaults to your version. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at