From 352f61ef62df83ec3d8b527ebed1fc40d7b80527 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 15 Aug 2021 23:40:49 -0700 Subject: [PATCH] [oni-org] Simplify usage of inbox.org Instead of everything that needs to explicitly mentioning inbox.org, make it the default notes file. Usually all new notes should be captured in there and will be moved up to other places. --- oni-org/capture-templates/inbox.org | 8 ---- oni-org/oni-org.el | 57 ++++++++++++++++------------- 2 files changed, 31 insertions(+), 34 deletions(-) delete mode 100644 oni-org/capture-templates/inbox.org diff --git a/oni-org/capture-templates/inbox.org b/oni-org/capture-templates/inbox.org deleted file mode 100644 index d01d210..0000000 --- a/oni-org/capture-templates/inbox.org +++ /dev/null @@ -1,8 +0,0 @@ -* %? -:PROPERTIES: -:CREATED: %U -:ORIGIN: %a -:END: - -#+BEGIN: oni-backlinks -#+END diff --git a/oni-org/oni-org.el b/oni-org/oni-org.el index 77e9579..3646d57 100644 --- a/oni-org/oni-org.el +++ b/oni-org/oni-org.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2021.0812.213913 +;; Version: 2021.0815.233720 ;; Package-Requires: (oni-yasnippet oni-alert oni-hydra org org-contrib org-bullets org-edna diminish all-the-icons olivetti) ;; This program is free software; you can redistribute it and/or modify @@ -65,6 +65,14 @@ (expand-file-name "icons" oni-org-root) "The directory where ‘oni-org’ stores its icons.") +(defconst oni-org-todo-dir + (expand-file-name "documents/gtd" (getenv "HOME")) + "The directory where all the TODO notes are stored.") + +(defconst oni-org-todo-main-file + (expand-file-name "everything.org" oni-org-todo-dir) + "The main file for TODO notes.") + ;;; Fake org-roam -- oni-org-exocortex ;; I tried using org-roam v2 with Orgro, but it didn’t work. I’ve only been ;; using org-roam to more easily find and insert strings. The file renaming in @@ -383,7 +391,7 @@ _di_: Add inlineimages STARTUP ;; when my term is 19 characters long. (setq org-list-description-max-indent 5) -(setq org-default-notes-file "~/documents/gtd/everything.org") +(setq org-default-notes-file (expand-file-name "inbox.org" oni-org-todo-dir)) (setq org-bibtex-autogen-keys t) (defun oni-org-find-heading-in-file (heading file &optional move) @@ -527,7 +535,7 @@ also move point to the start of the heading." (,(rx string-start "comm" string-end) ,(expand-file-name "bs-telephone-fill.svg" oni-org-icons-dir) ,@svg))))) (setq org-agenda-files - (cons org-default-notes-file + (cons oni-org-todo-main-file (mapcar (lambda (file) (expand-file-name file oni-org-exocortex-directory)) (split-string (let ((default-directory oni-org-exocortex-directory)) @@ -538,7 +546,10 @@ also move point to the start of the heading." (setq org-agenda-restore-windows-after-quit t) (setq org-agenda-custom-commands - '(("i" "Inbox" tags "CATEGORY=\"inbox\"") + '(("i" "Inbox" todo "" + ((org-agenda-files (list org-default-notes-file)) + (org-agenda-cmp-user-defined (lambda (_ _) -1)) + (org-agenda-sorting-strategy '(user-defined-up)))) ("t" "Todo" tags-todo "TODO=\"TODO\"-CATEGORY=\"inbox\"+SCHEDULED=\"\"") ("r" "Reading list" tags-todo "TODO=\"READ\"+SCHEDULED=\"\"-Effort=\"\"" ((org-overriding-columns-format "%8CATEGORY %ITEM %3EFFORT") @@ -629,30 +640,12 @@ After running it once remove it from `org-capture-after-finalize-hook'." (mapconcat (lambda (n) (format "** READ %s" n)) names "\n")) (setq org-capture-templates - `(("i" "Inbox" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) - (file ,(expand-file-name "inbox.org" oni-org-capture-template-directory))) - ("I" "Inbox (add selection)" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) - (file ,(expand-file-name "inbox-with-selection.org" oni-org-capture-template-directory))) - ("a" "Appointment" entry (file "") - (file ,(expand-file-name "appointment.org" oni-org-capture-template-directory))) - ("A" "Album" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) - "* %^{Artist} - %^{Album Name} -** TODO Listen to %\\1 - %\\2 -** TODO Rip %\\1 - %\\2 to disk -** TODO Add album art to %\\1 - %\\2 -** TODO Transfer %\\1 - %\\2 to phone" - :immediate-finish t) - ("m" "Code Magazine Issue" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) - "* CODE Issue %(oni-org-format-months) -** READ Editorial -%(oni-org-format-names (oni-org-ask-names))" - :immediate-finish t) - ("t" "Task" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) + `(("t" "Task" entry (file "") (file ,(expand-file-name "task.org" oni-org-capture-template-directory))) - ("u" "URL to read" entry (file ,(oni-org-expand-to-home "documents/gtd/inbox.org")) + ("u" "URL to read" entry (file "") (file ,(expand-file-name "reading-url.org" oni-org-capture-template-directory)) :immediate-finish t) - ("U" "URL to read" entry (file ,(expand-file-name "documents/gtd/inbox.org")) + ("U" "URL to read" entry (file "") (file ,(expand-file-name "reading-url-protocol.org" oni-org-capture-template-directory)) :immediate-finish t) ("j" "Journal entry" entry @@ -661,6 +654,18 @@ After running it once remove it from `org-capture-after-finalize-hook'." ("n" "Reading note" item (function oni-org-reading-note) (file ,(expand-file-name "reading-note.org" oni-org-capture-template-directory)) :empty-lines 1) + ("A" "Album" entry (file "") + "* %^{Artist} - %^{Album Name} +** TODO Listen to %\\1 - %\\2 +** TODO Rip %\\1 - %\\2 to disk +** TODO Add album art to %\\1 - %\\2 +** TODO Transfer %\\1 - %\\2 to phone" + :immediate-finish t) + ("m" "Code Magazine Issue" entry (file "") + "* CODE Issue %(oni-org-format-months) +** READ Editorial +%(oni-org-format-names (oni-org-ask-names))" + :immediate-finish t) ("c" "Add to currently clocked item") ("ca" "Note" plain (clock) @@ -707,7 +712,7 @@ After running it once remove it from `org-capture-after-finalize-hook'." org-log-refile 'time) (setq org-refile-targets '((nil . (:maxlevel . 10)) - (org-default-notes-file . (:maxlevel . 10)))) + (oni-org-todo-main-file . (:maxlevel . 10)))) ;;; Export (require 'ox-html)