EXWM and Keyboard Macros

Being a Mac user, I don’t get to play but I’ve always loved the idea of EXWM, probably because it moves Emacs closer to recapitulating the Lisp Machine. Other than making all windows Emacs windows, I never thought too much about the power it unlocks but Tory Anderson shows a brilliant workflow that EXWM enables.

You can almost do this without EXWM but the browser keystrokes won’t be captured by the keyboard macro. Really, this is just the familiar Emacs workflow involving keyboard macros across multiple windows. What EXWM brings is the ability to treat the nominally non-Emacs browser window as just another Emacs window.

While Anderson doesn’t completely describe the task he’s trying to complete, I suppose those of us without access to EXWM might be able to do the same thing with eww instead of Firefox but I haven’t tried it. Regardless, it’s a cute trick and a win for EXWM.

Posted in General | Tagged | Leave a comment

Annotations in Emacs

Bhaskar Chowdhury has an informative video on the annotation package for Emacs. The idea is that often you’d like to add notes to a file without corrupting the file itself. For example, you might want to add explanatory notes to some source code but you obviously can’t just spew arbitrary text into the code. Even comments don’t necessarily work because it might not be your code and maybe you don’t even have write access to it.

The annotate package is the answer to this conundrum. You can make notes and they appear in the file but the actual text is kept in another file. It works pretty much the way you think it would: the annotation file has the annotations along with the file and line to which they apply.

Chowdhury’s video demonstrates the main functions that let you add, delete, search for, and list annotations. It’s a good introduction to the package. If you think you might have a need for something like this, you should definitely spend a few minutes with the video. It’s less than 6 minutes long so it’s a small investment in time.

The annotation package is not built in so you have to load it from Melpa but that’s simply enough even if you just want to try it out.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Infix in Lisp

For all you Lisp n00bs who really, really hate Lisp’s prefix notation, I have some good news: there’s a weird trick that allows you to use infix notation. Works in Elisp too!

It makes me want to stick a pencil in my eye but is, I have to admit, pretty funny.

Posted in General | Tagged , | Leave a comment

Journalists and the Origin of COVID-19

Sorry Irreal readers but I’m about to embark on another rant about journalists and the origin of COVID-19 story. At first, it was a matter of curiosity. I read the reports of what the “experts” were saying and alarms went off. It’s not that a zoonotic explanation was outrageous or even unlikely. It’s that the zoonotic explanation was presented as the only reasonable answer: anything else was unequivocally dismissed as a conspiracy theory. But the real tell was when they declared that asking questions about the cause was racist. That’s when you have to ask yourself why the experts are trying so hard to shut down any inquiry.

The pretext of protecting people from dangerous misinformation that they used to excuse their other lies about COVID-19 obviously didn’t apply because, after all, how was the origin of the pandemic going effect people’s health decisions one way or the other. A reason for the panicked lying is not hard to find. As Jamie Metzl said

“If the pandemic started as part of a lab leak, it had the potential to do to virology what Three Mile Island and Chernobyl did to nuclear science.”

These people were protecting their rice bowls. All the talk about lying may seem harsh but the lies—from Fauci on down—have been well documented and are no longer in doubt.

What brought about the current rant is this mashup from Matt Taibbi and Matt Orfalea. It’s 9 and a half minutes of journalists smugly pontificating on how the idea of a lab leak had been “debunked” and was a “conspiracy theory”. They mock everyone who disagrees as a yahoo, conspiracy theorist, and racist. At first it’s pretty funny but as it relentlessly drags on it becomes infuriating. It’s journalists, who are supposed to question and investigate official pronouncements, not only swallowing the government’s story whole but actively discouraging any questioning of it. Over and over they describe the lab leak theory as “debunked” despite that fact that it had never, in fact, been investigated.

These people deserve our contempt and should not, in any event, be listened to or relied on to deliver the news. If you want to know what’s going on in the world, I don’t know what to tell you but I do know that you should stop listening to these clowns: nothing they say should be believed.

Posted in General | Tagged , | Leave a comment

Why You Should Learn Lisp This Year

For those of you who still haven’t learned some sort of Lisp, Gavin Freeborn has a video pushing the idea you should learn at least one of the Lisps this year. If you already know Lisp, the video won’t tell you anything new but if you’re looking for an overview or some motivation it may help.

The two things that n00bs find off-putting are the prefix notation and the parentheses. Lispers, of course, quickly stop seeing the parentheses and take the view that they’re essentially acting as the front end of the compiler and that this is what enables Lisp’s very simple—some say lack of—syntax.

I’ve reached the point where I get grumpy if I have to write in infix and even C code—let alone some of the newer languages—looks ugly to me. Even if I’m a far gone case, there’s a lot to be said for learning a Lisp. It literally changed my life and the way I think about programming. You should really give it a try.

The video is 21 minutes, 49 seconds so it should be easy to fit in.

Posted in General | Tagged | Leave a comment

Early Unix at Bell Labs

At the 2022 Linux Conference Australia, Brian Kernighan gave a delightful talk on the early days of Unix at Bell Labs. It’s not so much that Kernighan tells us stories that we haven’t heard before but that he puts everything in context and explains how the unlikely miracle of Unix came about.

At the end of the talk, Kernighan speculates on whether Unix or a similar groundbreaking project could be undertaken today. There are certainly smart guys with good taste like Ritchie and Thompson around now and the open source infrastructure, whose predecessor had a lot to do with Unix’s success, is already in place. What’s missing, he says, is something like Bell Labs.

