Wordcraft

I do a lot of writing, almost all of it in Emacs so I’m always happy to see how other people use our editor of choice for writing. The latest example I’ve found is from JTR over at The Art Of Not Asking Why. His post considers some simple expansion functions in Emacs.

He starts off with dictionaries. As many of you know, I’ve been a Webster 1913 dictionary user ever since James Somers explained why I (and you) should be. I have gone through many iterations of integrating it into Emacs but have converged on the same solution that JTR uses: the built in dictionary-search function built into Emacs that we both have configured to use the online collection dict.org, although I still have a local copy from my previous iterations.

The dict.org collection is nice because it contains several dictionaries besides Webster’s, and dictionary-search will return entries from all of them that have the word you’re looking for. The best part is that it’s trivial to set up You don’t have to download dictionaries or packages. You simply set a variable saying you want to use dict.org and that’s it. There are some nuances with that so be sure to read JTR’s post or the documentation.

JTR’s post is worth reading just for his dictionary advice but there’s more.

Next he briefly discusses Hippie Expand, a way of completing words based on a list of functions that you can specify. I’ve been using it for a long time, but his list of completion functions was more complete than mine so I stole it.

Finally, he considers ispell. If you’ve been following along, you’ll know that I recently started using Jinx instead of ispell but JTR showed me a couple of things I didn’t know about. I’ve always used ispell with flyspell so I never learned some of its extra tricks. One of those is a sort of fuzzy search for a word you’re not sure how to spell. That happens to me a lot so I was glad to find out about ispell’s ability to handle it.

The other thing you can do with ispell is to use it as a quick way of doing a replace. Take a look at JTR’s post for more on both those functions.

JTR’s post is from last week so Sacha will doubtless cover it before you see this but I had a lot to say about it so I decided to write about it anyway. It’s definitely worth a careful reading.

Posted in General | Tagged | Leave a comment

Recipe Cards

Today’s topic seems odd for Irreal. Even tagging it as “Tech” seems odd but bear with me. If you’re like me and have a hard time following most recipes, today’s post has a solution. It’s all about a new format for recipe cards. A lot of the reason many of us nerds have a difficult time with cooking is the standard recipe card. We want it to be like a program we’d write but it isn’t really like that. You can make the case that the list of ingredients that typically start the standard recipe card is the data declaration and the (dense) text that follows are the commands but that remains unconvincing, at least to me.

The format recommended at the above link was invented by software engineer Michael Chu. He brings an engineer’s sensibilities to the problem. Take a look at the sample recipe cards at the link. Notice how the whole process just jumps out at you. It’s immediately clear what you do with what and in what order.

The only problem with the system is that it’s been completely ignored by the people who write recipes. There are a couple of solutions. First, Chu maintains a site, cookingforengineers.com, that uses the system.

Second, @juanbuis, whose tweet started the rediscovery of Chu’s system, built a site that accepts a standard recipe and spits out one in Chu’s format. The minions generally discourage me from entering the bunker’s kitchen so I haven’t tried it but it seems useful.

Take a look at that first link and I think you’ll agree that it’s a worthy topic for Irreal and deserves the “Tech” tag.

Posted in General | Tagged | Leave a comment

Maiorana On Directory Local Variables

Chris Maiorana has a useful post on directory local variables. The idea is that rather than putting a lot of context specific configuration in your init.el file, you can put those configurations in a .dir-locals.el file and they will be set only when you open a file in that directory.

I really like the idea of directory local variables but it has never worked well for me. That’s mainly because I usually wanted to execute some code using the eval keyword. That always causes some problems involving a stack overflow, no matter how simple the code is. Lately, I’ve been using them a lot in conjunction with Jinx, which has the nice feature of adding words to the local file or local directory in addition to the other usual options.

I find that really useful for my blogging. I can add post specific words to the post source file itself or I can add them to all posts in my blog directory. Maiorana uses then to set things like compilation settings, fill and wrap settings, and indentation styles.

If you have different workflows with different setting needs, directory local variables is a very nice way of dealing with them. Of course, not everything should go in a directory local variable. Some things apply to all your buffers and should go in your init.el but for those things that are specific to particular workflows, directory local variables are just what you need.

Posted in General | Tagged | Leave a comment

Emacs Configuration Organization

Emacs configurations are like well shuffled card decks: no two are alike. But, as Arlo Guthrie famously sang, that’s “not what I came to tell you about”. Rather, this post is about differing organizations for those Emacs configurations.

The idea was suggested to me by a post from Andros Fenollosa on his own Emacs configuration. Fenollosa says that he doesn’t use any of the all-in-one configurations like Spacemacs or Doom because they include too much and are hard to understand and make changes to. He also doesn’t use the popular literate configuration method using Org mode because it’s just another layer of complexity that can go wrong.

