summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d
diff options
context:
space:
mode:
authorAlan Pearce2015-11-17 09:35:24 +0100
committerAlan Pearce2015-11-17 09:35:24 +0100
commit69413c7d25dff2a08568aa1c27bd976b233a0371 (patch)
tree6fe952e7c3aa98674364e345c1d3bd9cb5371f68 /tag-emacs/emacs.d
parent4f8474bb4397513c51f3b997aab94855200f29bf (diff)
downloaddotfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.tar.lz
dotfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.tar.zst
dotfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.zip
Emacs: Add function to read yesterday’s journal
Diffstat (limited to 'tag-emacs/emacs.d')
-rw-r--r--tag-emacs/emacs.d/init.org12
1 files changed, 11 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index 8c90cba..7a6ee4b 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -846,6 +846,12 @@ Sometimes I want to insert a date or time into a buffer.
     (insert (format-time-string format))))
 #+END_SRC
 
+#+BEGIN_SRC emacs-lisp
+  (defun yesterday-time ()
+    "Provide the date/time 24 hours before the time now in the format of current-time."
+    (timer-relative-time (current-time) -86400))
+#+END_SRC
+
 ** Time of Day
 
 #+BEGIN_SRC emacs-lisp
@@ -1562,7 +1568,11 @@ I can use this to keep a journal.  I should use it.
     :bind ("s-j" . org-journal-new-entry)
     :defer 20
     :config (progn
-              (setq org-journal-date-format "%A, %d %B %Y")))
+              (setq org-journal-date-format "%A, %d %B %Y")
+              (defun org-journal-display-entry-yesterday ()
+                "Show org-journal entry for yesterday"
+                (interactive "P")
+                (org-journal-read-or-display-entry (yesterday-time)))))
 #+END_SRC
 
 **** org-mobile