HTML Preview For Org Mode

Randy Ridenour has an interesting post about previewing an Org file in your browser. If you’re like me your first thought is probably, “That’s easy. Just export the Org file to HTML and display it right from the Org export dispatcher.” I do exactly that to preview my blog posts. I simply type Ctrl+c Ctrl+e h o and my post appears in my browser. Of course, it doesn’t look exactly like the final product because it uses the default Org CSS instead of the WordPress theme that you see on the Irreal site.

And that’s exactly the point. Ridenour has his own opinion on how his markup should be formatted. Five years ago, I wrote about how to to add your own CSS formatting to an Org file when you export it to HTML but those methods all required adding some text to the Org file. Ridenour’s method does all that in a function that he can call to export his Org file to the browser. The process is pretty much the same as using the export dispatcher except that he gets to have his preferred CSS applied to the output.

The other advantage of his method is the he arranges for the automatic removal of the generated HTML file. The export dispatcher method requires that you delete the files manually. I do that periodically using Embark, which makes it easy but I still have to remember to do it. If you’re looking for a fast and easy way to preview an Org file in your browser, take a look at Ridenour’s post.

Posted in General | Tagged , | Leave a comment

🥩 Red Meat Friday: What’s Wrong With This Picture?

If you’ve been around Irreal at all, you know that I have little tolerance for stupidity on the part of the “suits”. My go to example is Boeing where an essentially ignorant group of finance based suits turned the world’s premier aircraft manufacturer into such a bad joke that knowledgeable people refuse to fly on their planes [1, 2, 3, 4, 5, 6, 7, 8].

There are those that believe that at least government is immune to this sort of craziness. It isn’t. The latest example is ICE deploying body cameras on its agents. That sounds like a good idea. After all, ICE agents have been accused of misconduct in the recent past and this is a good way of resolving the issue and exonerating responsible agents while identifying rouge agents. Most importantly it would serve to assure citizens that their government was behaving responsibly.

Time for the suits to weigh in. According the the AP, “ICE will release body camera video only when seen in the agency’s ‘best interests,’ policy says”. You don’t have to be a public policy expert to see the problem. Anyone with a modicum of intelligence will (correctly) conclude that any event where the video is withheld is one where there was misconduct. The result is that the suits have devised a way of automatically reporting when their agents misbehave; a useful mechanism to be sure but certainly not what they intended.

It’s not that this policy is at all unusual. Many, if not most, officials have a similar policy. The difference is that they have enough sense not the say the quiet part out loud. It makes you wonder how these people, who have so little management ability, get to be in charge. I’d tell you but Irreal doesn’t do politics.

Posted in General | Tagged | Leave a comment

Setup For The Casual Suite

Charles Choi has announced the release of Casual 3.0. There are now 26 modules in the Casual suite but this release is about providing an easier setup for the suite. Prior to this release, each module had to be set up separately. As Choi says, that made sense when there were just a few modules but it has become increasingly burdensome as the number of modules grew.

The new procedure is simply to call casual-init and all the module’s you want to use are initialized. The modules you’re using is determined by a set of hook functions that can configured with the Emacs Customize utility. You simple check off which modules you want to use and call casual-init. That’s all there is to it. You can learn more about this in the Casual User Manual.

If you’ve been following along on Choi’s blog—or to a lessor extent on Irreal—you know that there are a lot of different types of modules, not all of which you might want installed. The Customize interface is an easy way to specify which ones you want.

The latest version is available on MELPA and NonGNU ELPA. The nice thing about the modules is that they are all invoked with the same key sequence, Ctrl+o by default, so you don’t have to remember a bunch of different bindings. Once you invoke it, Casual brings up a Transient menu appropriate for the current major mode

Casual is a nice suite that make it easier to navigate Emacs applications that you don’t use often and for which you haven’t internalized all the bindings. Take a look at the user manual if you want to know more.

Posted in General | Tagged | Leave a comment

Switching To A Window In Another Frame

Álvaro Ramírez, author of Journelly and many other useful applications—a lot of them Emacs based—has a new post about a basic Emacs operation: changing focus to another window. Ramírez and I basically agree about things like this although he stubbornly refuses to admit the superiority of my method of indicating the window that has focus.

Now he has a slightly different problem. For technical reasons that you can read about in his post, he wants to be able to switch to a window in another frame. The other-window command, bound to Ctrl+x o by default, doesn’t consider windows in other frames but, of course, there’s a command for that: next-window-any-frame. That turned out to be exactly what Ramírez needed and he simply bound it to Meta+o, which is where he had other-window bound.

Like Ramírez, I seldom use more than one frame so I didn’t know about this command. If you often have more than one frame going, you may find it useful if you’re not already using it. If you’re an ace-window user, it will consider all frames by default but you can adjust this with aw-scope.

Posted in General | Tagged | Leave a comment

Emacs 31.1 RC1

Great news! Sean Whitton writes to announce the release of Emacs 31.1 RC1. This is the final step before the formal release of the Emacs 31 series. Whitton remarks that the developers are hoping that RC1 will be the only release candidate. I take that as a measure of their confidence in this trial release. Unless any breaking problems pop up, we can expect the official release of 31.1 imminently.

As always, we should offer up a word of thanks for the hard work of the maintainers and all the developers who have toiled so hard to bring us this latest release. If we find ourselves in the same bar as one of them, the drinks are on us.

Posted in General | Tagged | Leave a comment

Going Dark For Real This Time

Most Irreal readers interested in security and privacy are familiar with Matthew Green, a cryptographer at Johns Hopkins University. He’s got a new post up that is terrifying to those of us who want to keep our private things private.

