Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show entries in Calendar #389

Open
x61 opened this issue Jul 7, 2024 · 4 comments
Open

Show entries in Calendar #389

x61 opened this issue Jul 7, 2024 · 4 comments

Comments

@x61
Copy link

x61 commented Jul 7, 2024

With org-journal.el, your journal entry for the day are indicated in the calendar.el. I was thinking could we have denote notes show up in calendar as well? So if there is an entry for the day, there could be an indicator in the calendar that an entry was entered that day and perhaps, provide an option to list all entries for that day.

@protesilaos
Copy link
Owner

protesilaos commented Jul 10, 2024 via email

@jonathanwilner
Copy link

jonathanwilner commented Aug 20, 2024

This is the code from org-journal that does it. It just adds the file to org-agenda-files. Considering that the use case is based on org-journal. restricting this to org-mode & org-agenda seems OK vs. a broader calendar.el / diary approach.

I believe this can be done right now via user-specific emacs lisp. It would certainly be cool to have it out-of-the-box from Denote, especially if it's linked to a specific silo or silos.

(defun org-journal--update-org-agenda-files ()
  "Adds the current and future journal files to `org-agenda-files'
containing TODOs, and cleans out past org-journal files."
  (when org-journal-enable-agenda-integration
    (let ((not-org-journal-agenda-files
           (seq-filter
            (lambda (fname)
              (not (string-match (org-journal--dir-and-file-format->pattern) fname)))
            (org-agenda-files)))
          (org-journal-agenda-files
           (let* ((future (org-journal--read-period 'future))
                  (beg (car future))
                  (end (cdr future)))
             (setcar (cdr beg) (1- (cadr beg))) ;; Include today; required for `org-journal--search-build-file-list'
             (when (< (nth 2 (decode-time (current-time))) org-extend-today-until)
               (setq beg (decode-time (apply #'encode-time `(0 59 -1 ,(nth 1 beg) ,(nth 0 beg) ,(nth 2 beg))))
                     beg (list (nth 4 beg) (nth 3 beg) (nth 5 beg))))
             (org-journal--search-build-file-list
              (org-journal--calendar-date->time beg)
              (org-journal--calendar-date->time end)))))
      (org-store-new-agenda-file-list (append not-org-journal-agenda-files
                                              org-journal-agenda-files)))))
`

@protesilaos
Copy link
Owner

protesilaos commented Sep 1, 2024 via email

@protesilaos
Copy link
Owner

Hello folks! Just to note that I am interested to learn more about how to potentially highlight journal entries in the M-x calendar. The inclusion into the org-agenda-files is another option, though I think that is separate: it is probably more useful for some workflow that involves monthly/weekly/daily planning (which the user wants to maintain as standalone files).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants