Emacs Users Are Igors

The other day, I saw a tweet pointing at a post from 2013 by Chris Done. It was sort of interesting so I added it to my blog queue. Since then, I’ve seen several more tweets mentioning it so perhaps everyone has seen it by now. Just in case you missed it, the post’s theme was that Emacs users are like Terry Pratchett’s Igor Clan.

Igors were characters from Pratchett’s Discworld series who were experts at surgery and routinely replaced their own body parts, making repairs and improvements. That last phrase should tell you why Done thinks Emacs users are like the Igors: they are always changing and improving their editor in the same way that the Igors are always changing and improving themselves.

His thesis is that because Emacs has an extension language in which the majority of the system is written, it’s easy for each user to move things around, modify parts, and add new things to suit themselves. He says that the Rudolf Winestock’s famous Lisp Curse—Lisp’s extraordinarily expressive power leads to programmer isolation—doesn’t apply to Emacs because, after all, your editing environment is yours alone and doesn’t have to satisfy anyone but yourself.

Done’s experience is much like mine: he came to Emacs from Common Lisp and came to see it not as an editor but as a programming environment—or as I like to say, a light weight Lisp Machine. While I don’t have any interest in routinely rearranging my body parts, I do enjoy doing it to my editor.

Posted in General | Tagged | Leave a comment

MAlt: CERN Strikes a Blow for Open Source

Microsoft has been a sleeping dragon lately. Those who haven’t been around for more than, say, 10 years probably don’t remember how ferocious and predatory they were. Still, to mangle a metaphor, the dragon hasn’t really changed his scales.

For years, CERN was counted as an academic/research institution—which it certainly is—by Microsoft, and as such were granted favorable terms in the licensing fees they paid for Microsoft software. But just because Microsoft has put on a friendlier face lately doesn’t mean that much has changed. Last year they informed CERN that they were revoking its academic/research status and that going forward per seat licensing would apply. That left CERN looking at a ten-fold increase in what they paid to Microsoft.

CERN did two things. First, they negotiated a ten year ramp-up in the fees but more importantly, they initiated the Microsoft Alternative (MAlt) Project. The idea was to migrate CERN off of Microsoft, and other proprietary, software in favor of open source. Their objectives were to

  • Deliver the same service to every category of CERN personnel
  • Avoid vendor lock-in to decrease risk and dependency
  • Keep hands on the data
  • Address the common use-cases

Keeping costs under control is vital for any institution, especially a public institution, of course but to my way of thinking the big win is keeping control of their data. They own it, can store it locally, and don’t have to worry about what some vendor may decide to do in the future. That goes hand-in-hand with avoiding vendor lock-in so it’s an important thing.

If Microsoft thought they were going to be able to squeeze a few more Euros from CERN, they were mistaken. Instead of more Euros they will be getting fewer customers.

Posted in General | Tagged , | Leave a comment

Building an Emacs Mode to Improve Your Workflow

Adrien Brochard gave an excellent talk to the New York Emacs Meetup in which he demonstrates how to build an Emacs major mode to improve a workflow. Brochard is working with Kubernetes and would like a way to look at—or even tail and follow—the logs. For those who don’t know what Kubernetes does, or perhaps have never heard of it, it’s a system for controlling a set of processes (called pods).

Kubernetes, of course, has a way of displaying and tailing the logs but you first have to call a Kubernetes command to list all the pods, which have long, complicated names, and then cut and paste the name into another Kubernetes command to list the log. Brochard wanted an easier workflow that didn’t involve leaving Emacs or using the mouse. His solution is Kubernetes mode.

What I really like about the talk is that he incrementally builds up his solution in much the same way that Kris Jenkins did when building his Spotify client. He starts in the shell showing us how to call Kubernetes to list the pods and get the logs, then he writes a bit of Emacs code to call the code and put the results in a buffer using shell-command-to-string, and then split-string to get a (Lisp) list of pods.

