Emacs Doc Bling

As most of you know, Irreal doesn’t think much of editor-connected bling. We much prefer simple efficiency to flashy accouterments that, in the end, simply get in the way of a decent editing experience. That’s true even though they can, arguably, make it easier to get started with a new editor.

It feels a little odd, then, to be writing favorably about these reformatted Emacs documents that, while they have the same content as the official documents, have been reformatted to look a bit nicer and, more importantly, be easier to navigate. It’s probably not accurate to describes the results as “bling” especially since the point of the change is better navigation.

The two major changes are a sidebar that essentially recapitulates the table of contents so that it’s easy to get an overall view of the document and an improved search function that makes parsing the search results easier.

Irreal does think that these documents are a worthwhile addition to the Emacs document stack and wouldn’t object if, arguendo, they were adopted by GNU. Still, the Irreal bunker is probably going to continue to use the “official” documents but doesn’t object if others make a different choice.

The documents that are available are:

  • The GNU Emacs Manual
  • The GNU Elisp Reference Manual
  • The Org Manual
  • The AUCTeX Manual
  • The Magit Manual

Take a look at one or more of them and see what you think.

Posted in General | Tagged | Leave a comment

Casual EditKit

Charles Choi has another Casual app on offer. This time it’s a comprehensive set of menus, Casual EditKit, that capture the various editing commands. On the one hand, these are commands that you really need to know to become proficient with Emacs. On the other hand, as Choi says, the menus serve as a means of discovering those commands.

The problem is that Emacs has such a rich set of commands for editing text that it can be hard to learn them or even know that they exist. For example, I am always seeing comments from people expressing surprise about the transpose-chars and transpose-words commands. I use them everyday and wouldn’t want to live without them, yet there are lots of folks who don’t even know they exist. There are a bunch of other transpose commands that I don’t have bound but that I know exist so I can invoke them—with the help of fuzzy command completion—as named commands when I need them.

This all works because I know these commands exist and it’s not hard for me to invoke them even if I don’t remember their bindings or they have none. The advantage of Choi’s Casual EditKit is that helps you discover these commands and once you know they exist, they’re easy to invoke even if you can’t remember all the details.

Choi just announced Casual EditKit so I obviously don’t have any experience with it but my snap judgment is that its main benefit is teaching a new user what editing commands are available. But, in the long run, every user is going to have to learn those commands. Still, I suppose the menus could be useful for little used commands such as, say, the rectangle commands.

In any event, Casual EditKit is a welcome addition to Choi’s wonderful collection of Emacs menus.

Posted in General | Tagged | Leave a comment

Holding The Program In Your Head

Paul Graham has a very interesting post that considers why it’s so hard for most corporations to produce good software. Actually, his post isn’t quite about that. Rather, it discusses why it’s so hard and so important for a programmer to hold a program in his head. Graham gives a list of 8 prerequisites for enabling programmers to do that. He says that:

  1. It’s amazing how often programmers manage to to achieve all eight on their own.
  2. It’s amazing how often corporations mange to do all eight wrong.

I agree very strongly with everything he says. I program the way he describes and I hate having anyone else touch the particular piece of code I’m working on. I also believe in small teams with a minimum of interference from above. Every manager’s nightmare.

Plenty of people will, of course, disagree but Graham’s article got me thinking about a discussion I had with Perry Metzger in an Irreal comment about pair programming. Metzger had observed that Emacs wasn’t very useful for pair programming and I made a snarky remark about pair programming. Metzger responded that he really enjoyed it and that he’s never been so productive.

That seems to directly contravene what Graham said and it certainly runs against my inclinations. The thing is, Metzger is a serious and accomplished computer scientist as well as a long time Emacs user so nothing he says should be dismissed out of hand. I suppose that this is another case of different strokes for different folks so we can only agree to disagree. In any event, take a look at Graham’s post and Metzger’s comment to see what you think.

