Jinx For Spell Correction

Marcin Borkowski (mbork) has a nice post on the Jinx spell corrector. Mbork has tried fly-spell but found it too laggy for his purposes. That was back in the days when he had a Pentium class machine running at 100 Mhz so he thought, in view of his more modern hardware, that it was worth trying out fly-spell again.

He still found it too slow and decided to try Jinx instead. I’ve always found fly-spell snappy and I hadn’t heard of Jinx until I read Prot’s post on writing (and spell correcting) foreign languages in Emacs but mbork wasn’t satisfied until he tried Jinx. He found that it was fast enough for his use cases and decided to embrace it as his spell corrector.

He discovered that Jinx interfered with some of his work flows but it turned out to be pretty easy to fix those. You can check out mbork’s post for the details.

If you are writing in multiple languages with Emacs, then Jinx may be an excellent solution as a spell checker. If, like me, you mostly write in your native tongue, you’ll probably find fly-spell is all you need. As I said above, it’s more than fast enough for me and provides a wonderfully interactive spell correction system.

Posted in General | Tagged | Leave a comment

Highest Org Priority

If you’re an Org user, you probably know that you can assign a priority to TODO items. By default, the priorities are A, B, and C but with a bit of trickery you can extend the ranges to 0–9 and A–Z.

I never use priorities but Raymond Zeitler does and after figuring out the above trickery he thought it would be useful to have an ultimate priority a sort of “drop everything and do this immediately” priority. He decided to make this priority 100 times the highest priority and to designate it with !.

The solution wasn’t straightforward but it wasn’t too difficult either. The thing about Emacs is that it’s easy to check the source code to see how things are done. It turns out that Org has a org-priority-get-priority-function variable that contains a function that Org calls to get the priority from the priority cookie. Zeitler wrote his own version to check for a ! and return the high priority if it’s found. If not, then it calls a slightly modified version of the normal function.

As I say, I don’t make use of the priority mechanism and have no idea how many people do but if you’re one of them and are looking for a way to specify an extraordinary priority, take a look at Zeitler’s post. You can cut and paste his code if you’re interested.

Posted in General | Tagged , | Leave a comment

🥩 Red Meat Friday: Apple And The Cost Of Ram

The technical press is wetting their pants—or pretending to—about Apple1 raising prices on many of their products due to the AI industry fed rise in RAM prices. It’s outrageous, they claim. Apple should just eat the cost of those increases so that the rest of us can continue to pretend that nothing has changed, they say. Anyone with a semi-functional BSometer will recognize that for the clickbait that it is.

There is, of course, plenty of faux outrage to go around. The usual pandering politicians are busy demonstrating their lack of economic knowledge or at least pretending not to understand it. Among the worst offenders here is Bernie Sanders, whose statements on the matter have been so outrageous that even archliberal John Gruber felt obliged to call him out on his statements.

The thing is, even though RAM prices have increased due to demand from the AI industry, they are still historically low as this study from Stanford shows. Doubtless even the venture capitalists will eventually conquer their FOMO and begin to wonder when they’ll start seeing some returns. When that happens, the problem will likely resolve itself.

We here at the Irreal bunker are part of the iPhone upgrade program and get a new phone every year. Like everyone else, we don’t enjoy paying more but the increases are a direct application of the law of supply and demand. Chip manufacturers are working on the supply side and the aforementioned venture capitalists will probably help on the demand side.

In the meantime, when the price of components rise so will the prices of the finished product. That’s reality. All the whiners should grow up and accept that reality.

Footnotes:

1

Of course, it’s not just Apple. All the other manufacturers are raising their prices too but we don’t hear as much about that.

Posted in General | Tagged | Leave a comment

Globally Overriding Keys

Protesilaos Stavrou (prot) has an excellent video that addresses a problem I often see people asking about. The problem is how to globally set a key binding so that it won’t be overridden. He uses setting Meta+o to other-window as an example to explore the problem.

Prot begins by defining Meta+o in the global map in the usual way:

