Use GNU Emacs : The Plain Text Computing Environment

I just came across a link to this recently updated book on the plain text computing environment. It was, apparently, first written to describe Emacs 19.29 around 1997. That was a long time ago and Emacs has evolved considerably since then. Happily, the book has recently been updated to Emacs 29.4. It’s over 600 pages so there’s a lot of content.

You can see the book here, There’s an interactive menu on the left that will give you an idea of what’s available. Besides HTML, it’s available in PDF and various EPUB formats. At more than 600 pages there’s obviously lot of content but the author, Keith Waclena, says that while you could read it straight through, he doubts many people will. Rather, it’s designed to enable you to skip to any topic you’re interested in.

Obviously, I haven’t been through the book in detail—having just discovered it—but it seems like a useful resource, especially for users new to Emacs. Take a look, especially if your a n00b.

Posted in General | Tagged | Leave a comment

Emacs Redux On Flyspell

Here’s yet another post commenting on something that Bozhidar Batsov wrote on Emacs Redux. I like to write about his posts because they typically look at some Emacs functionality that we all thought we knew about and tells us things about that functionality that we didn’t know.

His latest post is about flyspell. I’ve been using flyspell for so long that I have no memory of when I started or how I discovered it. On the other hand, my sole use of it is to invoke flyspell-auto-correct-previous-word with its default binding of Ctrl+;. I was vaguely aware that you could do manual checks or even check a whole buffer but I never used them.

Batsov’s post discusses some of those other commands. You can, for example, use Ctrl+, to move to the next misspelling. Then you can use Ctrl+. or Ctrl+; to correct it.

I like Ctrl+; because the point doesn’t have to be on the misspelling; it corrects the previous error wherever it is. Batsov, on the other hand, likes Ctrl+c $ because it gives you a menu of possible corrections as well as options to accept it in the current buffer, accept it in the current session, or add it to your dictionary. The key binding is—for me—significantly more awkward so I’m going to stick with Ctrl+; unless I want to add the word to my dictionary.

But Batsov is a serious Emacs user and his recommendations shouldn’t be ignored. Read his post and see what you think. As usual, Emacs has got you covered whatever your preferences.

Update [2025-04-01 Tue 21:29]: Fix link.

Posted in General | Tagged | Leave a comment

France Makes The Right Choice

Some Americans like to make fun of the French but they’ve recently shown that they’ve got it together a lot more than many governments. The EFF is reporting that France recently rejected a backdoor mandate greatly desired by the Interior Ministry. The Interior Ministry was full of high sounding words about drug dealers and doubtless about protecting the children but the French legislature was able to see through the fog and realize what a terrible idea such a backdoor really was.

Everybody here already knows the arguments for why backdoors are:

  1. A bad idea for personal and national security, and
  2. Will not work.

One of my favorite stories is the probably apocryphal story of some legislature trying to legislate the value of pi. The same mindset is in play with legislators who believe that they can simply will a secure backdoor into existence. The fact that experts everywhere say, “No you can’t.” makes no impression.

France’s rejection of this nonsense is good news indeed but other governments are still yearning for the ability to snoop on everything and everybody. The worst current example is the UK trying to force Apple to give them the ability to spy on any Apple user in the world [1, 2]. Apple said no and simply withdrew the secure messaging product from the UK while the U.S. government, far from amused, is making various threatening noises. It’s still unclear how that drama will play out but I don’t see Apple—or the U.S. government—acquiescing.

Sadly, many governments—even putatively democratic ones—can’t resist the siren song of universal surveillance. They’ll keep pushing until some legislature says that, yes, pi really is exactly 3.14.

Posted in General | Tagged | Leave a comment

Journelly Review

I’ve written a couple of times about Álvaro Ramírez’s Journelly [1, 2] and how it seemed like a good fit for my memo book needs. In the last of those posts, Ramírez announced that he was starting an official beta program. I wrote that I might sign up but as usual inertia prevailed and I didn’t get around to it.

In his latest post on Journelly, Ramírez notes that Mac Observer has a review of Journelly. I hopped over there to take a look and was impressed. It’s a nice review and makes Journelly seem like an even better fit for my needs than I had previously thought. If you’re the slightest bit interested in Journelly or think you might be, you should definitely take a look at the Mac Observer review.

