The Roots of Unix

While researching for my post The History of C Compilers, I came across another post from Diego Crespo that was sort of along the same lines. This one, Tracing the Lines: From the Telephone to Unix, follows the early history of Unix and how it fit into the history of the telephone system.

Almost from the beginning, Bell instituted a research organization in his new company. It was called the Volta Bureau but its mandate was remarkably similar to that of the Bell Labs that it would evolve into. This was in 1880.

Years later, Bells Labs was a third of the Multics Project—along with MIT and General Electric—but eventually realized that the enterprise was a dead end and withdrew. By now, it’s a well know story that Ken Thompson found himself with nothing to do and started playing around with an essentially forgotten PDP-7. It was there that he first programmed his Space Travel game and later started experimenting with optimizing disk access.

Eventually, he realized that he was 3 weeks away from an operating system. Serendipitously, his wife chose that time to take their young son to visit her parents in California for 3 weeks. When she returned, the first version of Unix had been born.

Most of this work was done in secret because, after Multics, Bell Labs management wanted nothing further to do with operating systems. Thompson wanted a bigger machine but couldn’t get approval. Then he convinced the patent office that was looking for a system to deal with Bell Labs patents that they should get the machine he wanted and his group would write the software for it. That was so successful that the patent office bought them an even bigger machine (a PDP-11) to work on.

What I like about this story is that like a lot of great systems, Unix was the result of an individual programmer’s itch. Thompson was bored so he invented Unix. Try to imagine what would happen if Unix had been a management inspired project. Actually, we don’t have to imagine. We need only look to Redmond.

If this type of thing interests you, take a look at Crespo’s post. It’s a good read.

Posted in General | Tagged , | Leave a comment

Describe Symbol Redux

I just came across this post from Bozhidar Batsov about describe-symbol. It’s a help command, bound to Ctrl+h o, that combines the results of describe-function and describe-variable. The putative advantage of this (newish) command is that a single key shortcut serves to get information on both functions and variables.

My first thought, when reading Batsov’s post was that the command was a real win but then I started wondering whether muscle memory would keep me using the bindings, Ctrl+h f and Ctrl+h v for describe-function and describe-variable instead. It turns out that we have an answer to that question.

As I was preparing this post, I discovered that I’d written about the describe-symbol command back in 2022. Back then, I also thought it was a good replacement but I don’t believe I’ve ever used it since. Indeed, I’d forgotten all about it. Still, if you’re new to Emacs and haven’t developed muscle memory for the old commands, it could be a win. If you’re a new user or not as set in your ways as I am, this single command is only one thing to remember instead of two.

Posted in General | Tagged | Leave a comment

Isearch Transient Menu Now On Melpa

Last year, I wrote about Charles Choi’s transient menu for isearch. The idea is that while widely used, isearch is a very complicated function with many options. Most Emacs users don’t know all those options and almost none of them know the obscure keybindings for them. Choi solved that problem by making a transient menu for isearch. Take a look at the above post or Choi’s original post for details. He’s since updated his menu to handle highlighting.

Choi’s implementation of the menu is pretty simple and he gives the source code for it in his post. Nevertheless, he’s just announced that he’s turned it into a package and put it on Melpa so if you’re interested in his solution and don’t feel comfortable dealing with Elisp, the package might be just what you need.

As I see it, there are two advantages to menus like Choi’s. First, and most obviously, they make it easy to invoke seldom used options when you need them. Also important, if not as obvious, is that the menu serves as a constant reminder that those options exist. I’m always rediscovering seldom used options that I’ve simply forgotten about because I hardly ever use them but that are just what I need for some obscure task. If I see them everyday, I’ll know they’re there even if I rarely use them.

It’s nice that Choi has made his menu available to us all and that’s it’s easy to get from Melpa.

Posted in General | Tagged | Leave a comment

The init-dir Option

Bozhidar Batsov over at Emacs Redux has a short post on the new(ish) Emacs command line option, init-dir. It does just what it sounds like: it allows you to specify where to find the init.el file and other configuration information. I remember seeing it in the release notes for Emacs 29 but didn’t think a whole lot about it.

Batsov, of course, zeroes in on an important use case: enabling you to try (or use) different configurations while keeping your main init.el intact. He uses the example of having one init file for the Prelude distribution and another for Spacemacs.