(define-key global-map (kbd "M-o") 'other-window )

That works well until he tries it in an HTML buffer. In the HTML buffer, Meta+o turns out to be a prefix key for inserting an HTML face command. The problem is that Emacs will use the most specific bindings first. Global bindings are the most general, followed by major mode bindings, and ending with minor mode bindings as the most specific.

Since HTML is a major mode, its keybinding take precedence over the global binding that we set. The answer is to get more specific yet by defining our binding in a minor mode so that it will always have precedence.

Prot shows how to define a minor where we can define our binding and activate it globally so that it’s always available. Of course, once we have this mechanism set up, we can add any number of bindings to our minor mode. Prot demonstrates this by adding a binding that Org uses.

Take a look at Prot’s video for all the details. He’s also included a copy of the file he was working with so you can see everything without worrying about copying it down from the video. The video is 12 minutes, 45 seconds so it should be easy to fit in.

Posted in General | Tagged | Leave a comment

Insert Mode

My pal Watts Martin has a post that explores an artifact from the past: the insert key. Martin, who’s been a Mac head much longer than I have, remembers when Mac keyboards still had an Insert. They no longer do, of course, but my Unicomp Model M clone does as do several other PC keyboards. The key was used to toggle between inserting text and overwriting it. Emacs calls the latter overwrite-mode.

The idea of insert mode is that text in front of the cursor is pushed ahead as new text is added behind it. When insert mode is off—that is, when overwrite-mode is active—the text in front of cursor is overwritten. Overwriting text used to be more common but these days everyone uses insert mode and you rarely see it.

Still, as Martin says, overwriting can sometimes be useful and if you have an Insert key there’s no reason not to use it in Emacs. That’s a one liner and easy do in your init.el. On the Mac, the Insert key is usually mapped to Help but on other systems it probably has a different mapping so you may have to experiment to discover what it is.

Finally, Martin wanted a visual clue as to which mode he was in so he changed the shape of the cursor to reflect the mode. Again, that’s easy to do. He uses overwrite-mode-hook to toggle the cursor shape.

While I agree that overwrite-mode can occasionally be useful I don’t—and have never—used it enough to dedicate an actual key to it. I’m perfectly happy to simply call overwrite-mode to turn it on and off.

Posted in General | Tagged | Leave a comment

Problems With Org Mode Code Blocks

Raymond Zeitler has an interesting post on an aspect of using Org Mode code blocks that I didn’t know about. Zeitler says that he prefers to write his code in separate code files rather than in Org mode code blocks and provides an example of why that is.

The TL;DR is that in certain edge cases, things like differing syntax tables can make code behave differently in Org mode than it does directly in Emacs. Take a look at his post for the details.

I have to say that I’ve never run into this problem. Perhaps that’s because I usually use Org code blocks only for code that will be executed in the Org environment. The few times that I have run the code outside of Org, I haven’t run into the problems that Zeitler describes.

Your mileage may vary, of course, but it’s good to be aware that there are some edge cases that can reach out and bite you if you’re not careful. Most of you, I’m sure, will have my experience but it pays to be aware of what can go wrong.

Posted in General | Tagged , | Leave a comment

Linux Removes Strncpy

Back when I learned C, people were still using strcpy and even gets. After a while, people started saying that strcpy wasn’t safe and that you should use strncpy instead to avoid buffer overruns, either accidental or deliberate.

Those days are long gone, of course, and now even strncpy is considered unsafe. Because of that the Linux project just completed a six year project to banish strncpy from the Linux kernel. The idea was to replace strncpy with strscpy, which fixes the problem with strncpy. The project was a lot more complicated than a simple string replace. Each instance had to be examined to see what the proper remediation was. You can read all about it in Stephen Smith’s blog.

Smith’s post has a nice chart that shows what function you should use for string copying depending on the use case. It’s useful to help you make the right choice when you need to copy a string or, more generally, a chunk of memory from one place to another.

These days there are a lot of people saying that C is unsafe and shouldn’t be used. Those of us who were brought up using it reject that and claim that in the hands of a careful coder, C is still the best language for a wide range of problems.

Even if you’re convinced that you don’t want to write your applications in C, the chances are good that at some point you’ll have to maintain or extend such an application. It is, therefore, useful to know how to do it safely. Smith’s post is a good place to learn how to deal with copying strings safely.

Posted in General | Tagged , | Leave a comment

Using Emacs Input Methods For Foreign Languages

Protesilaos Stavrou (Prot) has a very nice video on writing foreign languages with Emacs. The main problem for Latin languages are the diacritical marks. Other languages, such as Greek, Russian, and Chinese, have completely different alphabets. In either case, Emacs has us covered.

Prot writes Greek, English, French, and (possibly) Spanish so being able to handle all these languages easily is important to him. His video shows us how he does it. The video is in two parts:

  1. Using the Emacs input method mechanism and
  2. Multilingual spellchecking.

In the first part, Prot demonstrates how to switch between the normal input method—that is, the characters your keyboard normally sends—and another input method that maps to characters from another language.

He uses French as an example and shows one way (the postfix method) to add the diacritical marks that French uses. I use the same method for Spanish and like it. It’s easy and natural. The only thing that takes a bit of getting used to is using an accent character in a non-diacritical way. For example, when writing with the spanish-postfix method, e' results in é but if you want to write something like “he’s” you have to input he''s .

The second part of the video considers multilingual spellchecking. For that, Prot uses jinx, which is pretty much like the normal spell checking in Emacs except you can check multiple languages. It will underline spelling errors as usual and you can have it offer suggestions for correcting those errors.

I wish I’d seen Prot’s video before I started studying Spanish. It would have saved me a lot of time figuring things out on my own. If you have a need to use Emacs to write in another language, you should definitely take a look at Prot’s video.

Posted in General | Tagged | Leave a comment

Breaking Version Changes Coming To MELPA

Jonas Bernoulli (tarsius) has a long post announcing new channels and versioning on MELPA. Why a long post? And, really, why should we care? It turns out that the process is much more complicated than you’d think it would be and will, eventually, require nontrivial action on the part of MELPA users.

The first question is, Why is MELPA introducing new channels and why are they changing the versioning? The new (experimental) channels are a vehicle for testing the new versioning. The two new channels are Snapshots—that corresponds to the current Regular releases—and Releases—that corresponds to the current Stable releases. The plan is for these new channels to replace the Regular and Stable channels.

The reasons for changing the versioning are technical and you can read about them in Tarsius’ post but the reason we care is that when the official switchover happens, MELPA users are going to have to take certain actions to ensure their ELPA distributions are consistent with the new versioning. Otherwise, the new versioning could make a new version of a package look older than previous versions. Doubtless, when the time comes the MELPA team will provide a script to automate the changeover.

As I said at the beginning, there’s a lot of complicated details involved so you should definitely read Tarsius’ post. He recommends that you get in front of things by changing to the new channels now. His post explains everything you have to do. The official changeover probably won’t be for another year so you have time to prepare.

Update [2026-07-04 Sat 13:33]: Fixed title typo.

Posted in General | Tagged | Leave a comment

Automatically Signing And Encrypting Email With Mu4e

Nicolas Cavigneaux has an excellent post on signing and optionally encrypting emails sent with mu4e. The idea is to sign each email you send and if you have a GPG key for every recipient, encrypt it was well. As Cavigneaux says, it’s pretty easy to sign and/or encrypt messages with mu4e but you have to remember to do it and most people, including him, don’t always remember.

The solution, of course, is to automate the process so that you don’t have to remember. That turns out to be pretty easy to do. Cavigneaux has the necessary code in his post. The basic flow is to check if you have everyone’s encryption key and, if so, encrypt the message. Regardless of whether or not everyone’s encryption key is available sign the message. There are calls available for both the signing and encryption. The process is kicked off with the send-message-hook every time you send a message.

There was a time when encrypting all your messages was the thing to do but difficulties with key distribution have pretty much put an end to the encrypt all emails movement. Most people don’t have keys and those who do will probably be annoyed to receive mundane emails that are encrypted. For those sensitive emails being sent to people you know have keys, you pretty much automatically remember to encrypt them.

That leaves signing. It mostly doesn’t hurt anything1 so it probably doesn’t matter if you always sign your messages, especially if you have reasons to suspect that their contents might come into dispute. I’ve stopped doing even that because, as I say, no one has any idea what it means.

So my takeaway is that if you’re paranoid about certifying the content of your emails or you regularly deal with people who want to ensure themselves that they’re communication with you, it may make sense to automatically sign your emails. Except in special circumstances, I don’t see any reason to encrypt all your emails.

Footnotes:

1

Although I do remember being queried about those unreadable binary blobs at the end of my emails.

Posted in General | Tagged | Leave a comment