As Kernighan says, the Labs were basically a tax on telephone service so they had stable funding. More importantly, management took the long view and encouraged the researchers to work on whatever interested them. Industry can’t do that because they are too focused on the short term. AT&T was a monopoly with essentially a guaranteed income so they were relieved from worrying about quarterly results. Academia can’t do it either because they don’t have the funding.

It’s a nice video and well worth watching. Kernighan is an excellent speaker and always enjoyable and informative. The video is 48 minutes, 46 seconds so plan accordingly.

Posted in General | Tagged , | Leave a comment

Switching to Android

You all know that I’m primarily an Apple person and that I like their hardware and the way their various devices work together more or less seamlessly. Even so, I’m not a Fan Boy and as in most things I’m very much a different strokes for different folks kind of guy.

If you want to use an Android phone, I fine with that. I might be puzzled but it’s not, after all, a moral decision and your choice of phone is your business not mine. Still, every once in while I come across an article on the iPhone/Android wars so stupid that I can’t let it pass.

Such is the case with the Lifehacker article Why You Should Just Switch to Android Already. Jake Peterson starts out with a litany of all the problems you’ll encounter when you switch from an iPhone to an Android phone but then says. So what? Be free! Get that cool Android phone. Of course you’ll have to try to convince all your friends to switch to some third party text messaging app. He recommends WhatsApp or Facebook Messenger, two apps by a company not even your Aunt Millie would be naive enough to have anything to do with.

The whole article is like that. Reason after reason that changing will be hard but not a single reason—other than the apocryphal “cool” Android phone—for switching. I seriously considered that it might be a satirical piece.

Of course, there’s not going to be a tsunami of iPhone users switching to Android. Why is that? There are two main reasons I think. First, I believe Apple makes better hardware—more expensive, but better. That is, I suppose arguable and some very smart people do dispute it but at least iPhones don’t explode or fall apart after a couple of days. I believe their software is better too but that’s even more subjective.

The better reason—and one that’s inarguable—is that the iPhone is safer and better respects your privacy. One of the big complaints about iOS is that it doesn’t allow side loading but that’s a big part of what makes the iPhone safer. Yes, you can’t download any old app you want, and yes, malware does get into Apple’s App Store but Apple’s policies make using their phone much safer.

As for privacy, there’s no controversy at all. Google/Android vacuum up all your data for use with Google’s advertising business. Apple doesn’t. Maybe you don’t care about that but many of us do and for that reason alone wouldn’t consider using an Android phone.

Even so, if you want that cool Android phone, don’t let Irreal stop you. Neither I nor the minions will think less of you.

Posted in Blogging | Tagged , | Leave a comment

Crosswords with Emacs

As I’ve mentioned before, I enjoy solving crossword puzzles. Happily, you needn’t subscribe to a newspaper to get your daily fix. There are several apps available on just about every platform that provide you with as many of the puzzles as you could wish. Although those apps are available on my Macs, I don’t have one installed because I always use my iPad or, in a pinch, my iPhone for the puzzles.

Still, that’s just me. It’s entirely reasonable that others would prefer to solve their crosswords on their lap- or desktops. If you’re one of those people and you’ve further achieved the enlightenment that everything possible should be done from within Emacs, I have good news: there’s an Emacs package for that. It’s available on Melpa so it’s easy to install if you want to try it out.

As I say, I don’t use a Mac for indulging my Crossword habit so I haven’t tried it out but it seems nice enough from the documentation. If I ever decide to move my Crossword habit to my laptop, I’ll certainly give it a try. If you’re into Crosswords and Emacs, this seems like a nice solution.

If you’ve tried it, let us know what you think.

Posted in General | Tagged | Leave a comment

Nerd Talk: Kernighan & McIlroy

Everyone with even a tenuous connection to our field knows who Ken Thompson and Dennis Ritchie are. They probably also know who Brian Kernighan is but unless they’re fully immersed in Bell Labs lore they probably don’t know about Doug McIlroy except maybe for hearing his name as “one of the gang”.

That’s too bad because as anyone who was there will tell you, McIlroy, in addition to be the manager of the Computing Techniques Research Department—the birthplace of Unix—was also one its leading lights. It was McIloy, for instance, who conceived of the idea of pipes and insisted on their implementation.

Kernighan and McIlroy have a delightful video in which they discuss some of the Unix lore including the invention of pipes. They discuss a lot of interesting technical details, including the history of many of the Unix utilities such as Diff.

To me, though, the most interesting aspect of the video was the discussion of how Bell Labs worked. Although on paper they were hierarchically organized, it didn’t actually run that way. There were no junior engineers, senior engineers, or distinguished engineers there were only members of the technical staff. As for compensation, that was entirely based on contributions not rank. Ken Thompson, for example, for paid more than McIlroy, his boss. That meant that those interested in remaining individual contributors could do so and still progress in their careers.

Because, unlike academia, there was no notion of tenure, the researchers felt free to suspend whatever they were doing to help a colleague solve some problem. This synergy was responsible for a lot of the Lab’s discoveries.

If you have any interest in Unix lore this video is definitely worth your time. It’s just over 52 and a half minutes so plan accordingly.

Posted in General | Tagged , | Leave a comment

Red Meat Friday: Emacs Discoverability

Here’s nice coda to yesterday’s post on Mickey’s essay on bad Emacs advice.

As with all great humor, this is hilarious precisely because of the truth it’s based on.

Posted in General | Tagged , , | Leave a comment