How CHM Recovered The Unix v4 Tape

I’ve written a few posts [1, 2, 3] on the recently discovered Unix v4 tape. The tape is significant because it is the only known extant copy of Unix v4. Unix v4 is significant because it was the first copy of Unix to be written mostly in C. The TL;DR of those posts centers around the difficulty of reading the tape or even if it would be possible. In the end, of course, they did manage to read the tape and recover the code.

The Computer History Museum (CHM) has a very nice video featuring the people involved that recounts how hard recovering the tape was. It wasn’t possible to simply mount the tape on a drive and read it. Rather, they tapped into the electronics of the tape reader where the analog signals came off the tape head but before they were decoded into digital. The analog data was then processed by a program that recovered the digital information from the analog signals.

How they happened to have the technology to do this is an interesting story in itself and is told by the people who developed it along with the problem they were trying to solve when they did. We also hear from the people who discovered the tape and their evolving reactions to it. At first, they merely thought that finding the tape—an ancient technology at that time—was sort of cool but they didn’t think much of it. It wasn’t until after a bit of research that they realized what they had and got in touch with the CHM.

The video is 16 minutes, 37 seconds long but it tells an interesting story and is worth a quarter hour of your time.

Posted in General | Tagged , | Leave a comment

Abrams On Literate Programming Redux

Howard Abrams has a video and associated post that updates his post on the same subject from 11 years ago. As with yesterday’s post, the video is from EmacsConf 2024 but someone just reposted it to reddit and it’s definitely worth taking a look at.

Abrams is explicit that by “literate programming” he means using code blocks and Babel in Org mode files. It’s an extremely powerful workflow. You can execute those code blocks in place or you can use org-babel-tangle to export the code to a separate file.

The majority of his video and post discuss ways of working with those Org files. One simple example is that he uses the local variables feature of Emacs files to set a hook that automatically tangles the file every time he saves it. That keeps the parent Org file and the generated code file in sync. He also has some functions that leverage Avy to find and execute a code block without changing the point’s location.

Finally, he talks about navigating his—possibly multi-file—projects. We wants to do the usual things like jumping to a function definition or getting a list of where a function is called. Emacs, of course, has functions for that but they don’t work in Org files. So Abrams wrote his own extension to the xref API based on ideas from dumb-jump.

Abrams drew all this together with a hydra that makes it easy for him to call any of his functions. He moves a bit rapidly in the video so you might want to read the post first in order to follow along. The video is 16 minutes, 38 seconds long so plan accordingly.

Posted in General | Tagged , | Leave a comment

A Video On The Casual Suite

Those of you that hang out on Irreal know that I think highly of Charles Choi’s Casual Suite. It’s just what you need for modes that have a lot of seldom used commands or modes that themselves are seldom used. The idea is that rather than having to remember the appropriate key sequences or command names, you merely bring up a transient menu and choose the operation from it.

That’s a bit of a simplification since Casual is actually a bit more nuanced. Back in 2024, Choi produced a video for EmacsConf 2024—which someone has just reposted—that explores some of those nuances.

The use of Casual is not an either or decision. Often times you know many of the commands of a certain mode—Dired or Calc, say—but haven’t memorized the commands for some of the more obscure or little used commands. That’s where Casual really shines. For sequences or commands you don’t remember, you simply bring up the menu with a key sequence that is the same for all casual menus and use it to select the operation you need. If you already know the sequence, you just use it without bothering with Casual at all.

Choi has a user guide for Casual that documents the current state of Casual and shows you what modes are covered. That list has grown since his video.

For those of you who care about such things, Choi has just made the Casual Suite available on NonGnu Elpa as well as Melpa. Watch the video and see if Casual may not be a worthwhile addition to your Emacs packages repertoire.

Posted in General | Tagged | Leave a comment

Transposing Things

Bozhidar Batsov is back with another great post on recent additions to Emacs, This time it’s about transposing things in Emacs. Most experienced Emacs users are familiar with transpose-chars and transpose-words. I’ve heard it suggested the that the use of these is mostly restricted to “power users” but I’ve been using them almost as long as I’ve been using Emacs. Perry Metzger made a comment on Irreal—I can’t find it now—extolling transpose-chars and how much more efficient it is than making the switch by hand.

I use those two commands all the time, usually several times a day. Batsov says that another useful transposition command is transpose-sentences but that few people discover it. I found it simply by assuming that it must exist and using Meta+x to find it. There’s also transpose lines, which I seldom use because it usually offers surprising results in visual-line-mode.

