diff options
author | Alan Pearce | 2015-11-17 09:35:24 +0100 |
---|---|---|
committer | Alan Pearce | 2015-11-17 09:35:24 +0100 |
commit | 69413c7d25dff2a08568aa1c27bd976b233a0371 (patch) | |
tree | 6fe952e7c3aa98674364e345c1d3bd9cb5371f68 /tag-emacs/emacs.d/init.org | |
parent | 4f8474bb4397513c51f3b997aab94855200f29bf (diff) | |
download | nixfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.tar.lz nixfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.tar.zst nixfiles-69413c7d25dff2a08568aa1c27bd976b233a0371.zip |
Emacs: Add function to read yesterday’s journal
Diffstat (limited to 'tag-emacs/emacs.d/init.org')
-rw-r--r-- | tag-emacs/emacs.d/init.org | 12 |
1 files changed, 11 insertions, 1 deletions
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 |