branch: externals/denote commit db9584f51d88baf6eaa97ebdceaef25e241c9d29 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
BREAKING Change date/identifier pattern Before it was like 20220531_091625, but now it is 20220531T091625. I also introduced a new face, in case someone wants to style the time part separately. --- README.org | 14 +++++++------- denote-dired.el | 12 +++++++++--- denote.el | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.org b/README.org index 5b7030dbf0..4f7a73b395 100644 --- a/README.org +++ b/README.org @@ -86,10 +86,10 @@ Every note produced by Denote follows this pattern: : DATE--KEYWORDS--TITLE.org The =DATE= field represents the date in year-month-day format followed -by an underscore and the current time in hour-minute-second notation. -The presentation is compact, with an underscore separating the two -components. Like this: =20220531_091625=. The =DATE= serves as the -unique identifier of each note. +by the capital letter =T= (for "time") and the current time in +hour-minute-second notation. The presentation is compact: +=20220531T091625=. The =DATE= serves as the unique identifier of each +note. The =KEYWORDS= field consists of one or more entries demarcated by a plus sign (the separator is inserted automatically). Each keyword is a @@ -106,9 +106,9 @@ string for the =TITLE= of the file name. Examples: -: 20220107_124941--economics--plentiful-and-predictable-liquidity.org -: 20220214_104945--emacs+git--git-patch-formatting.org -: 20220420_113805--three_word_keyword--this-is-a-test.org +: 20220107T124941--economics--plentiful-and-predictable-liquidity.org +: 20220214T104945--emacs+git--git-patch-formatting.org +: 20220420T113805--three_word_keyword--this-is-a-test.org While files end in the =.org= extension, the Denote code base does not actually depend on org.el and/or its accoutrements. diff --git a/denote-dired.el b/denote-dired.el index 4591a3315d..c467bac47b 100644 --- a/denote-dired.el +++ b/denote-dired.el @@ -117,6 +117,11 @@ renaming attachments that the user adds to their notes." "Face for file name date in `dired-mode' buffers." :group 'denote-dired) +(defface denote-dired-dired-field-time + '((t :inherit denote-dired-dired-field-date)) + "Face for file name time in `dired-mode' buffers." + :group 'denote-dired) + (defface denote-dired-dired-field-keywords '((default :inherit bold) (((class color) (min-colors 88) (background light)) @@ -139,9 +144,10 @@ renaming attachments that the user adds to their notes." (defconst denote-dired-font-lock-keywords `((,denote--file-regexp (1 'denote-dired-dired-field-date) - (2 'denote-dired-dired-field-delimiter) - (3 'denote-dired-dired-field-keywords) - (4 'denote-dired-dired-field-delimiter))) + (2 'denote-dired-dired-field-time) + (3 'denote-dired-dired-field-delimiter) + (4 'denote-dired-dired-field-keywords) + (5 'denote-dired-dired-field-delimiter))) "Keywords for fontification.") ;;;###autoload diff --git a/denote.el b/denote.el index 5dfa54d83d..b27f5b526d 100644 --- a/denote.el +++ b/denote.el @@ -105,10 +105,10 @@ specifiers." ;;;; Main variables -(defconst denote--id "%Y%m%d_%H%M%S" +(defconst denote--id "%Y%m%dT%H%M%S" "Format of ID prefix of a note's filename.") -(defconst denote--id-regexp "\\([0-9_]+\\{15\\}\\)" +(defconst denote--id-regexp "\\([0-9]\\{8\\}\\)\\(T[0-9]\\{6\\}\\)" "Regular expression to match `denote--id'.") (defconst denote--keyword-regexp "\\(--\\)\\([0-9A-Za-z_+]*\\)\\(--\\)"