Entering Dates In Calc With Org

Marcin Borkowski (mbork) has an interesting post on entering dates in Calc mode. The short version is that he often enters dates in Calc but it’s a painful exercise. He’d much rather enter them the same way you do in Org mode, which is intuitive and flexible. That flexibility comes at the cost of being complicated but that’s mostly because there are so many easy ways to specify a date.

Naturally, mbork wanted to be able to enter Calc dates in the user friendly Org mode way. That turns out to be surprisingly easy. After the boilerplate it’s just a couple of lines of code plus another line to bind a key sequence to the function in the Calc key map. Read mbork’s post to see what I mean about easy.

What struck me most about the post was his mention of org-read-date, which Org uses to read dates. It’s incredibly flexible and, as mbork shows, usable in non-Org contexts. Take a look at the doc string for org-read-date to see what I mean. Even though I spend a huge amount of time in Org mode and enter a lot of date/time stamps and even though I’ve read the documentation on entering dates in Org, I didn’t remember how powerful the function is. Take a look at the doc string to see all the ways you can specify dates.

This is just another example of Emacs’ extensibility. Mbork had a problem and was able to solve it by gluing together a couple of existing Emacs functions that nominally had nothing to do with each other.

This entry was posted in General and tagged , . Bookmark the permalink.