What Keyboard Are You Using With Emacs

A month ago I opined that no true Scotsman Emacser would view anything but the Space Cadet Keyboard as the apotheosis of keyboards for Emacs users. I was promptly schooled that, to the contrary, most Emacs users today have no desire for a Space Cadet Keyboard. I remain firm in my desire for one but I bow to the prevailing view.

But if the Space Cadet Keyboard is not the pinnacle, what is? The TL;DR is that no one knows. Everyone, it seems, has their own idea of the ideal Emacs keyboard. Over at the Emacs subreddit, yibie asks what keyboards will people be using for Emacs in 2025. The striking thing is that there are almost as many answers as there are comments. Everyone appears to have their own preferred keyboard that they swear by.

I remained convinced that the most important thing in choosing an Emacs keyboard is mappings for Hyper and Super. Every modern keyboard has Ctrl and Meta (as Alt) covered but there is no standard way of mapping Meta and Super.

In any event, if you have your own views, feel free to jump in and share what you’re using.

Posted in General | Tagged | Leave a comment

Adding Org Image Links From Dired

Over at DyerDwelling there’s another great example of using a bit of Elisp to sand down the friction of a recurring task. The task in question is generating an Org link with attributes for an image file in Dired to be inserted into a blog post.

Capturing a file link from Dired is easy, of course, but the goal of this hack was to add some size attributes along with the link. If you know a little Elisp, it’s easy to imagine the necessary code. In any event, the code is there in the post.

It’s just another example of how Emacs makes it easy to automate a lot of routine tasks. One could, of course, simply add the attributes manually or even use something like yasnippet to insert them but a little bit of Elisp make the problem disappear.

If you’re a blogger and sometimes want to add images to your posts, take a look at the DyerDwelling post. Even if it’s not exactly what you want, it should be easy to adapt to your needs.

Posted in General | Tagged , | Leave a comment

Substitute Command Keys

Marcin Borkowski (mbork) has a nice post on the Emacs substitute-command-keys command. The TL;DR is that it’s a way of mapping a command name to its keybinding. I’ve long been familiar with it but only in the context of Emacs Doc strings. For example, here’s the Doc string from one of my custom macros:

  "Convenience macro to generate a key sequence map entry
for \\[prettify-key-sequence]."

the \\[prettify-key-sequence] is mapped to whatever the current binding for prettify-key-sequence is. It’s nice because I can change the binding without having to worry about updating the documentation.

Mbork’s post tells us that my use above is really just a special case of a more general facility: substitute-command-keys. You can programmatically convert a function name to its binding by calling substitute-command-keys.

I’m not sure where you’d want to use this other than in a Doc string (or maybe an Org doc) but I’m ready to be educated on the matter. I can’t remember where I learned about using \\[...] in the Doc string. It was probably from seeing it in some function in Emacs core. One thing for sure, it’s not easy to discover without looking for it explicitly or stumbling across it like I probably did.

In any event, this is a useful thing to know. It’s a great example of how Emacs is self documenting.

Posted in General | Tagged | Leave a comment

Emacs Drawing Tools

Over at the Emacs subreddit, ismbks asks about drawing tools for Emacs. If you’re like me, the only thing that comes to mind is artist-mode with possible export through ditaa. That combination has always met my needs but it is pretty rudimentary and mostly confined to block diagrams.

The comments have some other solutions. On really nice example is AKIYAMA Kouhei’s Emacs Easy Draw. It’s very interactive and has nice line drawing capabilities. Take a look at the demo on its GitHub page to get an idea of what it can do.

Another commenter recommends PlantUML, which is good for flow diagrams and fancy block diagrams. It’s a markup application rather than interactive if you prefer that way of working.

Of course, all these applications are meant for engineers needing to draw engineering diagrams and not for artists who want to do serious digital art. Emacs is probably never going to support that sort of thing and why should it? After all, there are applications specialized for that and it’s hard to imagine a need for doing it from within Emacs.

Posted in General | Tagged | Leave a comment

Making It Easy To Unsubscribe

