Casual Info

Charles Choi is back with another of his “Casual” packages. This time it’s for what some of us consider the the dumpster fire that is Info1. His latest offering, Casual Info, provides a porcelain for Info that not only provides a menu for Info but also rationalizes some of the keystrokes.

As Choi says, most users probably expect Info to behave more or less like a Web browser, yet Info is almost perverse in its choice of UI. To be fair, the Info interface was fixed long before Web browsers were popular but almost everyone is going to find it disconcerting. That’s why Choi changed some of the bindings on his interface.

Alphapapa suggested that since Transient is now an Emacs builtin, Choi should offer his various Casual packages as part of vanilla Emacs. That makes a bit of sense. All of them help with the use of Emacs functionalities that have hard to remember bindings and would be a boon to not just n00bs but even more experienced folks like me who have trouble remembering seldom used bindings.

Choi seemed open to the suggestion. My opinion is that they’re a worthy addition but it doesn’t really matter. If you want them, they’re easily available from MELPA. Having them in core might, I suppose, aid discoverability. Regardless, I certainly wouldn’t object to their inclusion.

If you, too, find the Info interface maddening, take a look at Choi’s post for an alternative. Perhaps it will one day be built in but regardless MELPA is only a couple of keystrokes away.

Footnotes:

1

“Dumpster fire” is probably too harsh but it’s certainly fair to say that its user interface is less than optimal.

Posted in General | Tagged | Leave a comment

TABs or Spaces

No, I’m not going to relitigate one of our favorite holy wars. Really, I don’t care very much about the issue. Long ago, I arbitrarily settled on spaces but don’t have strong feelings one way or the other and would change in an instant if there were a good reason.

Still, lots of people do care and chansey97 over at the Emacs subreddit wants to know what people think. The main way you express your preference in Emacs is with the indent-tabs-mode variable. If it’s t TABs get used, otherwise only spaces are used. There are some finer adjustments possible but indent-tabs-mode is the important setting.

To my surprise, most of the respondents echoed my indifference. They basically said that they just want Emacs to do the right thing when they press the TAB key. That’s actually pretty reasonable because the major modes will do the right thing—or whatever you’ve configured—when you press TAB.

Happily, your choice doesn’t commit you to one or the other for every file. For example, I have an old file—dating from my Vim days—that has TAB delimited fields. At the top of that file I simply added

# -*- Mode: text; indent-tabs-mode: t -*-

and when I press TAB, an actual TAB character is inserted.

I don’t know what other editors do. I don’t even remember how Vim handles the situation. It’s enough to know that whatever your preference, Emacs has you covered.

Posted in General | Tagged | Leave a comment

A Flush-lines Example

I’m fond of telling stories about folks using Emacs to solve difficult—or at least complicated—problems but Emacs is probably used more often to solve simple, one-off problems. These problems typically don’t require anything fancier than, maybe, keyboard macros.

Mario Jason Braganza has a nice case in point. The TL;DR is that he made a bulk purchase of comics and wondered how many he got. The site that he bought them from had all the information about the purchase but it included much more than just the titles. Each bit of information was on a separate line and Braganza decided to count just the title lines to see how many comics he had.

So Braganza downloaded the information and pasted it into Emacs. He thought that if he could get rid of the extraneous lines, he could simply do a line count to calculate the total number of comics he had bought.

Experienced Emacers are jumping up and down yelling, “I know, I know”. The answer, of course, was flush-lines. You simply call flush-lines, give it a regular expression, and Emacs deletes any lines having a match for the regex. Braganza could, of course, have given it a complicated regex that got rid of all the unneeded lines at once but he chose the simpler—and probably more rational—method of eliminating one type of line at a time. In the end, he had only titles left and a simple line count gave him his answer.

This is, to be sure, a trivial example but it illustrates nicely one of the areas where Emacs shines: simple one-off tasks that would be tedious without the editing power of Emacs. Could you do this in some other editor? Maybe, but why should we care. It works in Emacs and that’s all we need to know.

Posted in General | Tagged | Leave a comment

Emacs As Crack

Jack Baty has a very amusing, but true, take on using Emacs and how resisting it is like resisting gravity: in the end you’re gonna lose. His story is that he hates futzing around with things, especially his Emacs configuration, so every once in a while he decides to find simpler apps to perform all the chores that he does in Emacs.

It never ends well. He starts out loving the new apps and not having to constantly tweak their configuration but he inevitably finds himself missing some of the custom tweaks that he made to Emacs. Then one day, he needs to work on an Org file, opens it in Emacs, and suddenly he’s right back where he started. He rediscovers all those customizations he made to Emacs that made his life so much easier.

It’s like the Borg: resistance is futile … , or perhaps like crack: once you start, you can’t stop. Of course, unlike the Borg and crack, Emacs is not evil—users of those other editors notwithstanding—but a real boon to our workflow. Still, there’s no denying that its use is addictive. Once you start you soon find yourself wondering how you can import this or that task into Emacs. Before long, having to leave Emacs is an imposition. Finally, like me, you find yourself installing emacs-everywhere so that even when you’re not in Emacs, you can be in Emacs.

So rather than the Borg or crack, Emacs is actually the editor for all seasons.

Posted in General | Tagged | Leave a comment

De-Googling: My Secret Weapons

Neeraj Adhikari has a nice post on one of my favorite crusades: banishing Google from my life. I’ve been pretty successful at this because of two thing: Emacs and macOS.

Most longtime readers know that the Irreal empire mostly runs on an Apple substrata. Even so, I’m not really a fanboy because, let’s face it, Apple can be annoying and their fanboys even more so. Still, I do think their hardware is usually best in class and their integration across devices exceeds what Linux/Android is able to do because they control the hardware as well as the software.

To see what this has to do with de-Googling, let’s take a look at Adhikari’s post. He lists several categories of services that he’s managed to find non-google alternatives for.

Email
You can read Adhikari’s post for his replacements but happily for me, Emacs and macOS have me covered. All my email flows through my Apple account. Apple’s not (at least not yet) interested in harvesting my information so they don’t bother scanning my email. Apple also doesn’t insist that I use their mail app. I read and send my email from Emacs with mu4e. And I can still read and send email with the mail app if I’m on my iPhone or iPad.
Photos
None of you, believe me, would be interested in seeing my photos so I’m not much concerned with efficient sharing. For the few that I do want to share, iCloud does the job nicely for my needs. The Apple Photos app takes care of curating my photos, syncing them across my devices, and backing them up to iCloud.
External Drive
Again, iCloud works well for me. It’s not expensive, reasonably reliable, and can be accessed from any of my devices as well as from a browser on any device. It’s probably not so good for collaborative work but that’s not a problem for me.
Calendar and Contacts
Again, Emacs and macOS are excellent alternatives. I use both Emacs and macOS for these functions and although it’s possible to sync between them, I don’t bother because I use them on disjoint data.
Phone
Let’s face it, if your Google-free life includes not using an Android phone, there is really only one alternative. Anything other than an iPhone or Android phone is simply a non-starter these days.
Maps
Although opinion varies, many informed folks say that Apple maps are as good or better than Google maps at this point. I haven’t bothered checking because I don’t care. I use Apple maps almost every day and have never had a problem with them. I use them in my car with Car play and on my Apple devices through the Maps app. I haven’t used Google maps in years.

That leaves Web search and videos. Web search is easy. I use Duck Duck Go and have for years. For a long time it was probably not as good as Google search but from everything I read, Google search has become a dumpster fire lately so Duck Duck Go is not only a good choice but arguably a better one.

Finally, the spoiler: Videos. YouTube continues to be the only realistic choice and is, in fact, the sole Google product used in the Irreal bunker.

So the takeaway is that if you want to live a Google-free life, macOS and Emacs are good places to start.

Posted in General | Tagged , , | Leave a comment

🥩 Red Meat Friday: Emacs Doesn’t Have Plugins

Note: I’m calling this a Red Meat Friday post because of the pushback I got the last time I broached the subject. It’s not really all that controversial.

Over at the Emacs subreddit TheTwelveYearOld asks what makes Emacs and Lisp so special when they’re used together. The answers are interesting but what struck me the most was the role that Elisp plays in Emacs. It’s not something that was tacked on later on: it’s what Emacs itself is built from.

Five years ago I was feeling grumpy and complained about the term “plugin” being used to describe Emacs extensions. I got a bit of pushback. Just because we Emacsers prefer “Package” or “Extension” doesn’t mean that “plugin” is a bad choice, they said. But it is. The word plugin, as commonly understood, refers to code that uses a predefined API provided by the host program that allows users to add limited functionality. Elisp is not at all like that. It’s not just the same language that Emacs itself is written in; the code you write lives in the same environment as the builtin Emacs code. It’s indistinguishable from the code the editor ships with. In fact, packages can be and sometimes are moved into Emacs core virtually unchanged.

Contrast this with other editors that allow you to write plugins in Lua, Javascript, or whatever. The code you write for them are plugins because they can do only what the API allows. You can’t change basic functionality or improve the algorithms the base editor provides.

At the end of the day, Emacs is—as I always say—a Lisp machine. Virtually everything in the system, except a bit of C code, is accessible to the user at run time. There’s no need to edit and recompile. You just change the running image on the fly. It doesn’t have plugins because it doesn’t need them.

Posted in General | Tagged , | Leave a comment

Emacs For PhD Students

Over at the Emacs subreddit, InstinctsInFlow says that he’s a PhD student in computer engineering who has been using Emacs for a couple of years because of its support for VHDL coding. He really likes Emacs and want to find better ways of using it so he asked for advice on using Emacs as a PhD student.

I found the answers in the comments to be particularly useful. InstinctsInFlow does his coding in Python so he was particularly interested in how to use Emacs with Python in an optimal manner. Everyone has an opinion on this, it seems, but the suggestions were all good.

The other thing that almost everyone mentioned was, of course, Org mode. If you’re a PhD student, you’re going to be doing a lot of writing. Writing that’s apt to include a bunch of mathematics and there are really only two choices1: Org mode or LaTeX. It’s certainly true that LaTeX gives you finer control but not much finer and in almost all cases Org is fine and it’s always easier.

There are some other good recommendations. If you’re interested in using Emacs for your PhD studies, take a look at the post. It’s short and has some good suggestions.

Footnotes:

1

Sorry, Word is a non-starter in the Irreal universe.

Posted in General | Tagged | Leave a comment

Casual Avy

I’ve written many, many times about how Avy is one of my favorite packages. Probably 90 per cent of my Emacs navigation is done with Avy. As I’ve said before, you can think of Avy as a generalization Steve Yegge’s recommendation to use search for navigation. Yegge’s idea revolutionized the way I navigate around a buffer and Avy refines that idea and makes it even more useful. As I’ve also said before, if you aren’t using Avy, you’re working too hard.

Now Charles Choi has stepped up to make it even better with Casual Avy. Like his other Casual packages, Casual Avy provides a transient menu to the functions that Avy provides. That’s important because Avy provides too many of them to remember.

Until Casual Avy, most of us solved that problem by restricting our use to one or two of those functions. In my case that’s avy-goto-word-1 and avy-goto-char-timer. Some, like Karthik settle for just avy-goto-char-timer. After reading Karthik’s post I’ve been using avy-goto-char-timer more but I hardly ever use any of the Avy commands except those two.

In a sense, Casual Avy gives you the bet of both worlds. You can still use mainly one or two of the commands but have instant access to all of them at the cost of a single additional keystroke.

I’m really enjoying Choi’s Casual packages. They give you access to all sorts of arcane commands without having to remember a lot of little used keystroke shortcuts. Most of the time, you won’t need them and that’s the point: you don’t have to remember a lot of shortcuts but still have access to the commands you seldom use.

Posted in General | Tagged | Leave a comment

Emacs and ATC

The “ATC” in the title is Air Traffic Control. You might wonder what Emacs has to do with air traffic control other than some engineer writing code for the system with Emacs. The truth is much stranger and surprising.

For a brief period of time, the Air Traffic Control system of the newly unified East and West Germany was running on Emacs. No, really. The German ATC system was running on an editor. The words don’t even seem to make sense.

I’ve heard this story before, but someone just posted a link to the story on the Emacs Wiki. As far as I can tell, I haven’t written about it before so I thought I’d share. The TL;DR is that after reunification, there was a huge project to combine the two countries’ ATC systems. An academic refugee from Symbolics was tasked to write the message router but didn’t know any languages other than Lisp. Being a “Herr Doktor” his word was unassailable but there was no Lisp on the system and no budget to buy one. There was, however, Emacs so Herr Doktor coded his message router in Elisp and for a little while airplanes over Germany were being controlled with the help of code running on Emacs. Proof that, as I always say, Emacs really is a Lisp Machine

It’s a truly amazing, not to say terrifying, story but the next time some VS Code partisan starts telling you how much better his editor is, ask him if it ever ran an ATC system.

Posted in General | Tagged | Leave a comment

The Origins of Unix and C

F/OSS Comics has a cute cartoon about the origins of Unix and C. If you want a quick précis of the Unix and C histories, this is a good starting point. There are a lot of inaccuracies—at least as I understand that history—but it’s still a good general summary.

By now, most everyone knows the outline of the story. AT&T, MIT, and GE teamed up to develop the Multics system. The project had a lot of good ideas but soon became ensnarled in the complexities of an increasingly complicated system that showed no signs of being completed before the need for it expired. Finally, AT&T management—not Thompson who was, after all, a worker bee engineer—decided the project was a dead end and withdrew from it.

An important part of the story is that AT&T management felt burnt by Multics and had no appetite for another OS project. The AT&T Multics refugees, meanwhile, missed the programmer friendly environment that Multics provided.

Thompson, in an extraordinarily serendipitous discovery, found an unused PDP-7 that everyone had forgotten about and began trying some of his idea on it. One day, he realized he was close to an OS and, again serendipitously, his wife took their son to the West cost to visit her parents. That gave him 3 weeks to come up with what would later become Unix. Because of management’s trepidation’s, the work was essentially a skunkworks project.
Other engineers from CSRC became interested and joined in. It was Brian Kernighan who coined the name Unix as a play on Multics. Unix had a huge number of breakthrough ideas but one of the most important, in the end, was writing the system in a high(er) level language that made it possible for it to be ported to other machines relatively easy. That language was, of course, Ritchie’s C, an extension of the B language.

The F/OSS Comics cartoon captures most of this history pretty well and is worth taking a look at.

Posted in General | Tagged , | Leave a comment