Posted in General | Tagged , | Leave a comment

Phrontisterion

A few days ago, I wrote about Trevor Hopkins’ site and his hosting of some very nice material concerning Iain M Banks’ Culture universe. My post was about a detailed description of the Culture and how it works that was written by Banks but I also noted that Hopkins also had some of his own stories written about the Culture.

I finally got around to reading one of his short stories, Phrontisterion. It’s a nice story that faithfully reproduces the tone of Banks’ writing. I won’t spoil the story by describing the plot but one nice feature is that explored the idea of group minds that have sublimed. Banks mentions the concept in several stories but never explained how it worked or what it was like to be part of one.

Much of Phrontisterion explores that question and gives us a flavor of what it might be like to be part of a group intelligence. If you’re familiar with the Culture novels, you’ll almost certainly enjoy this story. It’s not, to be sure, the Master but Hopkins does a good job and wrote an enjoyable story. If you’re a Culture fan, you’ll almost certainly enjoy it. Take a look; it’s short and won’t take you long.

Posted in General | Tagged | Leave a comment

Emacs Popup Frames

Protesilaos Stavrou (Prot) has posted a really nice and useful video on something that I’ve been struggling with off and on for many years. The problem is I often want—usually several times a day—to pop up an Emacs buffer and run some command like org-capture. There’s no problem with that, of course, if I’m in Emacs but what if—as is often the case—I’m in some other app?

The basic strategy is to call emacsclient with a -e parameter specifying whatever Emacs command you want to run. The devil, as they say, is in the details. First of all, you have to arrange for an Emacs frame to hold the popup menu and then you have to arrange for it to be deleted when you’re done.

Prot provides a complete, easy to understand framework for all of this. He defines a macro that lets you specify an Emacs command for a popup. You need only specify an OS level key binding to call the function and identify a hook function that will call the function to delete the popup frame when the command is done—most other situations are handled by the code generated by the macro.

I’ve tried to solve this problem with everything from some Applescript to Alphapapas yequake. I’m currently using yequake and it works well for me but if I were starting out I’d definitely take a look at Prot’s code. It’s self contained, easily understandable and hackable, and can be adjusted to your particular use case. All you need is a way of binding an OS level key sequence to the appropriate command. If you need to execute Emacs commands from outside of Emacs, take a look at Prot’s code.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: More Red Meat For Emacsers

You can think of today’s post as a coda to last week’s Red Meat Friday. Unlike that post, this week’s offering isn’t really about the editor holy war. It’s about Emacs versus every other editor out there, which is a different thing.

As you know, I don’t really take sides in the Emacs/Vim debate. I think they offer different things to people with different needs. The rest of those editors though… Well, you all know my feelings about editors and their users who prioritize bling over efficiency: If your editor uses menus exclusively and you have to click to do anything then, sorry, your editor isn’t efficient.

Of course, none of that will matter because those editors are “modern” and Emacs is old and used only by boomers. Or something. Doubtless, some of those people will have the scales fall from their eyes and discover true editor efficiency. Sadly many others will never make that discovery and will end their days clicking on menus and using the arrow keys.

But this is, after all, Red Meat Friday so enjoy the red meat now because tomorrow we get back to serious stuff.

Posted in General | Tagged , | Leave a comment

Speaking Of Emacs Keyboards

After my last post on ideal Emacs keyboards, here’s a reminder of what reality actually looks like. When I used to see pictures like that, I thought they were amusing but couldn’t really relate. Now my own laptop keyboard is showing the same signs.

Oddly, it’s not the Ctrl key that’s showing wear but the Meta key, otherwise known as ⌥ Opt in Apple land, that’s showing wear. That’s probably because I have Caps Lock bound to Ctrl but I use both it and Ctrl depending on the situation. That means that Ctrl gets only half the use it otherwise would.

