diff options
| author | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-13 09:31:13 +1000 |
|---|---|---|
| committer | Szymon Szukalski <szymon@szymonszukalski.com> | 2026-04-13 09:31:13 +1000 |
| commit | 711adc6148fc5b97e752a8461b4036b0cb6e9f35 (patch) | |
| tree | 1366a5754dca14151369c58d93d4c765e7331577 | |
| parent | 0c2980f337ca6440507fb518f2649a921791130e (diff) | |
Add upfront Org layout validation
| -rw-r--r-- | README.org | 8 | ||||
| -rw-r--r-- | init.el | 20 |
2 files changed, 24 insertions, 4 deletions
@@ -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: @@ -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 "" |
