Managing Dotfiles with Org

I’ve written before about the idea of combining your dotfiles into a single Org file and then tangling them out to their proper locations. That’s a nice solution because it provides an easy way to document what you’re doing and makes it convenient to put them under version control.

Toon Claes, from that previous post, likes to have a separate Org file for each dotfile but I like the idea of keeping everything in a single file. The individual dotfiles can still be tangled out to the correct places but all the source and commentary is in a single easy-to-find file that can be version controlled without a lot of fuss.

I’m not the only one who likes the idea. Mike Hostetler has also implemented it and posted his version along with a link to it in his GitHub. Like Claes, he puts each dotfile in a separate Org file but it’s easy to change that if you prefer the “one Org file to rule them all” method instead. You’ll have to put individual tangle commands with each source block instead of a single one in the headers but you still have to specify those tangle commands even if you use multiple files so it’s not really any extra work.

Ever since I first saw this idea, I’ve thought it was the right thing but I’m ashamed to say that I’ve been too lazy to implement it myself. There’s really no excuse because you can do it piecemeal, even doing a single file at a time. As I wrote before, this idea is especially useful if you have more than one machine running the same OS. My iMac died recently so when I get around to replacing it, it would be useful to have a set of dotfiles ready to go. Maybe that will encourage me to actually do it.

Posted in General | Tagged , | Leave a comment

Composability in Vim

To the uninitiated, Vim’s command set seems a mishmash of arbitrary letter sequences that don’t seem to make any sense. To make matters worse, there are a lot of them. The truth, though, is that the commands are very regular and built up from operators, motions, and (text) objects. Once you learn that d is the command for delete you can delete letters, words, lines, paragraphs, whole files and many other objects simply by combining the d with a motion or object.

Ismail Badawi has a very nice post that explains all this in detail. The nice thing is that although you can perform hundreds of actions in vim, the number of keys you have to learn is relatively small. That makes learning and mastering vim much easier than it first appears.

The scheme is so tractive that an experienced user will know the command for an action even if they’ve never seem it before. Badawi has a story about combining the actions of two completely different plugins in the expected way and having it work as he thought it would. He says that he didn’t even think about it, he just used his muscle memory and got the right result. This despite the fact that the plugin authors almost certainly hadn’t anticipated an interaction between the two plugins and, of course, the interaction was nowhere documented.

As those of you who have been around for a while know, I was a Vi/Vim user for a long time and still think very highly of it. If you’re looking for a fast, powerful editor that concentrates on doing one thing (editing) well, Vim is for you. If you’d like an environment that allows you to do multitude of text-based tasks easily and with a single UI, Emacs is a better bet. Both are great editors; the choice boils down to what you want from your editor rather than the editor themselves.

Update [2019-08-07 Wed 14:26]: Added link to Badawi’s post.

Posted in General | Tagged | Leave a comment

Bayes’ Theorem and The Replication Crisis

I’ve written before about the replication crisis and the shockingly low reproducibility rates in scientific research. I’ve usually focused on psychology but sadly medicine is even worse. I’ve usually viewed these problems through the lens of reproducible research and have focused on ways reproducible research could help solve the problem. It turns out, though, that there’s another more relevant problem that needs addressing.

Over at the Nautilus Website, Aubrey Clayton has an excellent article on what he and a growing number of scientists believe the problem is: a reliance on statistical inference. Using these techniques was something I was taught at school along with, I’d guess, most Irreal readers. The use of them is standard and probably required in almost every scientific journal. At least, they have been. Now, due to the ongoing crisis with studies not reproducing, some journals are rethinking that policy and even going so far as to outlaw them in the papers they publish.

Clayton starts his article with what he calls three versions of the same story:

  1. A woman convicted of murder based solely on the fact that her two infant children died shortly after birth.
  2. A woman who discovers a lump in her breast and after having a mammogram is told the lump is almost certainly malignant.
  3. The famous Norenzayan study that concluded staring at Rodin’s sculpture, The Thinker, led to decreased religious belief.

They’re the same story, Clayton says, because they all depend on the same flawed statistical inference to reach their erroneous conclusions. The rest of the article discusses what went wrong and how incorrect findings were reached in each case.

