From 852dfc904566fdf573daa03218c940aead69525b Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Tue, 14 Jul 2020 11:49:06 -0700 Subject: [PATCH] make refile and agenda creation generalized --- emacs_el/configuration/don-configuration.org | 49 +++++++++----------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/emacs_el/configuration/don-configuration.org b/emacs_el/configuration/don-configuration.org index 854cbe7..9aeb4e7 100644 --- a/emacs_el/configuration/don-configuration.org +++ b/emacs_el/configuration/don-configuration.org @@ -980,7 +980,7 @@ This can be used to link things pretty quickly if necessary ("o" (find-file "~/projects/org-notes/ool.org")) ("f" (find-file "~/projects/org-notes/fh.org")) ("s" (find-file "~/projects/org-notes/sndservers.org")) - ("r" (find-file "~/projects/org-notes/refile.org")) + ("r" (find-file my/org-refile-file)) ("p" (find-file "~/projects/research/papers_to_read.org")) ("R" (find-file "~/projects/research/paper_notes.org")) ("h" (find-file "~/projects/org-notes/hpcbio.org")) @@ -1572,24 +1572,19 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori ; org mode agenda files (setq org-agenda-files - (quote ("~/projects/org-notes/debbugs.org" - "~/projects/org-notes/notes.org" - "~/projects/org-notes/holidays.org" - "~/projects/org-notes/refile.org" - "~/projects/org-notes/diary.org" - "~/projects/org-notes/ool.org" - "~/projects/org-notes/sndservers.org" - "~/projects/org-notes/chaim.org" - "~/projects/org-notes/wildman.org" - "~/projects/org-notes/uddin.org" - "~/projects/org-notes/reviews.org" - "~/projects/org-notes/laurel.org" - "~/projects/org-notes/from-calendar.org" - "~/org-mode/from-mobile.org" - "~/projects/org-notes/fh.org"))) + (append + (file-expand-wildcards "~/projects/org-notes/*.org") + (file-expand-wildcards "~/org-mode/from-mobile.org") + (file-expand-wildcards "~/org-notes-*/*.org") + ) + ) + (setq my/org-refile-file + (car (seq-filter + (lambda (file) (string-match-p (regexp-quote "/refile.org") file)) + org-agenda-files))) (set-register ?n (cons 'file "~/projects/org-notes/notes.org")) - (set-register ?r (cons 'file "~/projects/org-notes/refile.org")) + (set-register ?r (cons 'file my/org-refile-file)) (set-register ?o (cons 'file "~/projects/org-notes/ool.org")) (set-register ?s (cons 'file "~/projects/org-notes/sndservers.org")) (set-register ?c (cons 'file "~/projects/org-notes/chaim.org")) @@ -1621,33 +1616,33 @@ From http://julien.danjou.info/projects/emacs-packages#rainbow-mode, this colori ** Capture Templates #+BEGIN_SRC emacs-lisp (setq org-capture-templates ;; mail-specific note template, identified by "m" - `(("m" "Mail" entry (file "~/projects/org-notes/refile.org") + `(("m" "Mail" entry (file my/org-refile-file) "* %?\n\n Source: %u, [[%:link][%:description]]\n %:initial") - ("t" "todo" entry (file "~/projects/org-notes/refile.org") + ("t" "todo" entry (file my/org-refile-file) "* TODO %?\n :PROPERTIES:\n :END:\n :LOGBOOK:\n :END:\n%U\n%a\n" :clock-in t :clock-resume t) - ("r" "respond" entry (file "~/projects/org-notes/refile.org") + ("r" "respond" entry (file my/org-refile-file) "* NEXT Respond to %:from on %:subject\nSCHEDULED: %t\n%U\n%a\n" :clock-in t :clock-resume t :immediate-finish t) - ("n" "note" entry (file "~/projects/org-notes/refile.org") + ("n" "note" entry (file my/org-refile-file) "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t) - ("s" "schedule" entry (file "~/projects/org-notes/refile.org") + ("s" "schedule" entry (file my/org-refile-file) "* %? :cal:\n%^{scheduled:}t\n%U\n%a\n" :clock-in t :clock-resume t) ("j" "Journal" entry (file+datetree "~/projects/org-notes/diary.org") "* %?\n%U\n" :clock-in t :clock-resume t) - ("w" "org-protocol" entry (file "~/projects/org-notes/refile.org") + ("w" "org-protocol" entry (file my/org-refile-file) "* TODO Review %c\n%U\n" :immediate-finish t) - ("M" "Meeting" entry (file "~/projects/org-notes/refile.org") + ("M" "Meeting" entry (file my/org-refile-file) "* MEETING with %? :MEETING:\n%U" :clock-in t :clock-resume t) - ("S" "Seminar" entry (file "~/projects/org-notes/refile.org") + ("S" "Seminar" entry (file my/org-refile-file) "* SEMINAR notes %? :SEMINAR:\n%U" :clock-in t :clock-resume t) ("P" "Paper to read" entry (file+headline "~/projects/research/papers_to_read.org" "Refile") "* TODO Get/Read %? \n%U" :clock-in t :clock-resume t) - ("p" "Phone call" entry (file "~/projects/org-notes/refile.org") + ("p" "Phone call" entry (file my/org-refile-file) "* PHONE %? :PHONE:\n%U" :clock-in t :clock-resume t) ("J" "job" entry (file+olp "~/projects/org-notes/notes.org" "Jobs" ,(format-time-string "Positions %Y")) "* TODO Apply for %? :job:\nSCHEDULED: <%<%Y-%m-%d>>\n%U\n%x\n" :clock-in t :clock-resume t) - ("h" "Habit" entry (file "~/projects/org-notes/refile.org") + ("h" "Habit" entry (file my/org-refile-file) "* NEXT %?\n%U\n%a\nSCHEDULED: %(format-time-string \"<%Y-%m-%d .+1d/3d>\")\n:PROPERTIES:\n:STYLE: habit\n:REPEAT_TO_STATE: NEXT\n:END:\n%a\n") ) ) -- 2.39.5