Next he wants a way of picking the correct pod. I probably would have used ivy-completing-read or one of its brethren but Brochard chose to use tabulated-list-mode, which makes sense for him because he is going to derive Kubernetes mode from tabulated-list-mode. By combining this with his previous code to get the list of pods, he has a naive version of the desired workflow. The problem is that large files can hang Emacs while they’re being collected and, of course, trying to tail and follow the log will lock everything up. He solves that by substituting call-process and start-process (depending on whether he wants to tail or not) for shell-command-to-string. Now he a workflow with good performance and that supports tailing the log.

Finally, he uses transient from Magit to wrap his mode up in a nice UX. Again, he does this incrementally so you can follow each step.

All his intermediate code is in code blocks in an Org file so it’s easy to follow along or go back afterwards to clarify something you missed. He also has a link to the full implementation of the mode if you want to see everything together or try it out. As I said, this is a really good talk and definitely worth watching. It’s about 33 and half minutes long so plan accordingly.

Posted in General | Tagged | Leave a comment

The Pros and Cons of Emacs

Darwin Wu has an interesting post on the pros and cons of Emacs. I disagree with some of his conclusions but he does a good job of presenting a balanced view. As for the disagreements, I don’t say I’m right and he’s wrong, only that I disagree. You should read the post and make up your own mind.

His list of pros is:

  • It’s fast
  • Has a large number of packages
  • You can Navigate from the keyboard but don’t have to
  • Multiple files in a single frame

As most of you know by now, I’m all in on Emacs but I wouldn’t list “fast” as one of its strengths. The fact that Wu does makes me wonder what Atom and VS Code are like. I’ve always assumed that their architecture would make them a bit sluggish but they must be worse than I thought if they make Emacs look fast.

The other pro that I strongly disagree with is that Wu thinks it silly to have packages that allow you to do things like email in Emacs. I’m a live-in-Emacs guy and my complaint would be that I can’t do enough in Emacs. But again, different strokes for different folks.

His list of cons is:

  • High learning curve
  • The extensive customizability makes pair programming difficult
  • Documentation is scattered about and some of it is out of date
  • Too many package repositories

It’s true, of course, that mastering Emacs can take years but I’m a bit skeptical that becoming proficient with Emacs is much harder than any other editor, especially if you make use of the menus.

As for making it hard to pair program, my thoughts are best left unstated in case there are children present. I can’t imagine why anyone would care—even a little—about this.

I don’t understand his concern about documentation. There’s a lot of it, of course, but it’s all right there in Emacs. I’ve always considered documentation one of Emacs’ strengths. I’m also a bit confused about his concern that there are too many package repositories. Org-mode has its own—although it’s also available from elpa.gnu.org—but other than that there’s really only elpa.gnu and Melpa (I don’t think Marmalade is still active). As for elpa.gnu being the single source of truth, that’s laughable. I get almost all my packages from Melpa and so does everyone else I know.

I did a lot of carping in this post but Wu’s post is good and will probably be useful for those trying to decide if they want to take the plunge. As I said, read it and see what you think.

Posted in General | Tagged | Leave a comment

An Org/Hugo Workflow for Blogging

Lots of bloggers are electing to generate static sites instead of relying on a CMS like Blogger or WordPress. It’s an attractive option and one that I would probably pursue if I didn’t have so much invested in WordPress. All my posts are written in Org mode and archived on my local machine so it would be pretty simple to republish them as static pages. The main problem I see is how to move the comments with the posts. There’s a lot of wisdom contained in those comments and I’d hate to lose them.

If you’re just starting out, however, there’s no reason not to consider a static blog. Michael Howard over at FumbLing has a nice post that goes into detail on how he uses Hugo and Org mode to blog. The nice thing is that every step from writing a post to publishing it is handled from within Emacs so there’s very little friction.