Clayton makes a cogent argument—including a worked out example in the case of the woman with the breast lump—that the proper way to analyze these cases is with Bayesian Analysis, that is by using Bayes’ rule. I won’t repeat his arguments here because you should read them for yourself: The ongoing reproducibility crisis has serious implications for all of us, as the story about the woman with the breast lump makes clear. The article is not at all Mathematical so don’t be put off by that.

Posted in General | Tagged , | Leave a comment

Emacscalc Script

I’ve often written about how powerful and useful Emacs calc can be1. It is, I think, one of the most underrated features of Emacs. It’s a bit hard to learn, not because its default data entry mode is RPN but because it’s so powerful and has so many functions. I’ve sometimes described it as “a poor man’s Mathematica.” That comparison is overblown, of course, but for most people, calc can do everything that they’re apt to need in the way of mathematical calculations.

Christoffer Stjernlöf has a cute trick: he’s released a shell script that lets you run calc without explicitly opening Emacs. It works just the way you’d think it would. It starts Emacs in the background and calls calc from the command line. A very nice little hack.

It’s great for people who aren’t Emacs users but would like to take advantage of calc’s power. You don’t need to know any Emacs arcana to use calc so that’s a valid use case. On the other hand, I’m not sure how useful it is for Emacs users. Most of us always have Emacs running and many of us have a shortcut to start up calc. For example, I have F10 mapped to calc-dispatch so a single key starts calc for me.

Still, I’m sure there are people, some of them Emacs users, who will find the script useful. If you aren’t already a calc user you really should become one. You’ll find it worth the effort, I promise.

Footnotes:

1

There’s too many to list. Do a search on “emacs calc” to get an idea of how often I’ve written about it. Even I was surprised at the number of posts involving calc.

Posted in General | Tagged | Leave a comment

Can A Programming Language Be Too Powerful?

After writing my post on Emacs and Igors, I reread Rudolf Winestock’s The Lisp Curse that Done mentioned in his article on why Emacs users are like the Igors. Winestock’s article, in turn, mentioned another that I’ve also read before, Mark Tarver’s The Bipolar Lisp Programmer. It’s been many years since I’ve read either and I was very resistant to The Bipolar Lisp Programmer the first time I read it so I probably didn’t get as much out of it as I should have. On rereading them, I have to admit that they have a point.

That brings us to the title of today’s post. According to Betteridge’s Law the answer should be no but Winestock and Tarver make the case that Lisp is so powerful that its practitioners and their community are harmed. That’s a provocative claim so it’s worth taking a look at why Winestock and Tarver think it’s true.

The first question to consider is whether it’s true that one reasonable1 language can be more powerful than another. You might think that maybe the differences aren’t all that pronounced but Winestock suggests a thought experiment. Take the two languages C and Scheme, neither of which have object support, and consider how hard it would be to implement objects while maintaining backward compatibility with the original language. As Winestock says, it’s little more than a homework assignment for Scheme but takes significant programming chops to do it in C. So, okay, Lisp does seem more powerful in many ways.

But why would that be harmful? The problem according to Winestock is that every programmer “does it himself” and you end up with lots of implementations of whatever feature is being added none of which are entirely satisfactory to anyone but the implementer. That leads to programmer isolation and, often, the lack of standard implementations of many features.

Tarver takes this idea a bit further and says that the power of Lisp is especially harmful to a certain type of programmer that he describes as having a brilliant bipolar mind. His argument is a bit nuanced and you should read his article to appreciate it fully. In fact, read both articles. They’re thought provoking and interesting. Especially if you’re a Lisper.

Footnotes:

1

We’re not talking, for instance, about whether C is more powerful than, say, the original BASIC.

Posted in General | Tagged | Leave a comment

Adversarial Interoperability

Over at boingboing, Cory Doctorow has an excellent essay on adversarial interoperability, or as he puts it, How about nah? The central theme of the piece is the idea that Web sites are offering a one sided deal: “Let us and everyone we do business with track you in every way possible or get lost[.]” It’s meant to be a take it or leave proposition. Agree to this or leave the premises.

As Doctorow says, consumers are saying, “Nah, I don’t think so. I’ll just use an ad blocker and stop the tracking at its source.” This is what he means by adversarial interoperability. The users have found a way to use (or interoperate with) the Web sites in a way not envisioned or approved by the sites’ owners. The owners, of course, respond with ad blocker blockers—software that detects if an ad blocker is operating and refuses to render the site if so. The users respond with ad blocker blocker blockers and so on.