One of the really annoying aspects of the digital age is trying to end an online subscription. These subscriptions are always easy to sign up for but very difficult to end. My favorite example is the New York Times. They bombard me daily with exhortations to take a trial subscription. If I don’t like it, they say, I can quit at any time.

What they don’t say is that while subscribing requires little more than a click, unsubscribing requires a phone call to the NYT where they do everything they can to talk you out of dropping your subscription and generally make ending it as difficult as possible. Everybody but the marketers hate this tactic.

Now, at last, it’s going to end. The Federal Trade Commission has announced a new rule that makes the tactic illegal. Basically the rules says that it has to be as easy to quit as it is to sign up. That would mean, for example, that I could quit my NYT subscription with a click or perhaps an email. No more arguing with a salesman trying to keep me in the fold.

As you probably know, Irreal is inclined to be skeptical about the utility of involving government bureaucrats in our affairs and if I were consistent, I’d be against this intervention too but, I must admit, I’m happy to see this rule. It is, I think, merely insisting that companies be honest and equitable with their customers.

The marketeers who see abusing their customers as a viable tactic will doubtlessly try to find a ways to skirt the regulations. It will be interesting to see what happens.

Posted in General | Tagged | Leave a comment

Apple Was Right

Irreal has been preaching for years about the dangers of giving the nannies a backdoor into our private communications. They scream, “Think of the children” at us and insist that they’re the good guys and be trusted to safeguard our privacy. It’s laughable, of course.

Say whatever you want about Apple but they have always said “No” to such requests and have even gone to court to defend their right to do so. Chris Smith, over at BGR, makes an excellent point. The recent breach of the law enforcement wiretap infrastructure at AT&T, Verizon, and Lumen by the Chinese Hacking group Salt Typhoon shows that there’s no such thing as a secure backdoor, and that Apple was right to refuse to pretend that there is.

As Smith points out, this wire tapping interface was exactly that the nannies want: a backdoor into the communication channel. And yet, hackers have been inside the system for months or longer, downloading information and otherwise abusing the system.

I think it’s wrong to put this down to incompetence—even though the government’s involved. As most Irreal readers know, once a system becomes known and has Internet access, it will be breached. The same is true for a putative iPhone backdoor.

It will become known because the first time law enforcement uses it to gather evidence, the defense will insist on learning where they got the data and they will either have to reveal the backdoor or let the criminal walk.

Once it’s known that the backdoor exists, hackers everywhere will work on breaching it. Remember, these attackers will include nation states with virtually unlimited resources. The prize is great enough that it would be worth throwing whatever resources are required to obtain it. My guess is that everyone will be surprised at how fast that happens.

The snake oil salesmen will tell you they have a foolproof system that’s perfectly safe. Don’t believe them. They’re no more reliable than their progenitors. If we want our communications secure, we must continue to insist that there be no backdoors.

Added during publication

Bruce Schneier makes the same point.

Posted in General | Tagged | Leave a comment

Moving Among Emacs Windows

Once you discover the utility of having multiple windows in a single Emacs frame, the question of how to switch between those windows arises naturally. Emacs, of course, has you covered. You can use Ctrl+x o to cycle between windows. That’s great if you have only a couple of windows in a frame but it becomes tedious when there are multiple windows. That, of course, happens often once you get used to making maximum use of Emacs.

Marie K. Ekeberg over at TheMKat has a solution. It’s a nice solution in the sense that it’s built into Emacs so you can use it without adding anything extra. That solution is windmove. Ekeberg didn’t like the default bindings but, as she says, it’s easy to change them to whatever is comfortable for you.

I used windmove for a while but I have since moved to ace-window, a wonderful app from abo-abo that, when invoked, labels each visible window with a number that you can use to select that window you want to move to. I’ve bound it to Ctrl+x o so I didn’t have to learn a new binding. The nice thing is that if there are only two windows—my usual situation—ace-window will simply switch to the other without further ado.

When I brought up the ace-window repository while writing this post, I noticed that there are a bunch of possible actions available. I never use any of them except switching but you may find some of them useful.

