From 56ca4c6ad4d34354bd1aa76e8d472ddf98d0b798 Mon Sep 17 00:00:00 2001 From: bth Date: Fri, 7 Mar 2025 23:27:11 -0800 Subject: [PATCH] um-date-format --- elisp/um.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/elisp/um.el b/elisp/um.el index e92536a..86571c4 100644 --- a/elisp/um.el +++ b/elisp/um.el @@ -40,14 +40,12 @@ (defvar um-journal-path-glob ".*/writing/journal" "Primary path glob for the journal. This allows various mountpoints.") +(defvar um-date-format "%Y-%m-%d" + "Format passed to `format-time-string' when creating `um-journal-header'. Defaults to ISO8601.") + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; journal header -(defun um-iso-8601 () - "Insert a date stamp in ISO 8601 order, but with periods in place of dashes." - (format-time-string "%Y.%m.%d") - ) - ;;;###autoload (defun um-journal-header () "Create a header composed of: @@ -56,11 +54,10 @@ : date " - (interactive) - (insert - (format "# %s\n: %s\n\n" (buffer-name) (um-iso-8601)) - ) - ) + (interactive) + (insert + (format "# %s\n: %s\n\n" (buffer-name) (format-time-string um-date-format)) + )) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; find-file-at-point