If Only

Joe Marshall has an X little post on Lisp. I used X because I’m not sure of the correct adjective to use. Maybe “snarky”, maybe “cute”, maybe “enlightening”, maybe “interesting”. The idea of the post is that if you find yourself wanting some missing capability when writing in Lisp you can, in fact, simply add it. In other words, you can make Lisp into whatever language you need it do be.

Everybody knows that, of course, but it got me thinking that the same thing applies to Emacs. If it doesn’t do something you want or it doesn’t do it in the exact way that you want, it’s easy to make it do so.

Sure, you probably have to know Elisp to make a lot of the changes but despite what some folks tell you, it’s not that hard to learn Elisp. It’s mostly a matter of learning the API, not Lisp itself. Once you do learn it, you have an infinitely malleable editor at your disposal. Are there some upfront costs? Sure but they’re worth it and once you get past them you have an editor that can be made to do almost anything you can imagine.

Others have already embraced this possibility and now we can read and send email, listen to music, follow RSS, and a host of other things from within the comfort of Emacs. Just as Lisp is the programmable programming language, Emacs is the programmable editor.

Posted in General | Tagged | Leave a comment

Readability And The Bureaucratization Of Google

For a long time—in the early days—I thought of Google as the spiritual heir of the CSRC from Bell Labs. After all, Ken Thompson, Rob Pike, Russ Cox, and probably others landed there. And Google was doing some first rate research and developing great software. They were a commercial enterprise, of course, and unlike Bell Labs didn’t have monopoly income to subsidize that research but they still produced some great results.

Now, of course, Google is just another giant corporation chasing growth and ever increasing stock prices and is even, arguably, a dying enterprise. As Paul Graham noted Google has become bureaucratized and can no longer ship anything. If you want to see how far “professional managers” have managed to drag Google from its founding principles, take a look at this post from Joe Marshall.

In it, Marshall discusses Google’s code readability program. It’s not quite what you probably imagine. It’s concerned with ensuring the readability of Google’s code base, yes, but not in the way you might think. At Google, you can’t check in your code unless you have “readability” or have it signed off by someone who does. That doesn’t sound too bad but as Marshall relates, it has devolved into a social signal that a readability holder is a member of the in group.

Take a look at Marshall’s post for the harrowing details. To me, it seems like exactly what you’d expect to see when the suits decide to concern themselves with what’s going on in engineering. It also seems like an unmistakable indicator of corporate decline.

Posted in General | Tagged | Leave a comment

Time And Date On A Full Screen Emacs

I run Emacs and my browser in full screen and I spend almost all my screen time in those two applications. That presents a (very) small problem: If I want to know the date, I have move the cursor to the bottom or top of the screen to reveal one or another date widget. That’s not very handy and, even worse, involves using the mouse. It’s one of those tiny problems that I’ve learned to live with.

Until today. Bram, over at the Emacs Mastadon, showed us a bit of code that displays the time in the modeline if Emacs is in full screen mode. It uses display-time-mode to do this. I toggled it on to see what it looked like. It only showed the time but I was pretty sure I could make a quick hack to have it add the date.

Then I remembered that this was Emacs and someone else must surely have thought of that so I checked the documentation. Sure enough, if you set the variable display-time-day-and-date to t, it will also display the date. Now when I need to know the date, it’s right there on the modeline.

That doesn’t solve the problem when I’m in the browser. Sadly, there doesn’t appear to be a Safari widget that displays the date but I’m no worse off than I was before when I’m in Safari and the problem had disappeared when I’m in Emacs.

Chipping away at small problems, mostly by tweaking Emacs: it is, as I’ve written previously, like maintaining a Japanese garden. A work always in progress but never completed.

Posted in General | Tagged | Leave a comment

An EMMS Transient

Sven Seebeck has taken inspiration from Charles Choi and implemented a transient to ease one of his frequent operations. That task was playing music with EMMS. His needs, he says, are pretty vanilla. He typically just wants to play an album or perhaps a specific track from an album. He’s not concerned with playlists.

He cleverly let Dired do most of the heavy lifting. by opening a Dired buffer to his music repository, he get a listing of the albums and by selecting an album, the songs in it. The rest is pretty simple as you can see by looking at his code. It’s very easy to follow and understand.

The point here is not to highlight yet another transient menu: they’re simple enough that anyone can write one simply by following, say, Seebeck’s example. Rather, the point is, once, again, how the flexibility of Emacs allows you to do this sort of thing quickly and easily.

Posted in General | Tagged | Leave a comment

Wagging The Dog

The world has gone mad. When I was a young programmer™, we strived to adjust our programs to reflect reality. If there was a mismatch, there was no doubt where the fault lay: the model was wrong and needed to be fixed.

That idea is so last year. Now, apparently, if your program’s model doesn’t match reality, it’s reality’s fault and reality, not the program, needs to be fixed.

At this point, you’re probably asking yourself what the cause of all this crazy talk is. It’s this. The North Yorkshire Council (in the UK) has decided that street signs, such as “St. Mary’s Walk”, would no longer have apostrophes and perhaps not even the period after “St”. Why? Because it confuses the computers.

If you want to argue that the period after an abbreviation is an anachronism, I’m open to that debate. In my personal notes and logs, I never use them and I write “ten thirty” as 1030 not 10:30. So my objection to the North Yorkshire Council’s plan is not some longing for ye olde grammar. It’s the idea that real people and their artifacts should change just because the people they have programming their computers are too incompetent to deal with things like apostrophes.

