From 69413c7d25dff2a08568aa1c27bd976b233a0371 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Tue, 17 Nov 2015 09:35:24 +0100 Subject: Emacs: Add function to read yesterday’s journal --- tag-emacs/emacs.d/init.org | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tag-emacs/emacs.d') diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org index 8c90cbae..7a6ee4be 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 -- cgit 1.4.1