Using the option for trying different distributions makes a lot of sense because the init files and required packages differ substantially. Even those of us who happily use vanilla Emacs will find it useful for trying out experimental configurations or for refactoring our configurations.

As Bastov remarks, you can do the same thing with symlinks and, indeed, that’s just what he and I used to do but using init-dir makes things simpler and easier and is another way of sanding down your workflow. Where before I may have hesitated to go through all the steps to set up an alternative configuration, now it’s simply a matter of copying my init.el, making the necessary edits, plopping it in some directory, and pointing Emacs at it with init-dir.

It’s nice to see Batsov blogging more again. I almost always learn something new when he posts.

Posted in General | Tagged | Leave a comment

🥩 Red Meat Friday: Is Emacs Dying?

Is Emacs dying? Lordy, I get so tired of that trope. Don’t like Emacs? I’m fine with that. Sorry you’re missing out, but fine. What I’m not fine with is people who don’t like Emacs and probably have never used it seriously declaring it a spent force. To be fair, redditisinmyheart doesn’t appear to fall into that category and seems to be asking an honest question rather than making an ill informed statement but most people declaring Emacs dead don’t know what they’re talking about.

Part of the confusion for some people is the conflation of two separate issues:

  • Has development and improvement of Emacs stopped or slowed?
  • Is the user base as large as it once was. Is it growing or shrinking?

The answer to the first question is an unequivocal “No”. Org Mode, Magit, Native Compilation, Treesitter, LSP, and tons of lesser improvements are happening all the time. Lately, the Emacs developers are making major releases about once a year and smaller releases regularly. Meanwhile, all those “vibrant editors” are still trying to clone Org and Magit

I don’t have figures at hand but it’s my impression that Emacs development and the introduction of major new features has accelerated lately. Regardless, it’s clearly not the case that development has slowed or stalled.

The answer to the second question is more difficult and part of what makes this a Red Meat Friday post. Again, I don’t have figures but it’s my impression that Emacs usage as a percentage of the possible user base has shrunk. Partly, that’s because there are many more choices now, but also because the nature of the user base has changed.

It used to be—before computers were cool—that being a programmer was a calling and those who answered the call were willing and even eager to expend major effort in honing their craft. That included spending the time to master “difficult” editors like Emacs and Vi. There are still plenty of people like that, of course, but there are also a lot of people to whom it’s only a job to be gotten through with the least effort possible. Of course users in the latter group aren’t going to spend the effort to master Emacs when they can simply use VS Code instead. No steep learning curves; Just buttons to push and a lot of bling to make it look really cool.

Years before Red Meat Friday became an occasional offering here, I wrote a post that could have qualified. It posited that serious programmers use Emacs, Vim, or (on the Mac) TextMate. It got a bit of pushback but I think its point remains valid and probably speaks to why the percentage of Emacs users has shrunk.

In any event, I’m not the least worried about the imminent demise of Emacs.

Posted in General | Tagged , | Leave a comment

OSX Dictionary Interface

Here’s something that may be of interest to those of you falling in the intersection of Emacs users and Mac heads. It’s an Emacs interface to the macOS dictionary app. What it does is give you access to the macOS dictionary from within Emacs. There are two commands:

  1. osx-dictionary-search-word-at-point
  2. osx-dictionary-search-input

that look up the word at point or any word that you input. In both cases, the results are displayed in an Emacs buffer (rather than popping up a separate Mac window with the definition). Take a look at the screen shot at the link to see what it looks like.

This almost seems like a no-brainer but my dictionary needs are more than adequately met and I don’t feel the need to install this. As I’ve written many times, I have access to the famed 1913 Webster dictionary (my latest method for accessing it is here) and for quick lookups I use abo-abo’s excellent define-word. Still, if you’re using a Mac and don’t otherwise have an acceptable way of accessing a dictionary from within Emacs, this seems like an excellent solution.

Emacs really does offer us an embarrassment of riches. If you need a dictionary, there’s not just one or two solutions but many.

Posted in General | Tagged , | Leave a comment

Replacing Dash

It seems like only yesterday that Magnar Sveen introduced his Dash library for working with lists. It provided macros and functions for dealing with lists that weren’t covered by the standard Elisp library. Dash gained immediate traction and became a mainstay for Elisp developers. It’s one of those things that you use without even realizing it. So many packages install it that it’s present in almost every user’s Emacs so it’s easy to use its functions without realizing they’re from Dash.

