Words and Ideas

Paul Graham has a new essay up that discusses words and ideas. It’s an interesting piece that reminds me of one of my favorite quotes. The quote from Daniel Boorstin—a University of Chicago historian and the 12th Librarian of Congress—is “I write to discover what I think.1” I first saw it years ago and it made a big impression on me. Indeed, you can think of Irreal as a result of that impression.

Graham’s point is slightly different: you can’t think until you write. Or, at least, you can’t have fully formed thoughts, you can’t completely understand your thoughts until you try to explain them to someone else by writing them down. In Graham’s words,

If writing down your ideas always makes them more precise and more complete, then no one who hasn’t written about a topic has fully formed ideas about it. And someone who never writes has no fully formed ideas about anything nontrivial.

That seems provocative—and, of course, it was meant to be—but he has a point and justifies it in the essay. As with all of Graham’s writing, it’s definitely worth taking a few minutes to read it.

Footnotes:

1

Actually, the full quote is a bit wittier.

Posted in General | Tagged | Leave a comment

Some Comment Tips from Mickey

If you write code, you’re probably always adding and deleting comments. It’s one of those things that’s so fundamental you’d think everyone already knows the best way of dealing with them but I often see questions about how best to handle them in Emacs. Mickey has a tweet with some useful tips on wrangling comments in Emacs:

Those commands are also useful as building blocks. For example, I like starting functions (especially in C) with a comment box that gives the name of the function and a short description of what it does but I like the boxes to extend to the end of the line. Here’s a simple function that does that:

(defun jcs-comment-box (b e)
  "Draw a box comment around the region but arrange for the region
to extend to at least the fill column. Place the point after the
comment box."
  (interactive "r")
  (let ((e (copy-marker e t)))
    (goto-char b)
    (end-of-line)
    (insert-char ?  (- fill-column (current-column)))
    (comment-box b e 1)
    (goto-char e)
    (set-marker e nil)))

Notice how it leverages comment-box to do the heavy lifting.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Résumé Gaps

We’ve all been there. If not with TikZ then some other application:

Posted in General | Tagged | Leave a comment

Emacs Extensibility

We all know that one of the chief—if not the chief—benefit of Emacs is its extensibility. We say it all the time. Irreal says it all the time. But every once in a while the truth of that statement comes crashing down on us in a particularly compelling way. Here’s a case in point:

It can, I guess, seem like a cheap shot to make fun of another editor’s feature addition but the reality is that while the VSCode community was celebrating a brand new capability, Elmad Elsaid provided a one-line implementation of the same feature for Emacs that anyone could apply and enjoy right now without waiting for a new release.

All open source editors have this capability in some sense because, after all, you have the source and can make whatever changes you like but Emacs is running on Lisp so you can make changes without recompiling everything and the liberal use of hooks makes adding a feature like the one discussed here trivial.

With Emacs, there’s no begging the implementers for a change and waiting for the next version. Most of the time it’s a simple matter of writing just a bit of Elisp, adding it to your init.el, and enjoying your new powers.

Posted in General | Tagged | Leave a comment

Support Melpa

I’ve said this several times but, really, MELPA is one of Emacs’ great resources. Think for a moment how important it is to your Emacs life and what you would do if it disappeared. How would you replace it? There’s ELPA, of course, but for ideological reasons it could never be as comprehensive as MELPA. There’s Nic Ferrier’s Marmalade Repo, which I thought was defunct but is rumored to be showing signs of life. Again, though, it’s restricted to Free packages so it, too, is unable to match MELPA’s coverage.

If all that seems too gloomy, don’t worry. MELPA isn’t going anywhere but has recently announced a way you can contribute to support its operations:

If you want to contribute—and you should—go to the MELPA Open Collective site. Steve Purcell runs MELPA on a shoestring so you won’t be financing any Caribbean boondoggles. If each of us, who depend so much on MELPA, chips in a few dollars, Purcell can keep this vital resource running.

Posted in General | Tagged | Leave a comment

Kernighan Podcast on Unix and C History

Here’s a pointer to another interesting talk by Brian Kernighan. This time, it’s a podcast on Unix and C history. The podcast is with CppCast a series specializing on Cpp matters (of course) but that isn’t afraid to venture into other topics. Kernighan is not a Cpp user although he considers Bjarne Stroustrup a close friend of many years

The podcast mainly deals with the early days of Unix and the C language. Many people assume—probably because of K&R—that Kernighan was a co-developer of C but he explained, as he always does, that C was Ritchie’s work and that his involvement in C itself was almost entirely K&R and the C tutorial that preceded it. He was, really, more of a C evangelist than a designer or implementer.

I know I write a lot about Kernighan’s talks but he’s such an interesting and engaging speaker that I always want to share. Even when he’s covering topics that I know well, he always provides context and a personal view that adds to my understanding of the subject. It’s that “personal view” that, in part, makes him so interesting. He was, after all, there for the making of the history he talks about. That and his obvious love for the subject matter makes him always worth listening to.

The podcast is 53 minutes long so plan accordingly.

Posted in General | Tagged , | Leave a comment

Ecomplete

I’ve been using mu/mu4e for 5 years and love it. It really provides everything I want in a mail client except perhaps for handling HTML—which certain miscreants insist on sending to me—but even that’s an Emacs shortcoming that will undoubtedly be remedied in the future. When I first started using mu4e I thought I would have to install BBDB to help me map correspondents to their email addresses.

That turned out to be unnecessary: by default, mu4e uses the mailabbrev mechanism to complete mail addresses so it just sort of worked out of the box. As far as I can tell, this works by scanning stored emails to get possible completions. The problem is that old and erroneous addresses also come up so it’s sometimes hard to know which one is correct.

I just saw this reddit post by astoff1 that recommends using ecomplete for mail address completion. This has the advantage that the mail addresses are explicitly listed in a file (~/.mailrc) so there’s no ambiguity with old or broken addresses. The downside is that you need that file of addresses.

I’m going to do a bit more research to see if I can automagically generate at least a first pass at a .mailrc file. I’ve been content to let it just work for the last 5 years so I haven’t looked into how things actually work. Now, I may need to do that so that I can implement an ecomplete solution as astoff1 suggests.

Posted in General | Tagged | Leave a comment

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