Letters With Org-mod

If you’re like me and want to do all your writing from within Org-mode, one problem you need to solve is how to write letters—especially professional letters. I use a LaTeX template and write the letter in LaTeX but mostly it’s just text so it’s pretty easy. Still, it would be nice to move all that to Org so that I could just use, say, a Yasnippet to include the LaTeX boiler plate and then write in the comfortable Org environment.

Ravi Sagar has a short video on how he’s solved this problem. One of the problems he needed to solve was how to produce a letterhead. That turns out to be pretty easy once you have the letterhead graphic. He has all his LaTeX boilerplate in a separate file and just includes it in the individual letters. It works well and is pretty easy.

If you’d like to move even your formal letters to Org-mode, take a look at Sagar’s video to see how to set it up. It’s worth doing this if only to free yourself from the tyranny of Word and its ugly siblings. As this week’s Red Meat Friday hinted, you’d do well to avoid hitching yourself to the Microsoft wagon.

Posted in General | Tagged , | Leave a comment

Yasnippet for Prose Writing

When you think about it, the title of this post doesn’t appear to make sense. Yasnippet is a template system for adding customized boiler plate to an Emacs buffer. It’s raison d’être is to enable shortcuts for various programming constructs such as the C for loop.

Still, it’s a flexible system so it finds all sorts of uses. If you’re writing in LaTeX, it can help with things like the environment boilerplate. Similarly, it’s great for things like blog headers.

Erik L. Arneson has a post that describes how he uses Yasnippet for his writing. After explaining how to install Yasnippet, Arneson describes his uses. That turns out to be mostly things like blog headers and Org headers for certain other structured files. You can read his post for the details.

My personal use is almost entirely things like that. I never think to use it when I’m programming even though I do have the appropriate snippets loaded so the snippets I use are mostly for prose and various record keeping applications where the snippet provides a sort of form that I can easily fill out by tabbing through the fields.

The takeaway is that technology like Yasnippet doesn’t have a lot of application for writing prose except for headers and other boilerplate and perhaps for markup if you’re using something like LaTeX. Still, even those seemingly minimal applications can save a lot of time.

Posted in General | Tagged | Leave a comment

Red Meat Friday: VS Code As A Venus Flytrap

The hackers and programmers that I grew up with knew all about Microsoft and realized that they were relentlessly predatory. Lately Microsoft has been trying to project a kinder, gentler image but developers from my cohort who have not yet succumbed to dementia are not deceived. We still view anything the company does with suspicion.

Which brings us to the new hotness: VS Code. The gullible are flocking to it blinded by the bling and LSP integration. What could go wrong? It’s open source, you know. Except it isn’t really. The core software is open source but the parts that give the editor its value are all firmly under Microsoft’s control.

Geoffrey Huntley has a post that posits all is going according to Microsoft’s plan. VS Code, he says, is designed specifically to fracture the developer community and bring us all into the fold of software as a service development tools. VS Code is Microsoft’s one ring to bind them all. It’s a strategy that worked remarkably well in the business sphere with Word, Excel, and Exchange so why not go after developers too?

Irreal has always taken the position that editors are a personal matter and you should use whichever editor best meets your needs but it also pays to know what you’re getting into. Even if VS Code’s pervasive gathering of telemetry doesn’t bother you, you should beware of landing on that sweet smelling flower lest the leaves snap closed around you.

Posted in General | Tagged | Leave a comment

Video On The Birth of Emacs

I just ran across a video on the birth of Emacs from last year. It’s by Lars Brinkhoff, Irreal’s go to guy for questions on the history of Emacs. As I’ve written before, he maintains a repository of historical Emacs code all the way back to TECO.

The video is a series of demonstrations of some of that ancient code. It starts with showing what a pain it was to use TECO. It did, however, have a macro language that was fairly capable and Emacs famously began life as a set of macros for TECO. It’s where the name Emacs comes from: Editing MACroS. It was a sort of compilation of the TECO macros that individual users at MIT’s AI labs had written. The idea was that then everyone would be working in the same environment.

Since Emacs was originally written as TECO macros, it wasn’t very portable so it was rewritten in various languages such as LISP and C. The video gives a demonstration of some of those old systems. If nothing else, watching them will show you how good we have it now.

Now, of course, Emacs is synonymous with GNU Emacs, which is available on essentially any platform that matters. Brinkhoff tells a nice story. What began as a way of letting hackers share someone else’s TECO session has blossomed into what many of us consider the world’s best editor. Not everyone agrees with that last assessment but none but the ignorant doubt that it’s certainly a contender.

The video is about 41 and a half minutes long so you’ll need to schedule some time. If you’re interested in old Emacs implementations and how things used to be, take a look at the video.

Posted in General | Tagged | Leave a comment

Emacs As A Bash IDE

Torstein Johansen has an interesting video on using Emacs as an IDE for shell programming—especially Bash shell programming. We, or at least I, don’t usually think of shell programming as requiring an IDE but as Johansen shows, a bit of Emacs configuration can significantly ease the task.

He starts off with sh-mode and shows how to adjust the indentation. That gives you syntax highlighting and automatic indentation. Add autocompletion (with Hippie Expand) to help with entering code and navigation (mostly with Projectile) to make finding functions—even if they’re in a different file—easy and you’ve got a good basic Emacs setup for working on shell files but Johansen doesn’t stop there.

He adds LSP and flycheck-mode for advanced navigation and code linting. He shows how to run your script right from Emacs and even how to output an execution trace. He also shows how to run unit tests and perform debugging. Those require adding separate packages and binaries, of course, but if you do a lot of shell programming it’s well worth the effort and space on your system.

Finally, he covers some of the yasnippets that he uses and gives a quick demonstration of git-change-markers. Neither is particular to shell scripts, of course, but they can be useful.

Again, if you regularly work with shell scripts, this video is worth your time. It’s about 18 and a quarter minutes so plan accordingly.

WEATHER UPDATE [2022-09-28 Wed 14:03]: Ian came ashore near Ft. Myers (about 100 miles south of Tampa). Lots of flooding there but things in Tampa are still calm except for moderate, continuous rain. We’re still expecting strong winds and lots more rain as Ian moves up the peninsula.

Posted in General | Tagged | Leave a comment

Hurricane Warning

Just a heads up for those of you who don’t live around the Gulf of Mexico. Hurricane Ian is heading up the west coast of the Florida peninsula and will pass just offshore of Tampa. The Irreal bunker is not on the coast and is not in a flood zone but it’s likely that we’ll get lots of rain and winds and that we’ll lose power, possibly for a few days.

If Irreal disappears for a day or two, don’t worry. We’ll be back when the power is. See you on the other side.

UPDATE while publishing [2022-09-27 Tue 14:36]

The current predicted path of Ian has it coming onshore a bit South of Tampa so we may miss some storm surge but we’re still expecting plenty of wind, rain, and power loss.

Posted in Blogging | Leave a comment

The rs Command

Dr Drang over at And now it’s all this has an interesting post on the Unix rs command and his use case for it. The “rs” stands for “reshape”. The idea is that given some data arranged in rows and columns, rs will change the number of rows—and therefore columns—resulting in a change of “shape” of the data. The command is a bit obscure. I’ve been using Unix since 1990 and don’t remember ever coming across it much less using it.

Still, as Dr. Drang shows, it can be really useful for reformatting data to better fit the space it lives in. Dr. Drang’s use case is to insert a long list of numerical data into an email. The list was long so he didn’t want to just paste it into the email because it would have made the email too long. Instead, he used rs to insert it as 14 rows of 6 columns, which made it fit nicely.

The command is actually quite flexible and has many options. Dr. Drang demonstrates a couple of them that he used to make the data look better. Read the post for the details.

It’s interesting that this command is still around. Oddly, it’s a macOS builtin, resulting, no doubt, from macOS’s BSD heritage. I can’t imagine it gets used all that much but when you need to change the shape of some data, it’s just the thing.

Posted in General | Tagged , | Leave a comment

Describe Symbol

A short post for a lazy Sunday. Grant Rettke over at Wisdom and Wonder has a quick tip. He recommends trying describe-symbol for invoking Emacs builtin documentation. He says that it’s almost always what you want when you invoke describe-function or describe-variable. As far as I can see, it’s the same information. I looked at the source code but it was hard to tell if it adds extra data or not.

You invoke it with Ctrl+h o so if nothing else you need remember only one shortcut for your documentation needs.

UPDATE [2022-09-25 Sun 16:31]: Grant remarks in the comments that one of the reasons he likes describe-symbol is because it tells you when there is a variable and function with the same name.

Posted in General | Tagged | Leave a comment

Extending Org Links and Youtube

Charanjit Singh has an interesting post on extending org-mode to handle youtube links. His goal was two-fold:

  1. Have an Org link type for Youtube videos that opened the video in mpv instead of the browwser
  2. When exporting to HTML the link should result in an embedded video rather than a link to Youtube

Most folks probably aren’t going to have those requirements, of course, but Singh’s post is still useful because it’s a great go-by for how to define and implement special links in Org-mode. The TL;DR is that you define a link type and two actions associated with it. The first action is what to do when the link is followed (Ctrl+c Ctrl+o). The second is how to export the link (Ctrl+c Ctrl+e).

In Singh’s case, the follow action is to display the video with mpv unless the follow is invoked with the universal argument in which case the browser is used. For export, Singh cares only about HTML for which the necessary markup for an embedded video is output.

The code is easy to follow so if you have a case for a special Org link, it’s worthwhile taking a look at Singh’s post to see how things are done.

Posted in General | Tagged , | Leave a comment

Border Authorities Seize and Store Phone Data for 15 Years

The US government has long maintained the fairy tale that the borders are somehow a civilrights-free zone and the Customs and Border Protection (CBP) agents can do whatever they like without having to worry that pesky 4th Amendment or other procedural safeguards. There’s no support for this idea in the constitution and as far as I can see the government made it up out of whole cloth. Sadly, the courts have acquiesced so that’s the world we live in.

Engadget has a disturbing article on how CPB agents can and do copy user data and store it in a database for 15 years. Once in the database, the data is available to DHS agents to rummage through without securing a warrant or even having to record their reasons for accessing the data.

As usual, Sen. Ron Wyden is on the case but, sadly, he is, also as usual, a lone voice. In a letter to the commissioner of CBP, Wyden lays out the type of data seized and the questionable legal basis for taking and storing it. He asks the commissioner to develop a plan for dealing with this problem and to let him know what it is no later than the end of October. I—and I’m sure Wyden—am not holding my breath.

Posted in General | Tagged | Leave a comment