org-journal
org-journal copied to clipboard
org-journal-new-entry-from-agenda
Presently there's no way to add journal items for future dates directly from the *Org Agenda*
buffer.
The following function frankensteins together ideas from other functions to create a solution:
(defun org-journal-new-entry-from-agenda (prefix)
"Add journal entry for the date at point in the agenda."
(interactive "P")
(org-agenda-check-type t 'agenda)
(let* ((day (or (get-text-property (min (1- (point-max)) (point)) 'day)
(user-error "Don't know which date to open in calendar")))
(time (org-time-string-to-time (format-time-string "%Y-%m-%d" (org-time-from-absolute day)))))
(org-journal-new-scheduled-entry prefix time)))
The current work around would be to press c j n
to jump to the calendar and then insert a new journal item for that date. Nothing wrong with this, but I think having a standalone function that can be bound directly, as above, would be better.
That's a cool idea!
If I'm reading your code correctly, it is meant to be invoked from within an agenda view, right? Is there a way to add a keyboard shortcut or something similar that is only available inside that agenda-view?