Let’s Play How Big Is Your Emacs Config?
Speaking of things that don’t matter at all , over at the Emacs reddit, reddit_enjoyer_47 wants to know how big our init.el files are. Despite my dismissal of the question as of no importance, it turns out that the answers are interesting. The answers range from about 20 lines to about 7,000 lines. For the record, mine is 2527,
Most of the folks with large init files say they have been using Emacs for a long time. That make sense because the files just naturally accrete by adding small pieces that may outlive their usefulness. More importantly, though, long term users tend to adapt Emacs to their individual needs and the usual way of doing that is by adding packages and changing default options.
More interesting to me are users with tiny configurations. It’s hard for me to fathom how you can make good use of Emacs with a configuration that small. A couple of the responders with small inits either listed them or provided a link to it. They appear to be using Emacs as a single purpose editor, usually for coding in a specific language.
Others take pride in having a small config or perhaps consider it some sort of moral necessity. One even set himself a (small) limit an requires himself to refactor his config if it exceeds that limit. That’s fine, I suppose, but it seems to me that it merely serves to limit the usefulness of Emacs.
Writing SF With Emacs, Part 2
Last week, I wrote about Theena Kumaragurunathan’s post on writing Science Fiction with Emacs and how Emacs was the inspiration for the brain computer interface in his latest SF novel. In a followup post, Kumaragurunathan discusses the philosophical and design choices that make Emacs such a great tool for writers like him. He says,
Good UX comes from good design. The former is the harvest that comes
about from sowing in the latter.
He describes the manifestation of that principal in Emacs as,
Emacs feels timeless to me because it made a simple, stubborn choice
early on: let the user shape the tool.
He goes on to describe this as “giving the user agency” and explains how he’s exploited that agency to integrate Emacs with other tools, such as Org-roam and Hyperbole, to build himself a writing environment tailored specifically for him.
As well as being a novelist, Kumaragurunathan is also a screenwriter so he relies on two distinct Emacs modes for his writing:
- LaTeX for his manuscripts
- Fountain for his screenplays
There is, he says, no other writing environment that can support both long-form writing and screenwriting.
It’s a nice article and well worth spending a few minutes on. His discussion of how Emacs meets his writing needs and the writing environment he’s evolved from it is instructive and entertaining.
Traveling: Posting May Be Spotty
I’m traveling for the next few days so posting may be spotty. The minions are guarding the Irreal bunker but are terrible at blogging—except maybe on posts concerning dark themes—so they’re no help.
I’ll try to get a post in everyday but they may be late or not appear at all. Things should be back to normal by Thursday.
Neocaml Released
Bozhidar Batsov has announced the release of the first version of Neocaml, an Emacs major mode for OCaml. Batsov is a big fan of OCaml but wasn’t happy with the existing Emacs major modes for it. So, of course, he started working on his own version. He’s now reached the point where he feels it’s ready to be shared so he’s released Version 0.1. It’s already on MELPA so it’s easy to install if you want to try it out.
Batsov’s post lays out what he feels was wrong with the existing implementations. You can read the details in his post but the TL;DR is that they’re either old and not well maintained or they use the old style font-locking and indentation mechanisms that have been replaced by TreeSitter.
Batsov says that tuareg still has more features than Neocaml but that Neocaml has all the features you’re apt to need. Batsov is, of course, still working on adding additional features including support for more file types and improvements to structured navigation using TreeSitter. He is, of course, very interested in bug reports and pull requests.
Why I Use Ad Blockers
If you’ve been around Irreal for a while, you know that I’ve always been conflicted about ad blockers. On the one hand, I recognize that content providers have to make money some how and that the only reasonably way in today’s Internet is through ads. Because of that, I’ve always said that I’m willing to see ads just as I was in the old days when we consumed content from magazines and newspapers.
My only objection was that the ads had become surveillance mechanisms that would track you wherever you went on the Internet. Enough is enough and I finally declared that I was going to block ads and would stop when the advertisers stopped tracking me. In today’s world, that means never.
Happily, my use of Magic Lasso removed all the trackers and much more besides. As a result, I could still surf the Web and not have to worry about being tracked. I was still waiting for the advertisers to stop tracking so I could turn off the add blocker.
Sadly, I have to upgrade that policy. As I’ve written before, I use Xwidgets to display my Emails and Elfeed entries in HTML. The thing about Xwidgets in Emacs is that it doesn’t run Magic Lasso or any other ad blocker so I get to see what the Web is like without ad blockers.
It’s not pretty. There are multiple popups that cover the content, videos that play—and loudly—without permission and many other affronts to one’s sensibilities. As Cory Doctorow is fond of saying, it’s the enshittificaiton of the Web.
I’m not against sites showing us ads in a way similar to what magazines and newspapers have traditionally done but if you want your ad to pop up and cover the content I’m trying to read or you want to play some video without invitation, I’m going to continue blocking your ads until you stop.
Exporting From Org Agenda To macOS Calendar
Aimé Bertrand has an nice post on how he exports scheduled items in his org agenda to his macOS calendar. He mostly lives in Emacs and Org mode but, like, me also likes to have his appointments and other scheduled events in his macOS calendar. The main attraction for doing this to me is that it will sync all your appointments to all your devices as well as share it with appropriate other people. Sadly, Emacs doesn’t run on iOS and given Apple’s no interpreters policy, probably never will.
Bertrand wasn’t concerned with keeping the two calendars synced; he only wanted to export his Org scheduled events to the macOS calendar. This turned out to be harder than you might think. The existing solutions didn’t quite do what he needed so he decided to roll his own.
You can read his post for the details. He has a couple of different ways of approaching the problem. The details aside, the takeaway for me is the flexibility of Emacs and its ability to interact with other applications that may never have heard of Emacs.
If you’re using Emacs on a Mac and would like to ensure that all your Org scheduled events are reflected on the system calendar, take a look at Bertrand’s post for one way of solving the problem.
Writing SF With Emacs
Theena Kumaragurunathan, a filmmaker, photographer, and writer, has an interesting post on using Emacs for writing science fiction. There’s nothing new about that, if course. Several well known SF authors use Emacs. Kumaragurunathan’s post is interesting for two reasons:
- The story of his journey from using a word processor, to a customized Vim/NeoVim editing environment, and finally to a happy Emacs user.
- His use of Emacs as a model for his “Brain Computer Interface”, a central part of his story.
The brain computer interface (BCI) is how the technical elite communicate with a sentient AI 500 years in the future. The BCI is more complicated and featureful than that described in Niven and Pournelle’s Oath of Fealty. Instead of dealing with buffers, it deals with thought patterns and, as with Emacs buffers, they can be manipulated in various ways by a programming language built into the BCI.
It’s an interesting concept but for those of us in 2026, the real value of Kumaragurunathan’s post is his journey from word processors to Emacs. The journey is one of a quest to control his writing environment. Many Irreal readers will relate even if they have to substitute “programming environment” for “writing environment”.
Kumaragurunathan is promising a followup post in which he will discuss his Emacs workflow and how he uses it for writing fiction, research notes, film scripts, and even for programming. I’m looking forward to it.
Winpulse
Álvaro Ramírez has a new Emacs app available. The app, winpulse, is his answer to keeping track of the active window. What happens is that every time the focus changes the new window flashes so you get a visual indication of the new window.
I had the same problem but solved it in a different way. I made the modeline of the active window a strikingly different color so that it’s easy to spot the one with focus. I like my solution better because the indication has longevity. If I get up and then return to my computer, I can immediately see which window is active. The nice thing about my solution is that it simply amounts to a set-face-attribute as you can see in my post or below.
None of this will come as news to Ramírez, of course. He simply prefers a different way of indicating the active window and, as always, Emacs makes it easy to have it your way.
Ramírez says the the app is brand new so it won’t be on Melpa yet but you can get it from its GitHup repository. If you like just having a momentary indication of the active window, Ramírez’s solution may be just what you’re looking for. If you prefer something a little stickier, changing the color of the modeline has worked very well for me. You could, I suppose even use both methods.
For the record, here’s the current code from my inet.el:
(set-face-attribute 'mode-line-active nil :foreground "black" :background "goldenrod" :box '(:line-width 1 :color "black"))
Unless you have a tan background, goldenrod probably isn’t the right color for you but you can experiment to see what works well with your theme.
Snippets With Regular Expressions
It’s been years since I wrote about Gilles Castel and his astounding ability to take LaTeX notes so fast that he was able to keep up with the the instructor in his Mathematics classes. Sadly, Castel died in 2022 but his blog—including the two posts [1, 2] that deal with taking Mathematics notes with the associated diagrams—is still up.
Castel used Vim so he didn’t have AUCTeX but he did have a large collection of UltiSnips snippets that he used to make entering LaTeX fast and relatively painless. One feature of UltiSnips that he leveraged was the ability to specify the trigger word with a regular expression. For example, he uses that capability to recognize subscripts so that a2 → a_2. See his post for other examples.
Naturally, we Emacs nerds went crazy and attempted to replicate his system in Emacs. Karthink had a particularly good solution using AUCTeX, CDLaTeX, and YASnippet. Still it would be nice to be able to specify triggers with a regex.
Over at the Emacs subreddit, nmorazotti has a solution. He’s put together a snippet package, Resnippets.el, that can recognize a regex as a trigger. If you’ve been yearning to try Castel’s approach to taking LaTeX notes, resnippets may be useful.
I won’t be using it for two reasons. First it’s LLM generated and I have a prejudice—rational or not—against AI generated code. Second, and probably more important, is that the snippets are all autoapplied. I HATE that. I want to explicitly invoke the snippet with a Tab. Actually, UltiSnips has this right. By default you invoke its snippet explicitly but you can, on an individual snippet basis, choose to have them invoked automatically.
I don’t know if anyone is still interested in all this but it was fun for me to revisit it.
Casual For Registers, Rectangles, And Windows
As you probably know, I’m a big fan of Charles Choi’s Casual Suite. His latest offering deals with registers, rectangles, and windows. Much as I like the Casual Suite, I won’t be using these latest menus. Choi, as usual, is absolutely correct about the various bindings being difficult to remember but I can remember that Ctrl+x r is the prefix for both registers and rectangles. If I type Ctrl+x r and wait a second, which-key will pop up a display with all the completions. This seems easier to me than invoking a Casual menu.
As for windows, I hardly ever want to rearrange them. Mostly I just want to switch focus between them and for that the excellent ace-window does the job nicely and I have it bound to Ctrl+x o one of the first bindings you learn as Emacs beginner. The only rearrangement I ever want to do is to switch two windows and ace-window does that if called with the universal argument.
Of course, all that’s just me. You may not use which-key and may often move your windows around. If so, Choi’s solution may be just what you need. He even has bindings for using the numeric keypad keys if you have a full size keyboard. If you already have Casual installed, all this is already available and all you have to do is specify some bindings for it as shown in Choi’s post.