No Post Today

Sorry, no post today. Life, as they say, has intervened. Not to worry, though. Everything is fine and the usual blathering will continue tomorrow.

Posted in Blogging | Tagged | Leave a comment

How Punchagan Lost His Elfeed Database

A couple of weeks ago, I wrote about how Punchagan over at NOETIC NOUGHT started saving his Elfeed database after he lost it in a system crash. At the time, Punchagan didn’t know exactly what happened, only that the system crashed and he lost his Elfeed database. He wasn’t even sure that the two events were related, only that they occurred at the same time. His solution to the problem was to set up periodic saving of his Elfeed data to git.

A little later he had some time to troubleshoot the problem and discovered what happened. The Elfeed database is basically a hash table and saving it is simply a matter of dumping the binary to a file. This happens inside a with-temp-file macro, which is much like the more familiar with-temp-buffer macro except that it saves the results to a file at the end. The saving is done with write-region, which first truncates any existing file.

What happened, apparently, is that the system crashed between the truncation of the old file and writing the new file. Sadly there’s not much that can be done at the user level other than saving the file periodically.

I liked this post because it shows how easy it is to simply follow the code—which is, of course, available whenever you’re running Emacs—to see what’s happening. Emacs, to be sure, has more sophisticated tools for debugging but often simply looking at the code will reveal what’s going on. Punchagan’s post reminds me of Sacha Chua’s post on figuring out how to edit an SVG file and its source at the same time. She figured out how to do this the same way as Punchagan solved his problem: by reading the source code to see where the undesirable behavior was happening.

Posted in General | Tagged , | Leave a comment

Exporting From Org To Docx

JR over at The Art Of Not Asking Why has a useful post on exporting an Org document to Docx. I’ve written about this before [1, 2, 3] and you might wonder why. After all, you can simply export directly from Org to ODT and get a Word compatible document.

The problem occurs when you’re working in an environment that requires a specific style implemented with a Word style sheet. The native Org exporter doesn’t support this so the usual solution is to use Pandoc, which does support a Word style sheet.

JTR’s post has a step-by-step recipe for making the conversion and setting up a Word style sheet using a reference document with the desired settings. He even covers the difficult areas of images and tables, which, of course, require further machinations.

None of this would be necessary if Word and its siblings would use plain text instead of an arcane, opaque file structure to store the document. After all, it’s certainly possible as Org—or, if you require even more complicated output, TeX/LaTeX—show. But, of course, that would stand in the way of editor lock in.

Regardless, if you have to produce Word documents but prefer to write in Org, take a look at JTR’s post. He shows you how to produce a good looking Word document from an easy to write Org file. He even shows how to automate the process using Álvaro Ramírez’s dwim-shell-command.

Posted in General | Tagged , | Leave a comment

Goodhart’s Law

Michał Poczwardowski has a nice post on Goodhart’s Law. The law is usually expressed as “When a measure becomes a target, it ceases to be a good measure.” That may seem a little abstract but its application is familiar to all of us.

My favorite example is rewarding schools or teachers for how well their students do on standardized tests. It seems like an obvious win: reward the schools and teachers who produce successful students. The problem is that that characterization is missing the part at the end that says, “as measured by standardized tests”. Of course, what actually happened is that teachers—either on their own or under direction from the school administration—started to “teach to the test”. Students didn’t actually learn more or become better students, they just became better at taking the tests. The reason I say this is my favorite example is because long ago I thought it was a great idea. Reward the good teachers and maybe even cull the bad ones. Sadly, it didn’t work out that way. Only the producers of standardized tests liked the results.

Another example is the infamous cobra effect, which, while it may be apocryphal, perfectly captures the idea. A seemingly reasonable measure for a desired result is incentivised and people find a way to maximize the measure instead of the desired goal. Very often, as with the Cobra effect, this makes the original goal worse.

Just as Goodhart says, as soon as the measure becomes the goal, people pursue it whether or not it actually helps achieve the desired result. Poczwardowski has some other modern day examples, including his own attempt to encourage engineer recruitment.

