Announcing Casual Calendar
25 Nov 2024 Charles Choi
On first impression, it’s a mixed bag using the Emacs built-in calendar
& diary
, as they both under and over-deliver on features. Users more familiar with GUI-based calendar and journal apps are underwhelmed, as capturing and displaying daily activity with it seem rudimentary at best. Hidden though in calendar
is its support for non-Gregorian calendar systems whose inclusion and history are both amazing and idiosyncratic. As common with Emacs modes, calendar
& diary
rely on user knowledge of its arcane commands and keybindings to make effective use of them. I think such reliance impedes more widespread usage of them, particularly with regards to calendar system conversion and anniversary entry. Given this, I decided to make a Transient-based user interface for calendar
& diary
.
Announcing Casual Calendar, now available in the Casual v2.2 update distributed on MELPA.
In this interface, emphasis has been given to the following workflows:
- Navigation
- Conversion of Gregorian dates to non-Gregorian calendar systems
- Visualizing holidays
- Viewing and creating diary events
- Viewing almanac information (lunar phases, sunrise/sunset times)
- Configuration of
calendar
&diary
settings
Why Use Calendar & Diary?
Though I have initially described calendar
& diary
with faint praise, I do strongly recommend getting to know them better. Their utility shows up in many (often surprising) situations where you need to work with dates. Also, their integration into Org Mode alone makes it worth the effort.
My most common use cases for calendar
& diary
are:
- Lightweight visualization of months within Emacs (no need to leave Emacs to see a basic calendar!)
- Keeping track of periodic events that do not require notes (e.g. birthdays, anniversaries) in Org Agenda
- Org mode timestamp selection
If you share any of these use cases, consider bringing calendar
& diary
into your Emacs journey.
A notable feature of diary
is that it can track periodic events for some non-Gregorian calendars, in particular Bahá’í, Hebrew, Islamic, and Lunar (Chinese). If you find cause to need this feature, you’ll be thankful that you are an Emacs user.
Customizing Calendar & Diary
Both calendar
& diary
have taken a austere aesthetic when it comes to default settings, where they show the strong influence of the Unix cal
command line utility by not visually highlighting holidays or days with diary entries. Users who prefer a richer presentation can follow the following customizations.
To highlight holidays, go to the Settings menu “(,) Settings” and enable “(H) Mark Holidays”.
To highlight diary entries, enable “(E) Mark Diary Entries”.
As sunrise/sunset and lunar phase information is based on location, configuring all the settings in the Location section is advised to enable those features.
Org Agenda users will likely want to include diary
integration. Turn this on using the “(d) Include Diary” setting.
An interactive enhancement when navigating (moving) in the calendar
window is to add the function call (diary-view-entries 1)
to the “(v) Move Hook” setting. This should be called as a lambda expression. In the customize window, it should look like this:
To turn on support for non-Gregorian calendar system diary entries, the two settings “(L) List” and “(M) Mark” must be configured in the section Non-Gregorian Hooks. Note that if you are working with Emacs 29.4 or earlier, you will only see checkboxes for the Bahá’í, Hebrew, and Islamic calendar systems. To get Lunar (Chinese) support requires manual entry of the values diary-chinese-list-entries
and diary-chinese-mark-entries
for “(L) List” and “(M) Mark” respectfully. Thankfully, the upcoming official Emacs 30 release will fix this.
Closing Thoughts
Suffice to say, it is fundamentally human to mark the passage of time. Emacs, by including calendar
& diary
acknowledges this obvious fact. Incorporating calendar
& diary
into my Emacs workflows has yielded considerable benefits, sometimes surprisingly so. My motivation for building Casual Calendar was to make calendar
& diary
easier to use. Perhaps you’ll share the same sentiment.
Some Self-Promotion
If you enjoy using any of the Casual packages I’ve published over the past year (Agenda, Bookmarks, Calc, Calendar, Dired, EditKit, IBuffer, Info, I-Search, Re-Builder), please consider “starring” the project on GitHub if you already haven’t done so. Financial support is also welcome as it helps the development and maintenance of Casual. Please consider buying me a coffee to provide it. Thank you.