From 10207ecd4a3de9796ebbdec377eecc94c401657b Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Tue, 15 Jul 2025 09:56:41 -0400 Subject: [PATCH] org capture templates --- modules/home-manager/emacs/emacs/init.el | 78 +++++------------------- modules/home-manager/email-work.nix | 4 ++ 2 files changed, 18 insertions(+), 64 deletions(-) diff --git a/modules/home-manager/emacs/emacs/init.el b/modules/home-manager/emacs/emacs/init.el index 6776d51..2f2442e 100644 --- a/modules/home-manager/emacs/emacs/init.el +++ b/modules/home-manager/emacs/emacs/init.el @@ -5,7 +5,6 @@ ;; disable package.el on startup (setq package-enable-at-startup nil) - ;; bootstrap `straight.el` (defvar bootstrap-version) (let ((bootstrap-file @@ -119,16 +118,22 @@ (org-log-into-drawer t) (org-log-done 'time) (org-todo-keywords - '((sequence "TODO(t)" "NEXT(n)" "HOLD(h@)" "|" "DONE(d)" "CANCELLED(c@/!)"))) + '((sequence "TODO(t)" "NEXT(n)" "PROG(p)" "INTR(i)" "|" "DONE(d)" "CANCELLED(c)"))) (org-capture-templates - `(("i" "Inbox" entry (file "inbox.org") + `(("i" "Inbox" entry (file+headline "todo.org" "Inbox") ,(concat "* TODO %?\n" - "/Entered on/ %U")) - ("@" "Inbox [email]" entry (file "inbox.org") + "%U")) + ("j" "Journal" entry (file denote-journal-path-to-new-or-existing-entry) + "* %U %?\n%i\n%a" + :kill-buffer t + :empty-lines 1) + ("@" "Inbox [email]" entry (file+headline "todo.org" "Inbox") ,(concat "* TODO Process \"%a\" %?\n" - "/Entered on/ %U")))) + "%U")))) (org-refile-use-outline-path 'file) (org-outline-path-complete-in-steps nil) + (org-refile-targets '((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9))) :config (setq org-directory "~/org") (setq org-agenda-files (list "todo.org")) @@ -142,61 +147,6 @@ :straight t :hook (org-mode . toc-org-mode)) -;; (use-package org-roam -;; :ensure t -;; :straight t -;; :custom -;; (org-roam-directory (file-truename "~/org")) -;; (org-roam-capture-templates -;; '(("d" "default" plain "%?" -;; :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" -;; "#+title: ${title}\n#+date: %U\n")) -;; ("p" "project" plain "* People\n\n* Tasks\n\n** TODO Add initial tasks\n\n* Dates\n\n" -;; :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: project") -;; :unnarrowed t))) -;; (org-roam-dailies-capture-templates -;; '(("d" "default" entry "* %<%I:%M %p>: %?" -;; :if-new (file+head "%<%Y-%m-%d>.org" -;; "#+title: %<%Y-%m-%d>\n") -;; :unnarrowed t))) -;; :bind (("C-c n l" . org-roam-buffer-toggle) -;; ("C-c n f" . org-roam-node-find) -;; ("C-c n g" . org-roam-graph) -;; ("C-c n i" . org-roam-node-insert) -;; ("C-c n c" . org-roam-capture) -;; ("C-c n b" . mthomson/org-roam-capture-inbox) -;; ;; Dailies -;; ("C-c n j" . org-roam-dailies-capture-today)) -;; :config -;; ;; If you're using a vertical completion framework, you might want a more informative completion interface -;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag))) -;; (org-roam-db-autosync-mode) -;; ;; If using org-roam-protocol -;; (require 'org-roam-protocol) -;; (defun mthomson/org-roam-filter-by-tag (tag-name) -;; (lambda (node) -;; (member tag-name (org-roam-node-tags node)))) - -;; (defun mthomson/org-roam-list-notes-by-tag (tag-name) -;; (mapcar #'org-roam-node-file -;; (seq-filter -;; (mthomson/org-roam-filter-by-tag tag-name) -;; (org-roam-node-list)))) - -;; (defun mthomson/org-roam-refresh-agenda-list () -;; (interactive) -;; (setq org-agenda-files (mthomson/org-roam-list-notes-by-tag "project"))) - -;; (advice-add 'org-agenda :before #'mthomson/org-roam-refresh-agenda-list) -;; (advice-add 'org-todo-list :before #'mthomson/org-roam-refresh-agenda-list) -;; (advice-add 'org-refile :before #'mthomson/org-roam-refresh-agenda-list) - -;; (defun mthomson/org-roam-capture-inbox () -;; (interactive) -;; (org-roam-capture- :node (org-roam-node-create) -;; :templates '(("i" "inbox" plain "* %?" -;; :if-new (file+head "Inbox.org" "#+title: Inbox\n")))))) - (use-package denote :ensure t :straight t @@ -225,9 +175,9 @@ (use-package denote-journal :ensure t :straight t - :commands ( denote-journal-new-entry - denote-journal-new-or-existing-entry - denote-journal-link-or-create-entry ) + :commands (denote-journal-new-entry + denote-journal-new-or-existing-entry + denote-journal-link-or-create-entry ) :hook (calendar-mode . denote-journal-calendar-mode) :config (setq denote-journal-directory diff --git a/modules/home-manager/email-work.nix b/modules/home-manager/email-work.nix index bf77928..8230bba 100644 --- a/modules/home-manager/email-work.nix +++ b/modules/home-manager/email-work.nix @@ -69,6 +69,10 @@ notmuch = { enable = true; new.tags = [ "new" ]; + search.excludeTags = [ + "trash" + "spam" + ]; hooks = { postNew = '' notmuch tag +sent -new tag:new from:mthomson@konradgroup.com