The TL;DR is that if you routinely have more than two windows in a frame, ace-window is a must have app. I’ve been using it for years and wouldn’t want to live without it.

Posted in General | Tagged | Leave a comment

Organizing A Book In Org Mode

Somehow, I missed this great reference to Ron Galloway’s outline for using Org mode to organize a book. Fortunately, Sacha had me covered with her excellent Emacs News.

If you haven’t written a book before, it may be surprising how necessary Galloway’s template is for the actual mechanics of writing a book. Even if you’re organized and divide your book into a main file and separate files for each chapter, you’ll soon discover that you want some place to put notes, log your progress, track your references, and brainstorm ideas.

Every author solves these problems in different ways with different file structures but Org is especially amenable to providing a useful framework for organizing these things.

I wrote my books before I discovered Org mode—or perhaps before it existed—but my structure was essentially the same. The nice thing about Org is that you can access—and work on—all those files from a single top level file.

If you’re writing or considering writing a book, take a look at Galloway’s outline. It’s an excellent starting point for our own project.

Posted in General | Tagged , | Leave a comment

Unique Card Decks Revisited

Five years ago, I wrote about an interesting factoid that Paul Graham posted (probably to Twitter) concerning how many unique orderings of a standard 52 playing card deck there are. Almost all Irreal readers will immediately raise their hands shouting, “I know, I know! 52!.”

The point of that post was to get a feel for how large 52! really is. It’s way bigger than your intuition tells you it is. The TL;DR from that post was that every time you pick up a well shuffled card deck it is almost certainly unique for all time, past and future.

Over at czep.net there’s an interesting post that takes another look at 52! and how unimaginably large it is. To do this, the post proposes a series of games. In one such game, you start a timer counting down from 52! to 0 once a second and walk around the equator taking one step every billion years. When you complete the circuit, you take a single drop of water from the Pacific ocean and start again. When the Pacific ocean is dry, you place a single sheet of paper on the ground, refill the ocean, and start again. When the sheets reach from the Earth to the sun, check the timer and you’ll notice that the leftmost digits still haven’t changed.

Take a look at the post. It’s astounding how large 52! really is even though at \(\approx 8 \times 10^{67}\) it may not seem that large to those of us used to dealing with large numbers. If you have to perform 52! operations, you’re never going to finish.

Posted in General | Tagged | Leave a comment

The Downside Of Living A Digital Life

Regular readers know that for several years I’ve been endeavoring to live a “digital life”. What that means—more or less—is eschewing pencil and paper, paper bills, checks, dead tree books, physical credit cards, and even things like keys when I can. My goal is to be able to manage my life from my computer and to be able to leave the house with nothing but my phone. I’ve pretty much met those goals except for my car keys and driver’s license.

It’s no surprise that all this depends critically on two things:

  1. Electricity to charge device batteries
  2. A reliable Internet connection

As Milton recently made clear, that infrastructure can be fragile. The bunker lost power for 3 days and with it, any semblance of living a digital life. My devices were all charged up, of course, but that doesn’t last long when you’re trying to get things done and they can’t be recharged. I have a backup battery that kept our two phones charged but we did have to cut way back on usage.

WiFi was down—and therefore our “Smart Home” as well but cell phone service was still on so we had broadband service when we absolutely needed to get on the Internet or text someone. As I said, there’s nothing like wondering how you’re going to charge your phone to make you positively stingy about its use.

Fortunately, the bunker is overflowing with dead tree books acquired before I started down the digital life path so we were able to keep ourselves amused. Seven years ago, I bought a four pack of these Etekcity Lanterns, which provided light for reading and other things when it got dark. I don’t use them very often but they’re wonderfully useful when you need them. They’re bright and the batteries (AA) last for a long time (up to 50 hours according to Etekcity). I changed out the original batteries for the first time during the latest outage. If you—even sometimes—lose power you really should invest. They’re cheap and reliable and can help ease you through a power outage.

In any case, Irreal’s adventure in roughing it is over and we’re glad to be back living a digital life.

Posted in General | Tagged | Leave a comment