commit c6fb48e34594bf0852e4f81ac66e31ae02333471
parent 42c7dbabd0d565f628774ee70c92df988fd3a2ed
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 26 Jun 2020 16:07:34 +0200
tools/emacs: update org configuration 📙
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
2 files changed, 20 insertions(+), 33 deletions(-)
diff --git a/tools/emacs/config/config-org.el b/tools/emacs/config/config-org.el
@@ -273,37 +273,6 @@
:empty-lines 1))
;; -OrgCaptureTask
- ;; OrgCaptureJournalBase
- (add-to-list 'org-capture-templates
- `("j" "Journal"))
- ;; -OrgCaptureJournalBase
-
- ;; OrgCaptureJournalEntry
- (add-to-list 'org-capture-templates
- `("j" "Journal entry"))
- (add-to-list 'org-capture-templates
- `("jj" "Journal entry" entry
- (file+datetree ,org-journal-file)
- (file ,(concat user-emacs-directory "/etc/orgmode/journal.org"))
- :empty-lines 1 :clock-in t :clock-resume t))
- ;; -OrgCaptureJournalEntry
-
- ;; OrgCaptureWorklog
- (add-to-list 'org-capture-templates
- `("jw" "Worklog (journal) entry" entry
- (file+datetree ,org-journal-file)
- (file ,(concat user-emacs-directory "/etc/orgmode/worklog.org"))
- :unnarrowed t))
- ;; -OrgCaptureWorklog
-
- ;; OrgCaptureWeekly
- (add-to-list 'org-capture-templates
- `("je" "Weekly review" entry
- (file+datetree,org-journal-file)
- (file ,(concat user-emacs-directory "/etc/orgmode/weekly.org"))
- :clock-in t :clock-resume t :unnarrowed t))
- ;; -OrgCaptureWeekly
-
;; OrgCaptureMeetingNote
(add-to-list 'org-capture-templates
`("m" "Meeting notes" entry
@@ -635,9 +604,27 @@ With prefix argument, also display headlines without a TODO keyword."
:unnarrowed t))))
(use-package org-journal
+ :commands (org-journal-new-entry org-capture)
+ :after (org-capture)
:bind
(("C-c n j" . org-journal-new-entry)
("C-c o j" . org-journal-new-entry))
+ :init
+ (defun org-journal-find-location ()
+ "Open today's journal, but inhibiting inserting the heading, leaving that to the template."
+ (org-journal-new-entry t)
+ ;; position pont on the journal's top-level heading so that org-capture will add the new entry as a child.
+ (goto-char (point-max)))
+ (add-to-list 'org-capture-templates
+ `("j" "Journal"))
+ (add-to-list 'org-capture-templates
+ `("jj" "Journal entry" entry (function org-journal-find-location)
+ "* %(format-time-string org-journal-time-format)%^{Title}\n%i%?"
+ :empty-lines 1 :clock-in t :clock-resume t))
+ (add-to-list 'org-capture-templates
+ `("je" "Weekly review" entry (function org-journal-find-location)
+ (file ,(expand-file-name "etc/orgmode/weekly.org" user-emacs-directory))
+ :empty-lines 1 :clock-in t :clock-resume t))
:custom
(org-journal-date-prefix "* ")
(org-journal-file-header "#+TITLE: %Y-v%m Journal\n\n")
@@ -647,5 +634,5 @@ With prefix argument, also display headlines without a TODO keyword."
(org-journal-enable-agenda-integration nil))
-(provide 'config-org)
+ (provide 'config-org)
;;; config-org.el ends here
diff --git a/tools/emacs/etc/orgmode/weekly.org b/tools/emacs/etc/orgmode/weekly.org
@@ -1,4 +1,4 @@
-* weekly review :weekly:review:
+* %(format-time-string org-journal-time-format) weekly review :weekly:review:
%U
- [ ] review [[file:../projects/inbox.org][~inbox.org~]]