Ramírez’s posts on Journelly tend to emphasize it’s use as a sort of private Twitter/X but the Mac Observer review makes clear that it can also be used as a kind of journaling app as well. One of the best parts, from my point of view, is that the data is saved in Org mode format so I should be able to integrate it into my Emacs workflow easily.

In any event, I was finally able to bestir myself to email Ramírez and ask for a beta invite. He responded right away with my invite and I installed it without a problem. I’ve never participated in an iOS beta before and wasn’t sure how to get the beta app installed. It turns out to be easy. Apple has a special app called TestFlight that automates everything. You simply install TestFlight, click on the invite, and everything else happens automatically.

I just finished the install and haven’t had time to play with Journelly yet but I’ll let you know what I think as soon as I get a bit of experience with it.

Posted in General | Tagged | Leave a comment

Configuring Emacs Garbage Collection

Bozhidar Batsov has posted another in his long list of informative Emacs posts. This time, it’s about configuring Emacs garbage collection. The principal way of doing that is to set gc-cons-threshold to a higher value than its default of 80000. Batsov has his set to 50000000 and is wondering if he should increase it.

On the other hand, picking a correct value is far from trivial. Batsov includes some text from Eli Zaretskii, the current Emacs maintainer, that says setting the value too high will adversely affect performance.

Garbage collection is notoriously difficult to configure correctly in any application and I have no special insight into what the correct value should be in any particular situation. What I can do, though, is tell you what I do, which works very well for me. I virtually never see a pause for garbage collection. On the other hand, I don’t invoke a lot of memory hungry functions so my results may differ from yours.

I long ago gave up tweaking gc-cons-threshold and installed gcmh to handle garbage collection for me. Gcmh is based on the observation that if Emacs has been idle for 15 seconds, it will probably be idle longer so it’s a good time kick off garbage collection. It does this by setting the normal threshold very high but when it sees that Emacs is idle, it sets it to a low value to kick off garbage collection. The explanation of how it works is here.

Gcmh tells you every time it kicks off garbage collection and I frequently see this when I stop typing for a bit. The system works really well for me. As I say, I never see a delay for garbage collection. If you’re seeing problems in that area, give gcmh a try and see how it works for you.

Posted in General | Tagged | Leave a comment

Standing Up To Patent Trolls

Everybody here knows that Irreal doesn’t hold patent trolls in high regard. That’s me showing restraint. What I actually think is that they’re parasites that should wiped off the face of the earth in service of improving the commonweal.

Still, there are edge cases. Here’s an example from 2008 that even though it’s old news now, is a great story. Monster Cable actually produces products and offers them for sale. Unfortunately, that apparently didn’t stop them from abusing the patent system by threatening their competitors with patent litigation. Irreal, of course, has no idea of the merit of those claims but one of their targets had some very strong opinions of them.

Sadly for Monster Cable, it turns out that one of their targets, Blue Jeans Cables, is headed by Kurt Denke, a former litigator, who was not at all amused. He responded to Monster Cable’s lawyer by pointing out that they, not he, were the ones making claims, and it was up to them to prove them, not up to him to disprove them. He also told them that absent their convincing him that he was, in fact, infringing one of their patents or a finding from a court of the same thing he would not under any circumstances pay them a cent. He ended by saying, “Not only am I unintimidated by litigation; I sometimes rather miss it.”

Again, without commenting on the merits of the case, this seems to me to be the proper response to nuisance patent suits: “Prove it or go pound sand. We will not, under any circumstances, pay you to make this go away.” Most often, that’s all it takes. It’s a shame more companies don’t have the fortitude to make that stand.

After reading this story I was curious as to what happened so I did a bit of research. That turned up the full response from Denke, which is an entertaining and educational read, and a short recpap of the story from Denke that includes what happened in the end. As you might imagine, after his response to Monster’s lawyers, he never heard another word from them. I like to imagine his letter bursting into flame when Monster’s counsel opened it.

Posted in General | Tagged | Leave a comment

Smoother Scrolling

Over at The MKat, Marie K. Ekeberg has a post that brings me back to my earliest days of using Emacs. Before I was assimilated, I tried several times to warm up to Emacs but it wouldn’t take. Ekeberg’s post reminds me why. It was what I considered the schizophrenic default scrolling. You would move the cursor down the screen and suddenly, about three quarters of the way down, the screen would jump several lines. Every time I saw that, I would abandon my attempt to embrace Emacs and run screaming back to Vim.

