From 711adc6148fc5b97e752a8461b4036b0cb6e9f35 Mon Sep 17 00:00:00 2001 From: Szymon Szukalski Date: Mon, 13 Apr 2026 09:31:13 +1000 Subject: Add upfront Org layout validation --- README.org | 8 ++++++-- init.el | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index a3f8b95..8c28993 100644 --- a/README.org +++ b/README.org @@ -87,7 +87,11 @@ The minibuffer completion setup is simple and modern: ** Org Workflow -The Org setup is organized around a heading-based workflow in a single notes file under =~/org=. +The Org setup assumes a personal notes layout rooted at =~/org=, with the main workflow file at =~/org/obtf.org=. +At startup, the configuration validates those two required paths once and shows a soft warning if either is missing. +Emacs still starts normally, but Org workflow features may not work as expected until the layout is in place. + +The workflow itself is organized around headings in that single notes file. Key behaviors include: - Home agenda command on startup @@ -102,7 +106,7 @@ Key behaviors include: ** Capture Templates -The capture system stays low-friction and writes into named headings in the default notes file. +The capture system stays low-friction and writes into named headings in the default notes file at =~/org/obtf.org=. Available templates: diff --git a/init.el b/init.el index 46dc111..0bbdcf5 100644 --- a/init.el +++ b/init.el @@ -13,6 +13,23 @@ (file-name-directory (or load-file-name user-init-file default-directory)))) +(defun ss-validate-org-layout () + "Warn once at startup when required Org workflow paths are missing." + (let ((missing-paths nil)) + (unless (file-directory-p org-directory) + (push org-directory missing-paths)) + (unless (file-exists-p org-default-notes-file) + (push org-default-notes-file missing-paths)) + (when missing-paths + (display-warning + 'ss-org + (format + "Missing required Org workflow paths: %s. Org workflow features may not work as expected." + (mapconcat #'identity (nreverse missing-paths) ", ")) + :warning)))) + +(add-hook 'emacs-startup-hook #'ss-validate-org-layout) + ;; -------------------------------------------------- ;; Startup: agenda as modal view ;; -------------------------------------------------- @@ -142,8 +159,7 @@ ("C-c r" . org-refile)) :init (setq org-agenda-files - (delq nil (list (and (file-exists-p org-default-notes-file) - org-default-notes-file))) + (list org-default-notes-file) org-agenda-custom-commands '(("h" "Home" ((agenda "" -- cgit v1.2.3