Add automatic ID property generation to org capture templates

Use org-id-new to generate UUIDs for new entries, matching the format
used by org-roam. Updates imalison:created-property-string, both
template helper functions, and the habit capture template.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-20 07:22:27 -05:00
parent 3e805b172e
commit c70d6a9e99

View File

@@ -76,6 +76,7 @@ We're going to use this to write separate parts of our config to different secti
(defvar imalison:created-property-string " (defvar imalison:created-property-string "
:PROPERTIES: :PROPERTIES:
:ID: %(org-id-new)
:CREATED: %U :CREATED: %U
:END:") :END:")
#+end_src #+end_src
@@ -591,6 +592,7 @@ specific time, they should appear in the agenda at that time!
(with-temp-buffer (with-temp-buffer
(org-mode) (org-mode)
(insert content) (insert content)
(org-set-property "ID" (org-id-new))
(org-set-property "CREATED" (org-set-property "CREATED"
(with-temp-buffer (with-temp-buffer
(org-insert-time-stamp (org-insert-time-stamp
@@ -607,6 +609,7 @@ specific time, they should appear in the agenda at that time!
(org-insert-heading) (org-insert-heading)
(insert content) (insert content)
(org-todo creation-state) (org-todo creation-state)
(org-set-property "ID" (org-id-new))
(org-set-property "CREATED" (org-set-property "CREATED"
(with-temp-buffer (with-temp-buffer
(org-insert-time-stamp (org-insert-time-stamp
@@ -696,6 +699,7 @@ specific time, they should appear in the agenda at that time!
"* TODO "* TODO
SCHEDULED: %^t SCHEDULED: %^t
:PROPERTIES: :PROPERTIES:
:ID: %(org-id-new)
:CREATED: %U :CREATED: %U
:STYLE: habit :STYLE: habit
:END:")) :END:"))