emacs

Mixing code and markups in LilyPond (or, coding for guitarists)

I wrote this post primarily from the perspective of a beginner guitarist trying to solve a practical problem, but the way I approached it naturally landed on functional programming and literate programming. So, you might want to stay around even if you are not interested in playing the guitar. This post is mostly about my experience of learning a very interesting music markup language LilyPond, which has a symbiotic relationship with the GNU Guile Scheme.
Read more

Heh, Emacs LISP function! Lemme give you a piece of advice!

Did you know that in some programming languages, you can give a function a piece of advice? The basic idea is this: if you are using an application or a library written by somebody else, what can you do if you need to modify the behavior of a particular function? You could modify its source code, if your version improves it for everybody. However, if you only want to customize it for your personal needs, a more lightweight solution might be desirable.
Read more

Simple exercises with grep, sed and awk in org-mode

For text processing, I had never bothered to learn classic Unix tools such as sed and awk, because I can always use Python's regular expression library. The syntax of sed and awk just appeared to be too arcane to me. However, recently I realize that for many simple ad-hoc tasks, even writing a Python script is too much overhead. This motivated me to learn to use regular expressions directly in the command line.
Read more

I was reading about the Emacs org-roam mode, and came across the Zettelkasten method of notetaking. I hadn’t seen this term before, but the idea of taking notes with cross-referenced index cards sounded familiar. Where did I read about it? Ah yes… in Umberto Eco’s Foucault’s Pendulum, the main character Casaubon (an ex-academic who makes a living as a “detective of knowledge”) uses boxes of index cards to keep track of ideas.
Read more

Writing the Emacs configuration script in org-mode: a simple example of literate programming

Program like writers do Programming is traditionally seen as an exercise that translates human thoughts into a format that computers can understand. As a result, the ideas behind the program can become obscured and fragmented in the source code. This is why reading code requires so much mental effort. For me, reading code often feels like solving a puzzle, or reading modernist/postmodernist novels where events are narrated out of sequence. The concept of literate programming was introduced by Donald Knuth in the 80’s to address this issue.
Read more