[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] Re: [BUG] org-attach-id-ts-folder-format fails on customi
From: |
Max Nikulin |
Subject: |
Re: [PATCH v2] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)] |
Date: |
Wed, 10 Aug 2022 19:17:42 +0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 |
On 10/08/2022 18:43, Ihor Radchenko wrote:
Ihor Radchenko writes:
I have updated the patch to use "__/id" when id is too short.
Any objections?
+When ID is too short (less than 3 chars), use its md5 hash to create
Misleading docs, you do not use md5.
+the path."
+ (if (< (length id) 3)
+ (format "--/%s" id)
Please, do not use path components starting with dash, it is terrible
for CLI tools. By the way, you promised underscores, not dashes.
+ (format "%s/%s"
+ (substring id 0 2)
+ (substring id 2))))
Ihor, I have not look into the code around, so my suggestions may have
no sense.
Is it possible to pass empty string as ID to these functions? Should it
be explicitly checked?
What if ID contains "/" that can not be used in file name? Windows has
more forbidden characters.
Do you expect any problem if here (and for timestamp-based ids)
directory component is just padded with some character (unsure what can
better than underscore) to required length?
"x" -> "_x/x" or "______x/x"
"xy" -> "xy/xy" or "_____xy/xy"
etc.
From my point of view it might be a bit better than "__" and "unknown".
- Re: [PATCH] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Janek F, 2022/08/02
- Re: [PATCH] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Max Nikulin, 2022/08/03
- Re: [PATCH] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/03
- [PATCH v2] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/10
- Re: [PATCH v2] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)],
Max Nikulin <=
- [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/10
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Max Nikulin, 2022/08/10
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/11
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Max Nikulin, 2022/08/11
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/13
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Max Nikulin, 2022/08/13
- Re: [PATCH v3] Re: [BUG] org-attach-id-ts-folder-format fails on customized IDs [9.6 (9.6-??-2e9999783)], Ihor Radchenko, 2022/08/13