Tuesday, October 28, 2025

Adding Moon Void of Course Events to Org-Agenda via Diary

In a previous post, I demonstrated how to create an Org file that has Moon Void of Course events. However, I found that the events don't show up in all Custom views of Org Agenda, such as when a Custom Command defines a single org file. So here's an alternate method for displaying the events in the Agenda, which I prefer. It involves adding the events to a special diary file, such as mvoc.

To make this work, you'll need to use fancy diary display, which means setting diary-display-function to diary-fancy-display. As well, evaluate and add these statements into your Emacs config / init file, as explained in the Emacs manual in the Fancy Diary Display node.1

(add-hook 'diary-list-entries-hook 'diary-include-other-diary-files)
(add-hook 'diary-mark-entries-hook 'diary-mark-included-diary-files)

Recall that we created a spreadsheet document in the first post on this topic.2 Then we modified it in a subsequent post3 to create the mvoc.org file. Now we'll modify it again so we end up with something like this in the mvoc diary file:

Oct 28, 2025 22:38 Moon Void of Course
Oct 28, 2025 22:55 Moon entering Aquarius after void

The date format shown above is the default. Alternatively, you can use a date format specified by calendar-date-style.

Here are the steps to create a diary file with Moon void of course events like the ones shown above. Again, we begin with the spreadsheet that was created in steps 1 through 4 of the initial post.

  1. Add a new sheet to the document; name it mvoc.
  2. Enter the following in cell A1. Please note that the tilde character represents a line continuation character. In fact the content should be entered without line breaks:
    1. =TEXT($moon_void_of_course_table_2025.A2,"MMM D, YYYY HH:MM") & ~
    2. " Moon void of course" & UNICHAR(13) & UNICHAR(10) & ~
    3. >TEXT($moon_void_of_course_table_2025.B2,"MMM D, YYYY HH:MM") & ~
    4. " Moon void of course entering " & $moon_void_of_course_table_2025.C2
  3. Set the row height to at least two times its default height so that you can see the result in its entirety.
  4. Save the spreadsheet in its native format (Excel as an XLSx file; LibreOffice Calc, ODS). A lot of work went into entering the formula in A1 -- it would be highly frustrating if that got lost!
  5. As before, we will pause and breathe for discussion.
    1. The reference to $moon_void_of_course_table_2025.A2 in 6.1 returns the date and time that the void begins. Similarly, $moon_void_of_course_table_2025.B2 in 6.3 returns the date and time that the void ends.
    2. The aforementioned dates and times are formatted with the TEXT worksheet function to ensure that the date is represented in MMM D, YYY format (Oct. 28, 2025, for example), followed by the time in 24-hour notation, where 23:45 is 11:45 pm. We omit the seconds because it won't show up properly in the Agenda. And anyway, seconds are omitted from the data; the event's timing probably isn't determined with enough accuracy to warrant it.
    3. In 6.2 we define the description of the start time; it will say simply, "Moon void of course." That text is terminated by a line ending for DOS/Windows; the two "UNICHAR" worksheet functions resolve to Carriage Return / Linefeed characters. You might need to specify this differently for non-Windows systems.
    4. Similarly in 6.4, we define the description of the end time, for example "Moon void of course entering Aquarius." Although instead of "Aquarius" it could be any Zodiac sign specified in Column C of the source sheet.
    5. The formula in cell A1 will create two lines in the diary file that define the start and end of the event.
  6. Starting at cell A1, fill down until all the data of the first sheet is included.
  7. Save the spreadsheet again.
  8. In step 8 of the initial post, I instructed to "Export the new sheet as a CSV file." We'll want to do that again. But this time it's necessary to pay attention to LibreOffice's "Export Text File" dialog box that precedes the Save dialog box (as we did when creating the mvoc.org file). Ensure that the Field Delimiter and String Delimiter dropdown boxes are blank as shown in Figure 1. Otherwise, each heading will be preceded by a double quote character, and the lines might end with a comma.
  9. Remove the extension from the newly-created CSV, and copy it to your home directory. Now there should be a file called mvoc; to verify, use Emacs to visit the file. The default keystrokes would be C-x C-f ~/.mvoc followed by ENTER.
  10. Open the diary file. By default the file is named diary and it's located in the home directory. Add the following in the first line: #include "mvoc" and save it.
  11. Press C-c a a to view the default agenda view. A screenshot of today's agenda is shown in Figure 2 below.
Figure 1: The LibreOffice Export Text File dialog box with Field delimiter and String delimiter fields blank
Figure 1: The LibreOffice Export Text File dialog box with Field delimiter and String delimiter fields blank


Figure 2: Agenda View for Tuesday, October 28.  It shows that Moon is void of course from 10:38pm to 10:55pm.

Please let me know if you found this useful or if you have suggestions for improvement.


1https://www.gnu.org/software/emacs/manual/html_node/emacs/Fancy-Diary-Display.html

2https://ludditegeek.blogspot.com/2025/10/add-moon-void-of-course-dates-to-google.html

3https://ludditegeek.blogspot.com/2025/10/an-org-file-to-report-when-moon-is-void.html

No comments: