Emacs Calendar Extension – Information Unity


Well, I’ve been away for a while. Honestly, I find it hard to make time to post – but I swear, I’m going to make more of an effort because I’m actually working on some very excitingΒ stuff.

I’ll put off the super exciting stuff for a bit, but did want to post something exciting – to me at least…

As a preface, I’ve been getting into pretty heavy use of Emacs over the last few months. To the extent that I’m on a mission to use it for as a replacement for as many apps as possible. If you are aware of Emacs and the multitudes of extensions then you know just how powerful it can be. To the point that my desires of an Emacs-only desktop are not outside the realm of possibility – but I’ll get into that in some later posts.

So one of the things I hateΒ in life is repeating myself – specifically in the realm of information. Having to put to-do items into multiple devices, multiple contacts apps, multiple calendar apps, etc.

Emacs contains its own calendering functionality that is really full featured. I ran into my pet peeve, however, very shortly into its use. I refuse to put my reminders, to-dos, birthdays, etc into multiple applications. I want everything to be available instantly on my PC, my iOS devices, and my Android devices – natively, meaning not from a website – I want them built-in.

As some background, we all know (at least folks familiar with Emacs), the editor in question is extremely customizable in that everything it does – and everything it can do – is based on a variant of Lisp, aptly entitled ELispΒ (Emacs Lisp, of course). ELisp is built on top of Common Lisp, mostly adding helper functions and functions for interactivity.

Understanding this, and desperately wanting to achieve my goal of information unity, I decided to add Lisp and ELisp to my programming repertoire. It was tough sledding at first with all those weird names for things – s-exp, form, lambda, car, cdr, cons – but the light went on and I finally got past the tutorial stage and into some actual useful programming.

I went about my dream of making this thing happen. Luckily for me, the calendar application within Emacs knows how to handle iCalendar file formats and is able to import them. Even more lucky for me is that the network access code is built-in as well – which solved a major piece of what I’m trying to implement. I really just have to automate this import from the “source of record” and do some processing to get it to the way I wanted it to work. The pieces I’m talking about are:

  1. Use Google Calendar as my central calendaring application – every other device can leech the data from here – the source of record.
  2. Export my Google Calendars (I have multiple) in the iCalendar format.
  3. Import these exported sources into Emacs
  4. Solve any issues that arise (automation, de-duplication, fromatting, etc.)
My first item is solved – I already use Google Calendar fro everything (well, except for work – I’m digging into that, now) – so I’m in good shape there. As long as I put in good repeating events and descriptive entries I should be good.
My second item is also solved for me – Google will provide a link to your private calender in iCalendar format. Sweet, that means I don’t have to use a third-party tool to pre-process a proprietary format or rely upon an API to get the data. Whew!
My third item is handled in a very brute force manner by Emacs Calendar. Basically, you tell it to import a file and it does – just that and only that. Item already exists in your Emacs calendar? Too bad – it’s duplicated. You like a special format? Too bad – it imports the defaults. As you can see, there will be some work to do there, which is where my newly learned language comes into play.
My fourth item meshes with fixing the issues of the third – I need to clean up what Emacs Calendar imports, format items, and de-duplicate among a few other things..
Awesome – time to put my newly acquired Lisp knowledge to use!
Oops! This post is getting a little lengthy – I guess you’ll need to read the follow up post to see how I go about actually solving my issues.
Until then – you never, ever, know enough!

Tags: , , ,


Jonathan Arkell
Mar 31, 2013 at 11:09 pm

“ELisp is built on top of Common Lisp” … err… actually… no. Emacs Lisp is built on top of C. Legions of emacs hackers would swoon if it was built in Common Lisp. The two languages have some pretty significant differences.

Anyway, I hope you enjoy your foray into the world of lisp. Scheme is worth checking out if you thought Elisp was neet. πŸ™‚

Apr 1, 2013 at 11:18 am

Ah ha – you successfully exposed my newbness πŸ˜‰

Emacs Lisp is built on C, and not Common Lisp. Semantically, however, they can – for purposes of general discussion – be referred to as “related” at least.

And yes, I’m digging Lisp quite a bit – I’m even trying to work a little Clojure into one of my projects (seeing as my main language is Java – but I’ll get into that in a later post)

Apr 4, 2013 at 1:28 am

Have you had a look at the calfw package (e.g. from MELPA repository)? It has nice integration with a number of sources and can nicely display them in emacs. It also can include your org mode agenda.