If you’re not a hardcore Emacser, you might wonder why you’d want to use Emacs for blogging. Howard explains why he thinks it makes sense at the beginning of his post. Then he goes into how he actually uses Org and Hugo to blog. As I said, it’s pretty seamless. He has a single Org file with all of his posts in it. I don’t know how well that would scale for someone like me who posts daily, but it’s a very attractive strategy that keeps everything in one place.

If you’re wondering if the Org/Hugo combination is a sustainable option consider that Mike Zamansky and many others also use Hugo and Org-mode for their blogging. As I say, it’s one I’d consider if I weren’t so heavily invested in WordPress.

Posted in General | Tagged , | Leave a comment

Minimalism

As I wrote in my Ten Years post, I’ve become interested in leveraging my digital life style as a way of further simplifying my life. My post on everyday carry is an example of this: searching for ways to minimize the things I have to take with me when I leave the house.

It turns out that there’s a related movement that is also concerned with simplifying your life: minimalism. The idea—or at least the main idea—is to simplify your life through reducing the number of your possessions by getting rid of everything that you don’t need or love.

It’s an attractive idea in many ways but, of course, many of its adherents have turned it into a cult. They’ve made it into a religion that they use to define themselves rather than using it as a way to make their lives better by emphasizing the things that matter. These people are really annoying and give minimalism a bad name. Sadly, most people writing about minimalism are like this.

They like to argue about how many forks or t-shirts you should own and proudly announce that they got rid of their couches. For many of these folks, it’s a game of count your objects; the lowest number wins. They put me in mind of the New Luddites in their forsaking of convenience to show how morally superior they are. The rest of us, of course, think they’re a little nutty. That’s too bad because there is a point to minimalism.

Of course, not all minimalists are like that. This guy, although he owns practically nothing, seems to me to be doing it right. It’s all about making his life simpler, not about reducing his possessions for its own sake. Another minimalist whose approach I really like is video blogger Matt D’Avella. Matt’s latest video, published as I was working on this post, describes what happens When Minimalism Goes Too Far. Like his video on You can’t be a minimalist if… he pokes fun at those humorless souls who want to drum folks out of the minimalist cult for owning too many things.

I’ve been taking tiny strides in the minimalist direction and they have made my life simpler and better. I will never, I’m sure, reach the point where I can pack everything I own in a small suitcase and move at a moment’s notice. Nor do I want to. It’s just nice to get rid of complications when you can.

Posted in General | Tagged , | Leave a comment

The Holy War

After writing yesterday’s post on Vim vs. Emacs, I serendipitously saw a tweet pointing at the Wikipedia article on the Editor War. It describes our holiest of holy wars and gives a pretty thorough analysis of both sides’ views.

The article is also useful as a comparison of Vim and Emacs. It lists the strengths and weaknesses of both editors as well as the jokes the partisans make about them. If you worship in the Church of Emacs, you’ll probably enjoy Bill Joy’s 1999 comment that vi was written for a world that doesn’t exist anymore and that Emacs was written on and for much more capable machines. There’s a bit more to the quote that’s worth taking a look at.

Both Vimmers and Emacsers will take comfort in the article’s noting that one of the major arguments in favor of vi, its much smaller footprint, is pretty much moot because both Vi(m) and Emacs can be considered light weight compared to modern monstrosities such as Eclipse.

As I said in yesterday’s post, no one takes the argument seriously anymore other than for its entertainment value but the Wikipedia article gives a nice history of the war and its major points. It was fun to read it. If you have a couple of minutes, take a look and enjoy one of the sillier parts of our shared history.

Posted in General | Tagged , | Leave a comment

Vim vs. Emacs

One of our longest standing holy wars is Emacs versus Vim. I’ve been around long enough that I’ve seen all the jokes and memes. Seen them over and over again, in fact. At this point, I doubt anyone is even serious about the debate; they just throw out the same old arguments for the fun of the troll. Still, occasionally someone tries to bring a little light to the squabble.

I’ve written before about my thoughts on the war. Vim and Emacs serve two different constituencies and you pick the one that meets what you want from an editor: Vim if you’re looking for a fast editor that does one thing (editing) well; Emacs if you want an operating environment or, as I like to say, a recapitulation of the Lisp Machine.