The TL;DR is that recent gains in the AI mediated search for exploits is going to have terrible consequences. The problem is not that criminals will be able to romp through our systems; the defenders are also using those AIs to locate and patch vulnerabilities in their software. Soon, Green says, there will be virtually no usable remote exploits left. That sounds good, so what’s the problem?

The problem according to Green is that law enforcement, which this time is facing a real going dark danger, will renew their demands for a backdoor into all encrypted communications. They’ve tried that before, of course, but there was always some surveillance company that had a handy exploit that allowed them to get their information without a backdoor. That demoted their desire for a backdoor to a “nice to have” instead of a critical necessity.

Nobody reading this needs an explanation for why a backdoor is a terrible idea that will make us less safe while hardly giving the bad guys pause. A nice, less technical, example is if the police demanded that they be given a master key that would open any of our doors so that they could come in at will and look around for evidence of wrongdoing. Sure, it would make crime fighting easier in some cases but who would agree to that? No one is who.

Nonetheless, we can be certain that law enforcement will renew their demands with lots of talk about children, drugs, and terrorism as usual. We’ve heard it all before. The only difference is that this time the FBI won’t be lying about going dark.

Be sure to take a look at Green’s post for more details from an expert who studies these issues for a living.

Posted in General | Tagged , | Leave a comment

Emacs Backups

Raymond Zeitler over at Ray on Emacs doesn’t use version control for his “non-public” files so when he had a problem with his .emacs file, he didn’t have any backups except for the single last version of a file that Emacs will make automatically if you have backups enabled. That, apparently, was enough to recover but Zeitler resolved to do better.

What he did was to replace .emacs~ with .emacs.~1~, which causes Emacs to create a numbered sequence of backups rather than simply overwriting the last one. Reading his post reminded me of my backup scheme, which I haven’t thought about in years because all my files—except autogenerated ones—go into Git.

My backup scheme is a little different from Zeitler’s because I’ve set mine to keep only the last two backups. That way, my file system doesn’t fill up with long forgotten and unneeded backups. Even so, there were a lot of backups—some for files that don’t even exist anymore—taking up a lot of space. I deleted them all and started over.

I don’t claim that 2 is the right number for everyone or even for me. It just seemed like a safe number in case something happened with Git. Happily, I’ve never had to use the backups, which is why I’d mostly forgotten about them.

One thing for sure, you need to be religious about either saving your files to a version control system or configuring the Emacs backup system to automatically save some number of backups for you.

Posted in General | Tagged | Leave a comment

Emacs Users

Chris Maiorana has a lovely blog post in which he makes the case that Emacs users are a different breed. He starts with the quotidian observation that you can be pretty sure that a Vim or VSCode user is either a software developer or in a closely related such field such as System Administration or DevOps. Emacs users, on the other hand, could come from almost anywhere.

This is a point that Irreal is fond of making. I’m fascinated by people from outside the software field who use Emacs as an essential part of their workflow. Their stories always illustrate the power and flexibility of Emacs to solve problems even if they aren’t about software and engineering.

What distinguishes Emacs users, Maiorana claims, is their love of tinkering and the blurring of work and play when they’re using Emacs. As he puts it

Emacs could be more than a text editor. It could be an organizer, a scratchpad, a dictionary, a canvas, a database, a calendar, an email client, and much more. What should have been work started to feel like fun.

Maiorana says that Emacs users don’t care primarily about the usefulness or user friendliness of Emacs; it’s the opportunity for tinkering that attracts them. I think he has this part backwards. Emacs users surely do love to tinker but the attractive thing about Emacs is that your tinkering can turn it into the exact tool that you need. That’s true even if the tool you need has nothing to do with software or its siblings.

Emacs is, in fact, the perfect piece of software. Not only does it indulge our urge to tinker and have fun but also allows us to turn that tinkering into the precise tool we need. Not just once but as often as we desire as our needs change. With Emacs, the fun never ends.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: The Perils Of Rewriting

The Emacs Cat, of whom I’ve written many times, has a post on a broken change in Ubuntu that affected Emacs. The TL;DR is that the Cat upgraded to Ubuntu 26.4 but when he tried to use Emacs he discovered a problem with Dired. At first he thought the problem was with Emacs 30.2, which is the default Emacs with that version of Ubuntu. But the actual problem turned out to be with Ubuntu’s implementation of ls. The Cat solved his problem by using the “old” version of ls from GNU coreutils. Ubuntu had decided that it was a good idea to rewrite the core Unix utilities—such as ls​—in Rust.

Maybe I’m just old and grumpy but this seems to me to be a terrible idea. Utilities like ls have been around and working more or less flawlessly for close to 50 years. What, really, was the reasoning behind the decision to rewrite ls? Twenty six years ago, Joe Spolsky answered that question and explained why the rewriting is almost always a bad idea.

It may have been written a quarter of century ago but Spolsky’s explanation remains true. There really is no reason—other than fashion—to rewrite core utilities that have been working perfectly well for longer than many of us have been alive. When you do, you can expect exactly the sort of problem that the Cat stumbled on.

The problem with the new ls was very specific involving an obscure parameter but it reached out to disable a major Emacs functionality and probably affected other applications as well. The annoying thing is that there really wasn’t any reason for this to happen: just someone who decided it would be a good idea to rewrite an application that was working fine.

Posted in General | Tagged , | Leave a comment

Some Thursday Humor

I don’t see anything in my feed worth writing about so I offer this bit of humor to help you get through the day. If you’ve ever wondered why an S-expressions is called an sexp, here’s your answer.

Like all humor, there’s a bit of truth here. Not the part about sexp, of course, but the notion that many of us come to Emacs for some particular feature, venture too close to the init.el event horizon, and never escape.

Posted in General | Tagged , | Leave a comment