emacs

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

How I run emacs in client/server mode under macOS

Many articles are available about running Emacs in client/server mode. However, when I tried to do it in my particular environment (macOS 11.0.1 Big Sur, using zsh), some tweaks were still needed. So I figured that it’s probably useful to document my setup. In macOS, the Emacs executable is /Applications/Emacs.app/Contents/MacOS/Emacs. To run Emacs in its regular (non-server) operation mode, I defined two shell commands in .zshrc: emacs runs Emacs in GUI mode in a macOS window, whereas emacsnw runs Emacs in text mode within the terminal.
Read more

About a month ago, I rewrote my Emacs config script in the style of literate programming. Emacs has a markup language (org-mode) that makes it easy to mix rich text with code. I did it mostly out of curiosity. At that time, I didn’t know if writing something as trivial as a config file this way was a good idea in terms of practicality. After a month of tweaking, I am now convinced that It was helpful.
Read more