In addition to these commands there are some others. Take a look a Batsov’s post for more details. The point of his post is how much more useful some of these commands are when combined with Tree-sitter. The transpose-sexps command, which I always thought of as useful mostly for Lisp languages, gains a lot of power when Tree-sitter is brought to bear to define what “a balanced pair” means in whatever mode you’re using in the current buffer.

Finally, there is transpose-paragraphs. While I’ve never used it, it’s obviously useful for prose editing but gains new powers with Tree-sitter that can give a meaning to “paragraph” in the mode of the current buffer.

Every Emacs user should take a look at Batsov’s post. There’s a lot of good information in it.

Posted in General | Tagged | Leave a comment

Choi’s Casual Suite Is Now Available on NonGnu ELPA

After a considerable amount of back and forth on the Emacs Devel Mailing List, Charles Choi’s Casual Suite has been accepted for inclusion on the NonGnu ELPA repository. If you’re already a Casual user, this makes no substantive difference. You can still get the suite from MELPA as you always have but it will also be available on the NonGnu repository.

Evidently Choi decided to seek NonGnu placement because some folks object to MELPA on philosophical grounds. I’m not sure I understand what the issue is other than MELPA is not officially canonized by the FSF.

To me, that’s just like insisting on a small init.el on religiously grounds. It merely means that you can’t take advantage of all Emacs has to offer. Whatever the FSF’s feeling on the issue, MELPA is, in fact, the premier ELPA repository and almost every package worth having is represented there, and many of them only there.

Still, choices are good and now we have more of them. If, for whatever reason, you have an objection to MELPA, you can still take advantage of the Casual Suite.

Posted in General | Tagged | Leave a comment

Expand Region Reimagined

Bozhidar Batsov has been blogging up a storm on recent additions to Emacs that make our editing sessions easier. His latest post is about a successor to expand-region, expreg. Batsov has been a heavy user of expand-region for many years. The problem with it is that it requires hand written functions for each language that it supports.

As a result of his recent work integrating Tree-sitter into many of his packages, he thought it would make sense to reimplement expand-region as a Tree-sitter based package so that bespoke functions wouldn’t have to be written for each language. It turns out that Yuan Fu, who implemented the Emacs builtin Tree-sitter, had already done it.

Batsov loves expreg and doesn’t see why anyone who isn’t depending on some artifact of expand-region wouldn’t adopt it. Take a look at his post for more details.

In the comments over at the Emacs subreddit Karthink says that he has a constellation of packages that depend on expand-region and that it would be very hard for him to change. Spartanork says that he had a hard time getting Tree-sitter installed. Those two comments suggest that expreg may not be for everyone.

I’ve had expand-region installed for a long time but I don’t use it as much as I should. At this point in my life, virtually all my coding is done in either Elisp or C, for which expand-region works well. It also does the right thing in a prose buffer so I see no reason to change but if you’re using a lot of languages, you should definitely check out expreg.

Posted in General | Tagged | Leave a comment

Visual Wrap Prefix Mode

As I wrote yesterday, a lot of really interesting posts popped up all of a sudden and I speculated that I might have to break my rule about not covering items that Sacha has already mentioned. I’m giving myself leave to mention at least one more post from last week.

Bozhidar Batsov has a nice post that explores Emacs line wrapping. As he says, there are basically two ways of doing that:

  1. Hard wrapping that inserts an actual newline in the text to wrap the line at the logical screen width
  2. Soft wrapping with visual-line-mode that doesn’t change the actual text but changes the representation on screen

The problem with visual-line-mode is that it doesn’t respect the indentation context and merely wraps the line at the logical screen edge, which can make the screen representation of the text seem strange. Happily, all this is fixed in Emacs 30 with visual-wrap-prefix-mode that automatically computes the indentation context and indents the text appropriately.

I never noticed this problem before, probably because I turn on visual-line-mode only for prose buffers, never for code buffers. If you are going to export those prose buffers, you really want visual-line-mode so that the text will display correctly on any screen.

Still, I was interested in visual-wrap-prefix-mode because I had never seen the bad wrapping described by Batsov. My writing is mostly straight prose without a lot of fancy indenting such as you might get with, say, poetry. The only time it comes up is with lists like the one above. When I turned visual-wrap-prefix-mode for this buffer, it did indent the subsequent lines of each item but I never really noticed the bad indentation before because it gets rendered correctly when I export it.