Yes, yes. I know all about Little Bobby Tables and the incomprehensible fact that these attacks are still not only possible but endemic. But the fact is, these problems are the programmer’s fault. We do, after all, know how to sanitize input to databases. But gee, that’s boring, and as I said, so last year. Easier to just change reality.

And let’s not even get into the problems arising from letting politicians address technical problems. That never ends well.

Posted in General | Tagged | Leave a comment

Make Box

A very short quickie today.

The ever prolific Nicolas Rougier has another nice snippet for us. It’s a way of enclosing some text in a box. It’s a tiny bit of code but it can produce some very nice output. Take a look at the example at the end of his gist.

It’s another nice example of how flexible Emacs is and how it lets you adapt it to whatever you need it do be.

Posted in General | Tagged | Leave a comment

Texinfo

CleanPrinciple5, over at the Emacs subreddit, asks an interesting question. He wonders why texinfo isn’t more popular. If you are and always have been an Emacs user, you might find that a reasonable question. On the other hand, if you ever tried to use Info without Emacs the question is apt to elicit a, “Well duh!”

Here’s my answer to CleanPrinciple5’s question: The Info utility is basically unusable. In the old days, most of the (useful) GNU documentation was available only in Info format so I was forced to use a TCL application to read it. It was still horrible but at least it was usable. All that got better when I started using Emacs; its Info interface at least makes sense.

The Unix tradition is to use man pages for a summary of how to use a program and, when necessary, a longer document—in PDF these days—to describe details not appropriate for a man page. For example, the yacc man page described the command line options and some other details but the description of how to use it to generate parsers was left to a separate paper, typically in the documents directory or the printed manual. GNU combined those two approaches into texinfo documents.

It seemed like a win and would have been except for the brain dead Info reader. Even after moving to Emacs, Info documents still leave a bad taste in my mouth and I avoid them when I can. I’m sure many other users feel the same.

Still, they’re better than simple PDF documents because they’re indexed and hyperlinked and most of them have a section with the same information traditionally contained in the Man pages. All the information you need in a single document that should be easy to read but isn’t because the readers are terrible.

Update [2024-05-19 Sun 12:37]:
Techinfo → Texinfo. Also better distinguished between Info documents and the Texinfo language.

Posted in General | Tagged | Leave a comment

Renaming Git Files With Emacs Dired

Álvaro Ramírez has a really handy tip for renaming files under version control with wdired. If you don’t already know about wdired, stop whatever you’re doing and find out about it right now. It’s really magical. The TL;DR is that you can set a dired buffer to be editable and any changes you make—typically to the file names—will be reflected in the actual files. Mickey, over at Mastering Emacs, has a nice introduction.

Ramírez really likes being able to change file names with wdired but was unhappy that those changes weren’t reflected in git in a convenient way. Naturally he set out to remedy the situation. As he discovered, he needn’t have bothered. Wdired already has that handled: you just need to set dired-vc-rename-file non nil. Once you do that, git will show the files as renamed and ask you to commit the changes.

On the one hand, this is a small thing but Emacs, of course, makes it easy to do the right thing so even if your files are under version control—not just git—you can rename them and be sure that dired will inform your version control system of the changes. It makes wdired seem even more magical.

Posted in General | Tagged | Leave a comment

Two World Views

The comments to my recent post Emacs And Modal Editing veered off to a discussion of why it’s not really possible to compare Emacs and Vim. Ag ibragimov expressed a point of view that I’ve long held: Emacs and Vim are really two different type of applications so it makes no sense to compare them.

I have always said that whether you embrace Vim or Emacs is a matter of your world view regarding editors. If you are looking for a fast, relatively light weight editor that excels in editing text and doesn’t bother with anything else, Vim is the correct choice. If you are looking for a Lisp Machine-like operating environment that serves as the center of your computing workflow, then you should choose Emacs. They’re both really good editors and which is right for you depends on that worldview.

All this was in the context of the editor wars, one of our oldest and most cherished holy wars. As I’ve said many times before, the editor wars can be funny and are often a source of entertainment but you shouldn’t take them seriously. These days, I doubt anyone does.

That brings us to this post by Odd-Distribution2887 from the Emacs subreddit. His worldview, I submit, is clearly that of the Vim user and he would probably be happier there. He appears to think that he should want to use Emacs but why should he? He should use whatever editor is in most accord with his workflow and disposition.

That’s not to say it’s a lifetime commitment. You can, and lots of folks do, change their mind and switch from one to the other. I spent at least 25 years with Vi(m) before I changed to Emacs. If you’re interested, you can read my two part series on why I changed here and here.

The takeaway from this post is that neither Vim nor Emacs is “better”. It’s simply a matter of what you’re looking for in an editor.

Posted in General | Tagged | Leave a comment

A New Emacs Maintainer

Richard Stallman writes to announce that he’s appointed a new Emacs maintainer. Not to worry, Eli Zaretskii is still a maintainer but Andrea Corallo will now be a co-maintainer along with Zaretskii and Stallman.

Corallo, of course, is the engineer who brought us native compilation, inarguably a tour de force.
Whatever you think of RMS, he does have a good record of appointing excellent Emacs maintainers. As I’ve written recently, heading up Emacs development takes a lot of knowledge and work and I’m sure Eli can use a bit of help.

I extend my best wishes to Corallo and am confident that he will be another in a long line of excellent maintainers. You can consider this post as my thanks to him in advance. As I’ve said repeatedly, we all owe those who step up to take on this task a huge amount of thanks.

Posted in General | Tagged | Leave a comment