The other key that’s showing wear is my left ⌘ Cmd key. For Emacs purposes that’s bound to Super but I rarely use it for that. Its wear is probably due to its central role in Apple navigation.

When your Emacs keys begin to wear out, it’s probably a sign that it’s time to upgrade your laptop—or get a new keyboard if you’re using a desktop. I actually have a new laptop ready but it uses the new M-series processors so upgrading is not as easy as I’d like. Still, it’s obviously time to get on with it.

Posted in General | Tagged | Leave a comment

The Ideal Emacs Keyboard

If you’re a real Emacs aficionado then you probably think that the ideal—indeed, the only acceptable—keyboard for Emacs is the Space Cadet Keybord. I’m sympathetic to that view and would love to have such a keyboard available to use. Sadly, that’s not likely to happen so we’re reduced to choosing from one of the actually available keyboards.

They’re all basically the same but there is enough difference to allow one to start with a keyboard that can be customized. Over at the Emacs subreddit, drojd specifies their ideal Emacs keyboard layout. I agree that it’s pretty nice and, indeed, it’s pretty close to what I use on my Mac keyboards.

The main problem1 for us Emacs users is finding a reasonable mapping for HYPER and SUPER. I’ve been through several iterations for these mappings. The problem, for me, is that macOS keeps appropriating the keys I use for those modifiers. Doubtless, other operating systems have similar problems. My current configuration has worked for several years so I’m hopeful that I won’t have to learn new bindings anytime soon.

When I look at the diagram in drojd’s diagram what strikes me is that it’s really only HYPER and SUPER that need to be specified. To be sure, I’d like a Space Cadet keyboard but any modern keyboard will do as long as you can make reasonable mappings for HYPER and SUPER.

One can—just barely—get by without HYPER and SUPER but why would you want to? My main use for them is not for whatever their defaults bindings are but to expand the number of available bindings for my own commands.

Footnotes:

1

Well, after getting Ctrl into a reasonable position but virtually every Emacs user already remaps Caps Lock to Ctrl.

Posted in General | Tagged | Leave a comment

Word Diff Counter

Chris Maiorana has an interesting take on counting words. He’s a writer and like all writers, he’s interested in how many words he’s written in the current session. His reasons for wanting that count boils down to it providing a measure of his daily work and, perhaps more important, helping him to know when to stop.

But, he says, there are some problems with word counts as usually implemented. The most important concerns the way that many (the majority of?) writers work. They like to reread and edit what they wrote in their last session. That means that words may be subtracted as well as added. What’s really needed, he says, is a count of the number of words that have changed.

His solution for that is to use git diff to find out how the text has changed and count the number of changes. It’s a bit fussy as you’d imagine but really pretty straightforward. Take a look at his blog post for the code and details.

I love this idea but I’m not sure it’s for me. For long form writing, what I’m mainly interested in is progress so knowing my current word count—regardless of additions or subtractions—is what’s important to me. For short form writing, such as this blog, I really care only about the total word count since I almost always complete a post in a single session—not counting a final editing pass just before I publish it—and I’m never in any danger of burning out while writing a single post.

Still, if you’re a writer and interested in measuring your work rather than your progress, Maiorana’s hack may be just what you’re looking for. You’ll need to keep your text in Git but you should be doing that anyway.

Posted in General | Tagged | Leave a comment

An Early Emacs Paper

For those of you interested in the history of Emacs, how it all started, and where it got its name, here is an original document from 1979 written by Richard Stallman that describers the new Emacs system.

I found the paper in this this post that references an update to the original paper. EricIO added a pointer to the orginal paper that I’ve linked above. There’s a lot of good information in the comments including a Twitter thread that discusses how Stallman eventually settled on the name Emacs.

For the day-to-day programmer, none of this matters a bit but for those of us who care about our backstory and how we got here, it’s a nice addition to the narrative. The whole thing—other than the actual paper—is short so take a look if you’re interested in our history.

Posted in General | Tagged | Leave a comment