I know I’ve written about this before but it’s a lesson we forget at our peril. Take a look at Poczwardowski’s post. It’s a short and interesting read.

Posted in General | Tagged | Leave a comment

Revisiting The 500 Mile Email

Someone reposted Trey Harris’ famous story about the 500 mile email. The TL;DR is that Harris, working as a university system administrator, received a call from the Statistics Department claiming that they couldn’t send an email further than about 500 miles. If you know anything at all about how email works, your reaction would be the same as Harris’: Yeah right.

Oddly, though, it turned out to be true. It was the Statistics Department, after all, and they had all sorts of data supporting the claim. Harris ran his own tests and discovered to his astonishment that it was true. Email to a site closer than 500 miles worked fine. Those to sites further away than a little over 500 miles invariably failed.

I’ve written about this at least a couple of times before but it’s such a good story that it’s worth repeating now and then for people who haven’t heard it. The solution makes perfect sense once you know what it is but until you do it’s seems like an impossibility.

Take a look at Harris’ original post for the answer and for the amusing story. You may even learn a new way of thinking about network problems. Sometimes you need to look under the layer where the problems seems to exist to discover what’s actually going on.

Posted in General | Tagged | Leave a comment

Extracting Data From Journelly Entries

As you all know, I am always writing about how much I like and use Journelly. One of the things that I always say is that since Journelly saves it data as an Org mode file—or, if you prefer, as a Markdown file—the file is essentially a database that can be queried and processed to produce other files.

Álvaro Ramírez has a very interesting post that describes one such workflow. Much like I might do, Ramírez adds an entry in his Journelly when he comes across some data about a movie he might want to watch. It may be an IMDB entry, a Reddit post, or even just something someone told him so that all he has is the movie or director name. The common denominator is that he adds a tag such as #film or #watch to mark those entries having to do with movies he should watch. Journelly can, of course, search on the tags but Ramírez has a better way.

First he extracts all the entries having an appropriate tag into a watchlist.org file. That gives him a file with all the movies he might want to watch. He uses this and the Claude Code agent to look up each entry in IMDB and to retrieve all the metadata for each movie from IMDB and put it in a db.org file. Finally, he uses the db.org file to generate HTML so that he has a browsable file showing each movie along with its poster.

Take a look at his post for the details and to see the final results. As Ramírez says,

At the center of all it all my beloved org syntax. Thanks to plain text formats, we can easily peek at them, query them, poke at them, tweak them, and bend til our heart’s content. It’s just so versatile and now we can throw them at LLMs, too.

Almost none of this is something you’d expect a text editor to do but the Combination of Emacs and Journelly provides a way of moving from free form capture entries to a polished, browsable file.

Posted in General | Tagged , , | Leave a comment

Return Of The Prodigal Son

Well, not really prodigal, but the return—nonetheless—of a son assumed lost. Michał Sapka has a blog post about his return to Emacs. A while ago, Sapka left Emacs for Vim and the shell. He liked them but realized that Emacs really is different.

The way it’s different is telling. Although you can do anything in Vim and shell, Emacs is different. As Sapka puts it,

It’s not that nothing stops you from connecting Mastodon.el, Magit and Mu4e, it’s that it’s natural.

Because all of Emacs is exposed to the user, it’s easy to modify it to fit your workflow and string together disparate applications in ways that their authors never intended. Sapka makes the same point that Irreal and others have made: it’s not that Emacs has an extension language, it’s that Emacs’ source code is modifiable on the fly from within the application itself at run time. It’s a whole different thing.

Sapka admits that there are problems but says that they are solvable. Depending on your work environment, solving them may be more or less difficult but they remain solvable.

In any event, Sapka has returned to Emacs because, in the end, nothing else provides the same power and flexibility. He ends his post by noting that he’s—sort of—combined the power of Emacs and Vim by adopting Evil mode.

Posted in General | Tagged | Leave a comment

Kitty Cards