Dash was so successful that its functions or their clones have made their way into the standard Elisp libraries. Now, Bozhidar Batsov writes that Dash has been essentially replaced by seq.el and subr-x.el and is no longer necessary.

No longer necessary except for the huge number of applications that use it. Batsov recently took over maintaining Flycheck and decided to eliminate the Dash dependencies. That turned out to be easy—almost trivial—to do. It was pretty much a one-for-one replacement of the function name.

It’s a tribute to Sveen’s vision and work that his library was so successful that the Emacs maintainers felt obligated to import its functionality into Emacs core. As a practical matter, Dash will live on if only because many of the applications that use it won’t have a Batsov to refactor them. It’s a nice library and I wouldn’t feel bad about using one of its functions today.

Posted in General | Tagged | Leave a comment

The History of C Compilers

Diego Crespo over at Deus In Machina has a nice post on the history of C compilers. If you’re a Unix head, you probably know most of it but it was fun to remember the old days of trying to use C on MSDOS. Remember, not relive. Back then C compilers were expensive and not that good but we were happy to have anything at all.

In the early days, machine language was a lot simpler and it was relatively easy to write compilers for machines such as the PDP 11. Recent processors, and even old Intel processors such as the 8086, were a bigger challenge. Still people wrote compilers for them but it wasn’t until GCC that a high quality free compiler became available. It’s easy to forget how easy we have it now.

C is more than 50 years old now and despite the naysayers, it’s still going strong. Yes, there are some dark corners but it’s not an exaggeration to say that our modern computer milieu is built on C.

That’s not to say, of course, that every application should be written in C. It’s great for operating systems, compilers, and system utilities but not everything needs to be written in it. As a case in point, Crespo mentions that the Ford F150 truck is run by 150 million lines of C code. As I said before, this should terrify you. There is no way that 150 million lines of C code doesn’t have significant errors, yet we’re riding around with that code everyday.

Regardless, C has a great history and is apt to be with us for some time.

Posted in General | Tagged | Leave a comment

And You Still Don’t Mess Around With Jim

Three years ago, I wrote about patent trolls and Cloudflare and compared filing frivolous patent suits against to CloudFlare to messing around with Jim despite the warning from the late Jim Croce. At that time, Cloudflare had already destroyed (literally) Blackbird Technologies, another patent troll, and were then being sued by Sable Networks who, apparently, hadn’t taken the Cloudflare response to Blackbird to heart.

Now, finally, that case has also come to an end. It didn’t end well for Sable Networks. Cloudflare used its usual strategy of offering a bounty for prior art on all of Sable Network’s patents—not just the ones being asserted against Cloudflare.

Despite the suit being filed in the Western District of Texas—a venue notorious for being friendly to patent holders—the jury took less than 2 hours to find not only that Cloudflare had not violated Sable’s patents but that the patents were invalid and should never have been granted.

Go read the story. It’s a feel good tale but it also underlines a not-so-good fact: lots (most) big companies such as Cisco, Juniper Networks, Checkpoint, Fortinet, and others just capitulate to these trolls rather than go to the expense of fighting them. It’s just cheaper. Sadly, this just encourages the trolls to go after other companies. Fortunately, they’re mostly too dumb to realize that you don’t mess around with Jim.

Posted in General | Tagged | Leave a comment

Opening Dired On External Drives

Marcin Borkowski (mbork) has a nice post on opening a Dired buffer for an external drive. Plugging the drive into a USB port causes it to automount but then you have to call Dired on the path to the drive, which can be long and complicated. Mbork’s solution to this is to automate the process.

If there is more than one drive mounted, his function will give you a completing read list to choose the one you want the Dired buffer for. It’s a small thing but like many things we do with Emacs, it helps smooth our workflow.

His code is both short and obvious, and nicely demonstrates how simple it is to do this sort of thing. This is an example of how easy it is to make Emacs into a secret weapon that can automate away many routine but tedious tasks. As Mbork says, it took him about 10 minutes to write the code but since he’s always mounting external drives, it won’t be long before he’s amortized that effort.

Posted in General | Tagged | Leave a comment