The larger point of the essay is that until now, there was little that the advertisers could do—although they certainly tried—to stop this. Now, however, the W3C has sold users out by standardizing and lending their imprimatur to the Encrypted Media Extensions. Once implemented, advertisers will be able wrest control from the users by leveraging the Digital Millennium Copyright Act to punish anyone who tries to subvert it.

I don’t know if things are as bleak as Doctorow portrays them but it certainly isn’t good. Of course, politicians famously refuse to stay bought and if there’s enough outcry, perhaps they’ll get serious about privacy legislation. Or not. Who knows? In any event, Doctorow’s essay is very much worth reading.

Posted in General | Tagged | Leave a comment

Org Mode 9.2.5 Is Released

Bastien says it’s a bug fix release so if you’re having any problems with Org you should consider updating.

Posted in General | Tagged , | Leave a comment

An Interesting Emacs User

I didn’t feel much like working on an Irreal post today so I procrastinated by surfing over to Lifehacker and wasting some time there. Besides the sometimes helpful tips on handling some of life’s chores, they have a section called How I Work that features an interview with a well-known or interesting person about (basically) their workflow.

A recent interview was with Courtney Napoles, a computer scientist who heads Grammarly’s Language Data team. She has an interesting background that includes working as a book editor before she decided to switch gears and get her doctorate in Computer Science. That’s sort of interesting but why would the average Irreal reader care?

It turns out that Napoles, like many of us, is a dedicated Emacs user, of which she says, she would be almost paralyzed at work without. Like me, she uses it for everything: for work, for keeping her and her child’s schedule, notes, TODO lists, shopping lists and just about every other text related thing.

The other thing that struck me was her answer to the question “What’s your favorite shortcut or hack?” She mentions two things sure to strike a chord with hardcore Emacsers. She says that she avoids using the mouse as much as she can and tries to do everything from the keyboard. Along with that, she has a large set of keyboard shortcuts so that she can avoid clicking on an icon to start an app. I never considered that I was a big keyboard shortcut user but after reading the interview, I realized that I use shortcuts the same way she does. I have function keys programmed to start all of my usual applications and to do things like open an Org-mode capture template recording the current URL when I’m in the browser. It’s amazing how much time and effort you can save just by making a few such shortcuts.

If you’re looking for a way to avoid doing what you’re supposed to be doing—or even if you’d simply like to read an interesting interview—head over to Lifehacker and take a look. The two interviews after Napoles’ are with Kirsten Vangsness of Criminal Minds and Will Shortz, the New York Times Crossword Puzzle editor. There’s something for everyone.

Posted in General | Tagged | Leave a comment

Emacs Users…

The few, the proud, The Emacs Users!

Posted in General | Tagged | Leave a comment

Emacs Users Are Igors

The other day, I saw a tweet pointing at a post from 2013 by Chris Done. It was sort of interesting so I added it to my blog queue. Since then, I’ve seen several more tweets mentioning it so perhaps everyone has seen it by now. Just in case you missed it, the post’s theme was that Emacs users are like Terry Pratchett’s Igor Clan.

Igors were characters from Pratchett’s Discworld series who were experts at surgery and routinely replaced their own body parts, making repairs and improvements. That last phrase should tell you why Done thinks Emacs users are like the Igors: they are always changing and improving their editor in the same way that the Igors are always changing and improving themselves.

His thesis is that because Emacs has an extension language in which the majority of the system is written, it’s easy for each user to move things around, modify parts, and add new things to suit themselves. He says that the Rudolf Winestock’s famous Lisp Curse—Lisp’s extraordinarily expressive power leads to programmer isolation—doesn’t apply to Emacs because, after all, your editing environment is yours alone and doesn’t have to satisfy anyone but yourself.

Done’s experience is much like mine: he came to Emacs from Common Lisp and came to see it not as an editor but as a programming environment—or as I like to say, a light weight Lisp Machine. While I don’t have any interest in routinely rearranging my body parts, I do enjoy doing it to my editor.

Posted in General | Tagged | Leave a comment