His idea is to to have a separate file for each “area of responsibility” and to use init.el as a sort of index that loads them in order. I like that idea but don’t use separate files. I keep everything in init.el and just organize it in sections.

Still, Fenollosa has a good argument for the separate files but I think I get the same benefits with a single file broken into sections. Actually, it’s not quite true that everything is in a single file. I run Emacs on several type of systems and keep the system/OS specific information in separate files that I load conditionally based on the system and OS type1. That way I don’t have a lot of conditionals dealing with system/OS type in init.el itself.

There aren’t as many ways of organizing your Emacs configuration as there are configurations but there are a lot of them. What principle do you use?

Footnotes:

1

If you’re interested, here’s the code:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Pull in system and platform specific configurations                    ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Just keep on going if the requisite file isn't there.
;; Manipulations in second load is for "gnu/linux" → "linux"

(load (car (split-string (system-name) "\\.")) t)
(load (car (reverse (split-string (symbol-name system-type) "/"))) t)
Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Acronym Of The Day

Rick Manelius has proposed a new acronym: AI;DR. It stands for “AI; Didn’t Read”. He says that it actually originated with @seclilc here. Manelius isn’t an AI hater and, if fact, uses it himself. It’s just that he objects to asking someone a question and getting back an unedited—and probably unread—answer from a chat bot in reply. His new policy, he says, is that if you can’t be bothered to read and edit it, then he’s not going to bother reading it.

Really, responding to someone’s question with a buffer full of AI slop is profoundly disrespectful and will cause you to forfeit the goodwill and respect of your victim. If you want a less touchy-feely explanation, Manelius has an update pointing to dontpastetheai, which expresses the same sentiment in less circumspect language.

I’m sympathetic to all of this. If I ask someone a question, it’s because I want the benefit of their wisdom not some distilled twaddle that may not even be correct. If they don’t know or don’t have time at the moment to provide a detailed answer, I’m fine with their saying so. Just don’t send me some slop that even they can’t be bothered reading.

Posted in General | Tagged | Leave a comment

Tweaking Emacs Scrolling Behavior

For me, one of the most difficult Emacs behaviors—or at least “normal” Emacs behaviors—to understand is scrolling. The default behavior is so unintuitive and jarring that it kept me from embracing Emacs for a long time. It was only after I took the plunge that I discovered that that behavior, like everything else in Emacs, is configurable.

That was almost 20 years ago when I was just starting and knew next to nothing about Emacs configuration but I was able find the solution on the Internet. Here’s what I’ve had in my init.el almost from the beginning:

(setq    ;set reasonable scrolling
 scroll-margin 0
 scroll-conservatively 100000
 scroll-preserve-screen-position 1)

Back then, I had no idea what any of it meant, only that it made Emacs scrolling rational by my standards. It’s been sitting there undisturbed ever since.

Now James Cherti has a really excellent post that expains all the fine points of configuring scrolling. He explains the above lines, which most people probably have in their configuration. If you want Emacs scrolling to behave as it does in every other application, you can leave them as is but you can tweak the behavior a bit if you like. Cherti has all the details.

But wait. There’s more. There are similar settings for horizontal scrolling that you might like. I’ve never had any problem with horizontal scrolling—probably because I’ve always wrapped lines in one way or another—but they’re there if you need them.

There are some other tweaks that you can apply to delay fontification during scrolling to speed things up a bit. Again, this is not something that I use but if you deal with large files, you may find it useful.

In Emacs 29 and later you can set pixel-precise scrolling to make scrolling over images more pleasant. There are a few other tweaks in Cherti’s post so you should definitely take a look at it. There’s a lot of good content and even if you use only a bit of it, you will find his post worthwhile.

Posted in General | Tagged | Leave a comment

Fixing Define-word

My go to Emacs in-line dictionary is abo-abo’s define-word. It pops up a definition of the word at point in the minibuffer. I use it several times a day. Lately, though, it has been returning “zero definitions found” on every invocation. This problem predated my update to Emacs 31.1 so it’s not related to the version of Emacs.

Today (Tuesday) I finally got fed up and decided to track down the problem. It wasn’t too hard. It turns out that the problem is that define-word calls the on-line dictionaries with HTTP rather than HTTPS and the sites are rejecting the connections. There’s already a pull request (2026-08-22) for the fix but as of today (2026-08-25) it hasn’t been merged or uploaded to MELPA.

