From 1aef127f4bf35917829d22b18593fee64974ccb1 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 12 Jun 2026 10:00:36 -0500 Subject: fix(org-roam): put dailies #+FILETAGS and #+TITLE on separate lines The "d" dailies head ran FILETAGS and TITLE together with no newline, so every C-c n d daily was malformed: Org never parsed #+TITLE and the FILETAGS value swallowed the rest of the line. Extracted the head into the cj/--org-roam-dailies-head defconst so it is unit-testable (the value was unreachable inside the use-package :custom form) and gave it real newlines. Two ERT tests assert the FILETAGS/TITLE line separation and the trailing newline. --- modules/org-roam-config.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/org-roam-config.el b/modules/org-roam-config.el index fdd9e1fc..218f37d6 100644 --- a/modules/org-roam-config.el +++ b/modules/org-roam-config.el @@ -29,6 +29,12 @@ ;; ---------------------------------- Org Roam --------------------------------- +(defconst cj/--org-roam-dailies-head + "#+FILETAGS: Journal\n#+TITLE: %<%Y-%m-%d>\n" + "Head inserted into a new org-roam daily file. +FILETAGS and TITLE must sit on separate lines so Org parses the +#+TITLE keyword (see `org-roam-dailies-capture-templates').") + (use-package org-roam :defer 1 :commands (org-roam-node-find org-roam-node-insert org-roam-db-autosync-mode) @@ -37,9 +43,9 @@ (org-roam-dailies-directory journals-dir) (org-roam-completion-everywhere t) (org-roam-dailies-capture-templates - '(("d" "default" entry "* %<%I:%M:%S %p %Z> %?" + `(("d" "default" entry "* %<%I:%M:%S %p %Z> %?" :if-new (file+head "%<%Y-%m-%d>.org" - "#+FILETAGS: Journal #+TITLE: %<%Y-%m-%d>")))) + ,cj/--org-roam-dailies-head)))) (org-roam-capture-templates `(("d" "default" plain "%?" -- cgit v1.2.3