Writing Emacs-Lisp, or elisp
In the much-vaunted style of literate programming, here’s an emacs-lisp function I wrote recently. The motivation was to convert a shell alias I added this morning, which counts the number of Zettelkasten notes I’ve written that day. (“Jesus, him, too?” Yes, dear reader, I’m afraid that this is one trend I haven’t managed to dodge forever, but my adoption has been cautious and deliberate.) alias today_count="fd $(date -u +"%Y-%m-%d") ~/org/zd | wc -l" Using the lovely fd utility, I find all files in my Zetteldeft directory, which start with today’s date. Then, I pipe that output to wc -l to get the count. Easy peasy, chicken breezy; took me about two minutes to write. Turns out this doesn’t work as an alias; the date isn’t recalculated every time the alias is called. ...