From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id LafxFOICa193HwAA0tVLHw (envelope-from ) for ; Wed, 23 Sep 2020 08:10:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yLowEOICa1+obwAAB5/wlQ (envelope-from ) for ; Wed, 23 Sep 2020 08:10:10 +0000 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 EA9929400BF for ; Wed, 23 Sep 2020 08:10:09 +0000 (UTC) Received: from localhost ([::1]:44432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKzqq-0005Ns-Sl for larch@yhetil.org; Wed, 23 Sep 2020 04:10:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKzqF-0005M6-Hj for emacs-orgmode@gnu.org; Wed, 23 Sep 2020 04:09:31 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:35337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKzqC-0002gC-Ml; Wed, 23 Sep 2020 04:09:31 -0400 Received: by mail-pl1-x642.google.com with SMTP id bb1so706803plb.2; Wed, 23 Sep 2020 01:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=v0WibSJeQt6PLSOs+HcpCncaUJ4hW9Gj66reeXpGeMU=; b=R9ddBNfOL0HZG+VCVUwVxlVD6TfmJkApFbnAB+d+pZJYhu9DsINGAdPWCylF5lG6Gd ZXiTWdb0BLUrm5cWv8aCHCL1uu3AEOeplTRtnLlKF1XhIkR/qH3/jTvegz5niqbwEgic /ZkPZ+WMeT9JJtn7y0HXia+GA87R8aXnQoLpiN+aY2agO0UC4N24XrAbT1uK7W8E2OPL 5Y91dVbPtWp5DtYJV8d6zNgc6fDvytErp66ccUFfe5Brlcfsc6zG6ZZa8+MKp2PbBQzf oVpNWCk4VwBySFX27UiKZ645QmdADEwYKROV02m5qf0SIkq6h4htHGUrU1ym2itzuTRO V4ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=v0WibSJeQt6PLSOs+HcpCncaUJ4hW9Gj66reeXpGeMU=; b=iUSWVoBmxziCJIVsi/NnXRTiL3SKvcovRft1ZjJZTI2ENvV19uqgB2On+kBio0/XwB lMO+MRqI8cvKBu7h23aOS/OOS8Ux5b7pOYdgSmkHRmIvv8K0SH0SrUsADA5TrIUkURnS uLGiwcANu6OtqoG58NEZtHS6JKf7DMDJIOhVqQZHtyIVpK0+0eRE/vNVsbG3WbUh8da9 1fdz23JPxMevfAOVwaOPbkD2dRVIV4VmQYfXUbcDXgbEqPaAqFJmNiCKTJJzFERo2wRI HXhYDL91lFs31ZFZHHx7t6NhYdwpQdvLhvL5ZKVNnWrdIsBHa7hkjmOmzkq+Kr3lBybg 7I/w== X-Gm-Message-State: AOAM532IkGZQaD5JGycRgqOcpQtm3nFNa1r/Idp96FltEgcMsQ5hjc8K yY3QtetvHv7Bdf+/yXuaL6I9zABvxNn07sfz X-Google-Smtp-Source: ABdhPJy1ylUL4T/ARPZ7DLxC+IsW40d8FxaJTt23g1FNobSwTNxpFk8uyoNX8CDQvnKvdg5s1yeFBg== X-Received: by 2002:a17:902:424:b029:d0:cb2d:f26f with SMTP id 33-20020a1709020424b02900d0cb2df26fmr7935056ple.8.1600848565277; Wed, 23 Sep 2020 01:09:25 -0700 (PDT) Received: from localhost ([104.151.51.115]) by smtp.gmail.com with ESMTPSA id r3sm17010108pfh.88.2020.09.23.01.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 01:09:24 -0700 (PDT) From: Ihor Radchenko To: Bastien Subject: Re: [PATCH] Re: Any reason not to generate my own custom ID value (NOT CUSTOM_ID)? In-Reply-To: <8736399bn8.fsf@gnu.org> References: <8e204de9ad9da09812991449c64d7aad@isnotmyreal.name> <7689df3cbba5ea4afec672d80f99c590@isnotmyreal.name> <87pn6ti0kt.fsf@localhost> <11d07d7c64137cc1fb512e9cc546ab08@isnotmyreal.name> <87h7s4iwe0.fsf@localhost> <87pn6darjc.fsf@gnu.org> <875z85lz06.fsf@localhost> <8736399bn8.fsf@gnu.org> Date: Wed, 23 Sep 2020 16:08:16 +0800 Message-ID: <873638ncen.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=yantar92@gmail.com; helo=mail-pl1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TRS-80 , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=R9ddBNfO; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: WDue0OKIZKhM --=-=-= Content-Type: text/plain Done. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Allow-customised-ID-format-for-ts-org-id-method.patch >From c479d8b229140029a3a8454dd933dab7322fafc4 Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Fri, 11 Sep 2020 15:42:53 +0800 Subject: [PATCH] Allow customised ID format for `ts' `org-id-method' * lisp/org-id.el (org-id-new): Use `org-id-ts-format' as ID format for `ts' ID generation method. (org-id-ts-format): New custom variable for `ts' ID format. The default value is the same as old hard-coded ID format string. * etc/ORG-NEWS (New option ~org-id-ts-format~): Announce the new custom variable. --- etc/ORG-NEWS | 6 ++++++ lisp/org-id.el | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 87c5696d8..7e3957c10 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -363,6 +363,12 @@ HTML. Functions in this hook are run after ~org-agenda-filter~ is called. +*** New option ~org-id-ts-format~ + +Earlier, IDs generated using =ts= method had a hard-coded format (i.e. =20200923T160237.891616=). +The new option allows user to customise the format. +Defaults are unchanged. + ** Removed or renamed functions and variables *** Deprecated ~org-flag-drawer~ function diff --git a/lisp/org-id.el b/lisp/org-id.el index f8af52964..512703269 100644 --- a/lisp/org-id.el +++ b/lisp/org-id.el @@ -128,6 +128,10 @@ nil Never use an ID to make a link, instead link using a text search for :group 'org-id :type 'string) +(defcustom org-id-ts-format "%Y%m%dT%H%M%S.%6N" + "Default format for IDs generated using `ts' `org-id-method'. +The format should be suitable to pass as an argument to `format-time-string'.") + (defcustom org-id-method 'uuid "The method that should be used to create new IDs. @@ -380,7 +384,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"." (concat "@" (message-make-fqdn)))))) (setq unique (concat etime postfix)))) ((eq org-id-method 'ts) - (let ((ts (format-time-string "%Y%m%dT%H%M%S.%6N")) + (let ((ts (format-time-string org-id-ts-format)) (postfix (if org-id-include-domain (progn (require 'message) -- 2.26.2 --=-=-= Content-Type: text/plain Bastien writes: > Ihor Radchenko writes: > >> See the attached. > > Thanks, but you forgot the note to etc/ORG-NEWS announcing the new > option la mission. Can you add it in the same patch? > > -- > Bastien --=-=-=--