I have been using Emacs for quite some time now, but so far I have never invested time to learn Emacs Lisp.

I thought I could give a try at learning some basics using this year’s Advent of code. I am posting my progress in a repo in codeberg.

Day 1

Hey, it’s my very first Emacs Lisp program. And I don’t have much time. And by one of these coincidences of the world, right when I had this thought of giving this a try, I saw this blog post pop up in my RSS feeds, pointing to a cool video by Gavin Freeborn explaining how to solve this challenge.

So, I basically used that video to learn a bit, and for the solution I took Gavin’s code and only replaced a couple of common-lisp calls for (what I think) more emacs-lispy ones.

Day 2

I applied the principles I learnt from Day 1 here, using a temp buffer as a sort of powerful string.

I am quite happy with the result, from a “learning elisp” perspective. It’s likely not the most efficient way of solving this, but it feels to me that it hopefully captures the expressiveness of Lisp. Re-using the solution to part 1 to add adding part 2 rules resulted, I think, in a nice application of that.