summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@szymonszukalski.com>2026-04-13 09:31:13 +1000
committerSzymon Szukalski <szymon@szymonszukalski.com>2026-04-13 09:31:13 +1000
commit711adc6148fc5b97e752a8461b4036b0cb6e9f35 (patch)
tree1366a5754dca14151369c58d93d4c765e7331577
parent0c2980f337ca6440507fb518f2649a921791130e (diff)
Add upfront Org layout validation
-rw-r--r--README.org8
-rw-r--r--init.el20
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 ""