In any event, you should definitely take a look at Batsov’s post if you’re having word wrap problems.

Posted in General | Tagged | Leave a comment

A Diff Preview Of A Regex Replace

When it rains, it pours. Sometimes I find it hard to find an interesting topic to write about. Other times, like today, four or five topics pop up. The problem is that today is Sunday and tomorrow Sacha will be publishing her weekly Emacs News. I generally try not to write about things that she’s already covered but I may have to break that rule for some of these interesting topics.

For me, the most exciting thing I’ve found today is Bozhidar Batsov’s post on Preview Regex Replacements as Diffs. It addresses a problem we’ve all had. You want to do a query-replace-regexp on a large file—or even multiple files—but you’re a bit nervous that maybe your regex isn’t quite right and the command might make a change you don’t want. So you step through each change, which is time consuming and a pain.

As Batsov explains, that got a lot easier in Emacs 30. There’s a new command, replace-regexp-as-diff that runs the regexp replace process but instead of actually making the changes, it produces a diff file in a separate buffer. That way you can see all the changes that would be made. If you’re happy with them, you can simply apply the diff buffer as a patch with diff-ediff-patch to apply them. If you’re not happy, you can simply delete the diff buffer.

There are two related commands: multi-file-replace-regexp-as-diff and dired-do-replace-regexp-as-diff for handling multiple files. The Dired variety is probably the easiest to use because you can simply mark the files you want to change in a Dired buffer and call dired-do-replace-regexp-as-diff to generate a diff for them all.

Batsov speculates that in the age of AI, people won’t be as interested in this type of command. I disagree strongly. It’s useful not only for coding but for writing pose or any other text-based file that you might want to edit.

If you’re an Emacs user, I urge you to take a look at Batsov’s post. It’s about a really useful new(ish) feature of Emacs that you can probably make good use of.

Posted in General | Tagged | Leave a comment

Emacs For Game Development

Over at the Emacs subreddit, alraban tells a nice story about game development with Emacs. The TL;DR is that it’s amazingly good. Alraban isn’t a professional developer but has been a hobbyist since the 80s. He has, several times, tried to write a game but never made anything he felt was performant enough to ship.

Recently he decided to try again. He used the Godot engine because he wanted to work with FOSS tools but he didn’t like the builtin editor or GUI so as a long time Emacs user, he thought he’d give Emacs a try.

Airaban was amazed at how good the experience was. The amazement wasn’t that you could develop games in Emacs—of course you can; people are doing it everyday—but at how good the tooling was and at how smooth and delightful the process was. Even as a long term user who “pretty much live[d] in Emacs” he was surprised at how much tooling there was available and how good it was. As he puts it,

It was like starting a home improvement project I’d never done before, and discovering that I already had all the tools I needed in the basement.

Most of us are pretty familiar with the Emacs tooling associated with our normal tasks. The takeaway from airaban’s post is that you’re apt to be surprised at what’s available when you move to a new task.

This is a short post and only takes a couple of minutes to read. It’s well worth your time.

Posted in General | Tagged | Leave a comment

Harp: A Private Health Records App

Abhinav Tushar likes to curate what he calls macro health data. That means things like ailments, aches and pains, and other symptoms one might want to mention to the doctor during an appointment. After researching the currently available apps, he realized there was nothing that met his needs so he decided to roll his own. The result is Harp, an Android app that should soon be available on the Play Store. It’s also available for free on Fdroid. You can also checkout the source at Sourcehut. Finally, you can find out more about Harp here.

Like my favorite app Journelly, Tushar decided to keep his data in Org Mode. That, of course, brings the immediate benefit of making the data viewable and editable in Emacs or any other editor for that matter. It’s one of the reasons I’m so fond of Journelly. A couple more apps like these and we could see Org markup evolve into a sort of universal app data storage language.

Right now, only an Android version of Harp exists but his near term plans include an iOS version. That good news for those of us in the Apple camp. The main difficulty appears to be navigating the Apple App Store submission maze, which is well known for its opaque rules.

Take a look at Tushar’s post for some more of his short term goals. It looks like a handy app—and, of course, one that keeps its data in Org mode—so it’s definitely worth trying out. I’ll probably give it a try when the iOS version appears and will let you know what I think of it then.

Posted in General | Tagged , | Leave a comment