diff --git a/init.el b/init.el index 3bf951b..f081d04 100644 --- a/init.el +++ b/init.el @@ -297,6 +297,7 @@ org-break-task-id org-home-task-id db/org-clock-current-task-file + db/org-default-org-file db/org-default-work-file db/org-default-home-file db/org-default-notes-file diff --git a/site-lisp/db-customize.el b/site-lisp/db-customize.el index 04b51f0..ca85974 100644 --- a/site-lisp/db-customize.el +++ b/site-lisp/db-customize.el @@ -97,6 +97,12 @@ If this path is not set, i.e., is null, no automatic download will happen." ;; custom setters. Thus, the only reasonable thing to do is to not update ;; `org-agenda-files' automatically and leave it to the user to update it. +(defcustom db/org-default-org-file nil + "Path to default org-mode file for general use. +You may also want to add this file to `org-agenda-files'." + :group 'personal-settings + :type '(choice (const nil) file)) + (defcustom db/org-default-work-file nil "Path to default org-mode file at work. You may also want to add this file to `org-agenda-files'." @@ -134,8 +140,7 @@ in the main agenda view." '(("Mail" ?m db/gnus) ("Agenda" ?a db/org-agenda) ("Init File" ?i db/find-user-init-file) - ("Home Org File" ?h #'(lambda () (interactive) (find-file db/org-default-home-file))) - ("Work Org File" ?w #'(lambda () (interactive) (find-file db/org-default-work-file))) + ("Main Org File" ?o #'(lambda () (interactive) (find-file db/org-default-org-file))) ("EMMS" ?M emms) ("Shell" ?s db/run-or-hide-shell) ("EShell" ?e db/run-or-hide-eshell) diff --git a/site-lisp/db-org.el b/site-lisp/db-org.el index be521fb..77ca8f5 100644 --- a/site-lisp/db-org.el +++ b/site-lisp/db-org.el @@ -26,13 +26,14 @@ (defun db/check-special-org-files-in-agenda (&rest args) "Check whether the special org-mode files are part of `org-agenda-files', ignoring ARGS. -The special org-mode files are `db/org-default-work-file', -`db/org-default-home-file', `db/org-default-notes-files', and -`db/org-default-refile-file'." +The special org-mode files are `db/org-default-org-file', +`db/org-default-work-file', `db/org-default-home-file', +`db/org-default-notes-files', and `db/org-default-refile-file'." (ignore args) (require 'org) (let ((agenda-files (mapcar #'file-truename (org-agenda-files t)))) - (dolist (file '(db/org-default-home-file + (dolist (file '(db/org-default-org-file + db/org-default-home-file db/org-default-work-file db/org-default-notes-file db/org-default-refile-file)) @@ -562,7 +563,8 @@ This is done only if the value of this variable is not null." (progn (org-save-all-org-buffers) (let ((org-agenda-files (cl-remove-if #'null - (list db/org-default-home-file + (list db/org-default-org-file + db/org-default-home-file db/org-default-work-file))) (org-agenda-new-buffers nil)) ;; check whether we need to do something