In her post on smoother scrolling, Ekeberg offers an explanation for this bizarre behavior that I’m pretty sure is correct. The TL;DR is that in the old days, when Emacs was developed, scrolling was an expensive operation so rather than scroll by line, Emacs would scroll by (essentially) half pages.

I have no idea why the default hasn’t long since been changed but as far as I know, it hasn’t. I say, “as far as I know” because years and years ago I did what Ekeberg suggests and implemented smooth scrolling. I haven’t looked back.

It turns out that fixing this is far from trivial. I have no memory of how I figured it out but I do know that it involved pleading with the Internet for an answer. Take a look at Ekeberg’s post to see the answer. What she suggests is essentially what I did. As I said, not at all obvious.

It’s odd how a simple thing like scrolling can ruin your appreciation of Emacs but it sure did affect mine. Don’t let that happen to you. Take a look at Ekeberg’s post and find peace of mind.

Posted in General | Tagged | Leave a comment

Save Early And Often

Back in the bad old days when personal computers weren’t nearly as reliable as they are today, it was common to have your computer crash when you were right in the middle of writing a document. Because of that, a common mantra was, “save early and often”. That way, when the crash came you would have only a few lines to rewrite.

I first heard the particular expression “save early and often” from Jerry Pournelle but it may not have originated with him. It was common advice back then but the humorous twist does seem like Pournelle, so who knows. In any event, in those days it wasn’t just good advice, it was mandatory.

I was reminded of all this the other day when I was writing yesterday’s post on the latency of computer operations. I was switching back and forth between the post’s Emacs buffer and Ahmad’s post in Safari, when Safari suddenly froze and I couldn’t find a way to break out of it and get back to Emacs to save my buffer, which, sadly, I hadn’t bothered to backup as I went along. In the end, I had to reboot the machine to get things back to normal.

Of course my whole post was gone when my laptop came back up. Note that this was not Emacs’ fault. It was Safari that froze and it was me that didn’t bother saving my work. Actually, Emacs was the hero in all this because the autosave function rescued me from my folly. I hardly ever need to use it so I always have a hard time remembering what to do but in the end I got almost my whole post back.

The takeaway from all this is that even with reliable hardware and software, crashes and freezes can still happen so if you care about your work make sure to back it up often. Or, as Pournelle would have it, early and often. If you don’t, the day will come when even Emacs can’t save you.

Posted in General | Tagged | Leave a comment

Useful Latency Number For Programmers

If you’ve been around Irreal for a while, you know that I like to read about the latency of various computer operations. I find it fascinating but one could say that the data is abstract and dismiss it as “interesting but who cares?”.

Mohammad Zeya Ahmad has an informative post that answers that question. He has a list of how much time various common operations take. That’s interesting but what make his list stand out is that he draws conclusions from his results.

For example, SSDs are about 30 times faster than HDDs so if you have a high performance disk-based task, it makes sense to use SSDs. Of course, there are reasons to prefer HDDs but if performance is your controlling metric, SSDs are probably your best choice.

For each group of comparable metrics, Ahmad offers an actionable suggestion. Those groups range from CPU versus Cache and Memory speeds to network transfer times. None of the suggestions are going to turn you into an uber-programmer but they can help you squeeze more performance out of your program.

It’s a nice post and just might help you write better code. Even if it doesn’t, it’s interesting to see how long these common operations take.

Posted in Programming | Tagged | Leave a comment

The Ten Commandments Of The Church Of Emacs

It’s Monday. Most of us are looking around bleary eyed wondering what happened to the weekend that just started. Here’s a little humor to get you warmed up for what’s to come. Over at the Emacs subreddit, bruchieOP posts the Ten Commandments of the Church of Emacs.

It’s a satirical look at the beliefs that most of us Emacs users hold near and dear. Note that satirical qualifier. For example, lots of people use and swear by “pre-configured distributions”, such as Doom and Spacemacs, as even bruchieOP acknowledges. Still, most of you will identify and agree the majority of the prescriptions.

Take a couple of minutes to enjoy the post and then back to work. Emacs is waiting.

Posted in General | Tagged , | Leave a comment