David Morelo has a nice post that makes an honest assessment of the two editors’ strengths of weaknesses and which you should choose. I pretty much agree with what he has to say. In the past, I would have agreed with his statement that “[f]or pure text editing, Vim is usually faster…” but I’m no longer sure that’s true. Certainly Vim, with it’s composable command set can take less time to invoke an editing operation that is common to both editors but Emacs has a much larger command set and an individual user can, of course, add any command they like. Given that, I’m pretty confident Emacs can be faster for some editing jobs simply because it has a more powerful command set.

Or maybe not. As I said, it doesn’t really matter. If you want an editor that edits your files quickly and easily and the idea of playing Tetris in your editor seems bizarre, then Vim is your editor. If you want a complete operating environment in which you can perform most of your tasks, then Emacs is for you. The real argument is not which editor is better but which workflow is more effective.

In any event, read Morelo’s post and see if you don’t agree with what he has to say.

Posted in General | Tagged , | Leave a comment

The First Rule

For many years I had the good fortune to work with a small team of very talented software engineers. The team stayed together across many jobs working for many different companies. Our work was always related to computer networking and communications.

We had what we called “The Three Rules.” They weren’t really rules so much as aphorisms or perhaps rules of thumb that were surprisingly helpful in getting our job done. The first rule, also known as the prime directive, was “It’s always the cable.” The meaning of that was that when you’re having network problems it’s almost always because of a cable that needs to be replaced. You can think of it as analogous to the police rule that in a murder case you always look first at the spouse as the perpetrator. It isn’t always true but it turns out to be correct much more than you’d think it would.

The problem with the first rule is that we were always forgetting it. A network problem would occur and we’d waste time looking at all sorts of things that weren’t causing the issue. Finally, one of us would chant, “It’s always the cable” and sure enough when we replaced the cable the problem went away.

I’d been thinking lately that in our new wireless world where cables are eschewed, the first rule might not be applicable anymore or at least not with such force. The gods, of course, punished me for my apostasy.

I wrote the other day about the problems I had restoring my network connection after a lightning strike. I didn’t go into detail about the difficulties I had getting the new WiFi router working but the major issue was that it wouldn’t talk to the firewall to which it was connected. I spent most of the day chasing down what I believed the problem might be but got nowhere. Then in the back of my mind a little voice said, “It’s always the cable.”

Now I didn’t think that could be the case because that cable had been working just fine with the old router. All I did was unplug it from the old router and plug it into the new one. Of course, when I switched out the cable everything started working. That’s always the way the first rule works. You have a nice rationale for why this time it doesn’t apply but learn to your sorrow that—yes, actually—it does apply. That’s why it’s the first rule.

I’m telling you this story in part because I think it’s amusing but mainly to spread the dying wisdom embodied in the first rule. If you’re having a network problem, check your cables first.

Posted in General | Tagged | Leave a comment

Making The Results Block Executable

Over at the Emacs Stack Exchange, shackra asks how he can make the RESULTS block of an Org babel SRC block executable by the shell. In other words, he wants to build a shell script in one block and be able to execute the resulting shell script in another.

That turns out to be really easy and Xu Chunyang provides a very nice answer: simply use the :wrap keyword in the first block to wrap the RESULTS block in a new Org src code block. Follow the above link to see the exact details. As I say, it’s easy and can be very convenient. Needless to say, you can make the results executable by any of the supported languages, not just shell.

When I read the Stack Exchange query, I remembered that I once knew about :wrap but had completely forgotten about it. Then I thought that I vaguely remembered writing about it but I couldn’t find any mention of it in my archives so perhaps I’m imagining the whole thing. In any event, if you’re a Babel user, it’s worth knowing about the :wrap keyword. If you like the idea of programs writing programs, here’s a great technique for doing so from within Org-mode. Very nice indeed.

Posted in General | Tagged , | Leave a comment