org-journal icon indicating copy to clipboard operation
org-journal copied to clipboard

org-journal-new-entry-from-agenda

Open holtzermann17 opened this issue 3 years ago • 1 comments

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.

holtzermann17 avatar May 10 '21 12:05 holtzermann17

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?

bastibe avatar May 12 '21 18:05 bastibe