I messed around for a while but couldn’t get any of the obvious solutions to work so I gave up and added

  :init
  ;; Until define-word is updated in MELPA
  (defcustom define-word-services
    '((wordnik "https://wordnik.com/words/%s" define-word--parse-wordnik)
      (openthesaurus "https://www.openthesaurus.de/synonyme/%s" define-word--parse-openthesaurus)
      (webster "https://webstersdictionary1828.com/Dictionary/%s" define-word--parse-webster)
      (offline-wikitionary define-word--get-offline-wikitionary nil))
    "Services for define-word, A list of lists of the
  format (symbol url function-for-parsing).
Instead of an url string, url can be a custom function for retrieving results."
    :type '(alist
            :key-type (symbol :tag "Name of service")
            :value-type (group
                         (string :tag "Url (%s denotes search word)")
                         (function :tag "Parsing function"))))

to the use-package for define-word. That’s just a copy of the definition of define-word-services from the define-word source. Note that it’s important that it goes in the :init section so that the definition gets established before define-word is loaded.

It’s a messy solution but it will do until the fix is merged and percolates up to MELPA.

Posted in General | Tagged | Leave a comment

Walmart Accepts The Inevitable

Those of you longtime Irreal readers who have been following my quest for living a digital life know that I long ago gave up shopping at Walmart. One reason for that is that Covid 19 taught us that Amazon would deliver the same products to our door for pretty much the same price. The other reason, though, is that Walmart stubbornly refused to accept Apple Pay.

Walmart told all sorts of stories—none of them true—for why that was. They continued, for example, to blame contractual obligations to CurrentC long after that benighted organization met its well deserved demise. There were other stories but the truth was always the same: Walmart wanted to harvest customer data, which they couldn’t do with Apple Pay, so they insisted that customers wanting contactless checkout scan a QR code to pay. We here at the Irreal Bunker are famously old and grumpy but the QR code thing didn’t go over well with anyone.

Now, finally, Walmart has capitulated and agreed to accept Apple Pay. Read their announcement. All the reasons they give for accepting tap-to-pay applied 12 years ago just as well as today but Walmart still had hopes of getting their hands on that sweet, sweet data and refused to accept the inevitable.

Walmart will be rolling out the change gradually. If you’ve been waiting for Walmart to accept Apple Pay and are wondering when it will be available in your state, here’s the schedule.

I remember sort of enjoying browsing around Walmart before I gave it up for Amazon but at this point—even with Apple Pay—I’m not sure I’ll go back. Walmart, of course, won’t notice, but losing customers one at a time is the price you pay for ignoring customer preferences for years.

Thanks to John Gruber at Daring Fireball for the pointer.

Posted in General | Tagged | Leave a comment

Emacs 31.1

Happy news this morning. Sean Whitton has announced the release of Emacs 31.1. As usual, it’s available at the mirror nearest you. Note, however, that the URLs in Whitton’s announcement have a typo. See this message from Eli for the correct URLs.

I’m writing this with the just built new Emacs and everything seems fine. I had a bit of trouble downloading the source because, apparently, some of the mirrors haven’t updated yet. If that happens to you, just repeat the request a time or two and you should get everything. After that, enjoy your new Emacs and all the goodies it brings. As always, Mickey has his usual exegesis of the changes.

As I invariably say at times like this, Eli and the rest of the development team deserve our huge thanks for their selfless efforts on our behalf.

Posted in General | Tagged | Leave a comment

Setq And The Others

James Cherti has an interesting and useful post about the relative efficiency of setq, setq-default, setopt, and customize-set-variable. Cherti justifies this concern on their effect on Emacs startup time but according to well established Irreal dicta this doesn’t matter because we seldom restart Emacs so a few seconds more or less simply don’t matter.

Oddly, there are some people who pay no attention to Irreal dicta and who obsess about every millisecond—Cherti’s term—of Emacs startup time. For those people and those who worry about execution times in general, Cherti’s post is very useful and explains why some of those commands are faster than others.

The crux of the matter is that defcustom can include a setter method that can be arbitrarily complex. Cherti has a nice example of this that will help you understand what’s going on. Cherti says that very often there’s no reason to invoke that setter method during startup and that setq or setq-default is faster and just as useful. Commands like setopt and customize-set-variable always call the setter method so they may be slower. Cherti’s examples show how to avoid unnecessary bottlenecks.

Cherti also shows how even the :custom keyword in use-package can trigger the setter methods of those variables and gives some workarounds. The main problem is that it’s hard to know when you can avoid the setter method and when you can’t. Sometimes, you just have to read the source code to figure it out.

Obsessing about startup times aside, it’s nice to have an explanation of what these commands do and how their use might affect run time. Cherti’s post is relatively short and well worth a minute or two to read.

Posted in General | Tagged , | Leave a comment