Álvaro Ramírez and Vaarnan Drolia have introduced a really interesting app. At least I guess you would call it an app. It’s actually just a Web page that lets you build your own custom Apple Wallet cards. It’s easy to use. You simply bring up the Web page, click on and fill in the fields you need on the sample card—including scanning for a bar code—and click on the “Add to Apple Wallet” button.

If you’re an Apple Wallet user, you may like this app. You can take any physical card with a bar code and add it to your Apple Wallet. Then you have one less card to carry around.

Posted in General | Tagged | Leave a comment

Gruber On File Saving Ease

John Gruber, over at Daring Fireball has a post, Untitled Document Syndrome, that makes two points of interest to Irreal readers. The first involves the difficulty of initially saving what he calls “untitled documents”. He’s writing about macOS, of course, but even through I’ve used one Mac or another for almost two decades, I had a hard time figuring out what he was talking about. I guess it’s this: in some Apple text apps you can start typing without specifying a document name or a file path for where it should be saved. That means that when you first save the file you have to negotiate the file save dialog to supply this information.

Since I write everything in Emacs, this never happens to me. Part of starting a new file is executing a find-file which specifies its name and file system location. Even then, I just specify it in the minibuffer; there’s no annoying open dialog to deal with. The first time I save it is like any other time1: a simple Ctrl+x Ctrl+s.

The point of all this is that the difficulty of the initial save means that people will put it off and therefore suffer disaster when the app or system crashes. They may even lose hours of work. Happily, that first save is easy in Emacs so there’s no reason—not even a weak one like the save dialog—for putting it off.

Even if you do put it off, Emacs, like Gruber’s editor BBEdit, has you covered. It does periodic automatic backups so you never lose more than a little work.

The second point is related and concerns note taking apps. Like most of us—at least us oldtimers—Gruber stated taking notes by creating a file for each one with his editor. As we’ve all discovered, that doesn’t work all that well so he moved to Yojimbo and discovered that he was taking many more notes. As you all know, I solved the same problem with Journelly. I use it as my memo book and typically make about 10 entries per day. People think of Journelly as integrated with Emacs but it can also save its data in Markdown so it’s perfectly usable on any system and editor as long as you’re using an iPhone.

It’s amusing how 40 year old technology is still more convenient and easier to use than “modern” systems with dialog boxes for everything.

Footnotes:

1

Yes, one can just open a buffer, set the appropriate mode and start writing. When it comes time to save it, you do have specify a name and location but, of course, no one works this way.

Posted in General | Tagged , | Leave a comment

Starting A Journal

A couple of weeks ago I read a lovely story in The New Yorker by Calvin Tompkins about starting a journal in his hundredth year. Tompkins was born the same year that The New Yorker was founded and, ironically, spent most of his working life writing for the magazine. Last year—his hundredth—he surprised himself by deciding to start a journal as a sort of countdown to his hundredth birthday. The story is mostly entries from the journal but I found them fascinating. Perhaps you will too. If nothing else, you’ll get a first hand glimpse of what old age really looks like. The TL;DR is that there’s good news and bad news.

In any event—although I am nowhere near my hundredth year—I was inspired to start my own journal. Of course, it was going to be written with Emacs but the question is how. There is the builtin journal app as well as some third party packages but I chose simplicity. I didn’t need anything special or complex with arcane functions so I just added an Org capture template to create a file+datetree file in Org mode. Here’s the whole thing:

("J" "Personal Journal" entry (file+datetree "~/org/personal-journal.org")
         "* %<%R: >%? \n%t" :empty-lines-before 1)

I have some startup options in the file itself to set visual-line-mode, use a variable pitch mode, and couple of other things: the same setup that I use for my blog posts. All this is simple and familiar. There’s nothing new for me to learn since it’s basically the same setup that I use everyday to write my Irreal posts.

The takeaway is that if you’d like to start a journal, it’s really easy. Just use a simple Org file with a corresponding capture template.

Posted in General | Tagged , | Leave a comment