Find Org Files

Howard Abrams has a nifty idea. Open an Org file by its file name, title, or the tags it contains. If, like me, the majority of the files you deal with are Org files this make a lot of sense. When you call org-find-file instead of find-file, you get a list that contains the file name, title, and tags. Since it’s mediated by completing-read you can narrow down the choices in the usual way. Once you make a choice, find-file is called with the file name from the chosen entry.

The design of the command is interesting. Rather than build something like a TAGS file for use by the command, everything happens dynamically in real time. Abrams leverages the speed of the modern grep ripgrep to build the completing-read selection list on the fly. Of course, it’s a little more complicated than that. First, ripgrep is called to gather the titles and then it is called again to gather the tags in each of the files in the target directory.

Most of Abram’s code is concerned with putting together the information and formatting each entry into a nice looking line for the user to select from. The use of ripgrep makes most of it simple. The main difficulty is gathering the tags because they can appear in an Org file in a couple of ways—see Abrams’ post for the details.

If you’re interested in playing around with his code, it’s available in his GitHub repository. It’s a nice piece of engineering and well worth studying for its ideas.

Posted in General | Tagged | Leave a comment

Cord and Cable Management

One of the things I really admire but that also makes me feel guilty is people who have all their computer cables under control and mostly hidden from sight. Every time I see one of those videos by someone who has their cables completely squared away, I think, “I should do that too.” Of course, I never do. My own cable situation is a terrifying mare’s nest of tangled cables that are virtually impossible to trace from end to end. It’s like an adventure game: I never know what’s going to happen when I unplug one of them.

I was, therefore, happy to see this Lifehacker article on Clever Ways to Manage All Your Cords and Cables. By no means is it a complete guide to making your cables look like those in the videos but there are a few good suggestions.

The thing I found the most useful were the links to some of the devices you can get to help with cable management. Some of those are simple such as velcro cable ties, which even I use, or cord clibs to route cables under a desk or counter. For more serious cable organizers there are under-desk cable trays, slotted cable managers, and various other useful devices. Take a look at the article to see them all.

Posted in General | Tagged | Leave a comment

Why Use Emacs, Vim, and Other Nerdy Software

Derek Taylor over at DistroTube has a video that asks the question, “Why should you use Emacs, Vim, and other nerdy software?” That’s not a hard question for Irreal readers but Taylor has an unusual perspective. Even though he constantly makes videos on the technical aspects of computing, he, himself, is not a developer and does not work in the field.

His education was in music but he soon realized that in order to optimize his
use of computers he needed to be able to adapt them to his own workflow. That, he says, entails two conclusions:

  1. You should be using (very) configurable software
  2. You should be using free (in the FSF sense) software that allows you to adapt it to your needs.

The part of the video that I found most interesting was the fact that Taylor has learned a little bit of several languages—including Haskel—just so he could configure his software. He’s written several Bash scripts to automate chores and data conversions but still insists he’s not a programmer—he’s just a guy who learned what he needed to so he could adapt his computing environment to his needs.

It’s interesting that non-engineers are more than able to master enough programming to customize their software. We sometimes think that making full use of Emacs (and the others) are beyond the capabilities of normies but Taylor’s video shows otherwise.

Posted in General | Tagged , | Leave a comment

Org-roam Workflow

Dominik Honnef has a nifty post that describes his Org-roam based workflow for taking notes and writing articles. It’s a very thorough and complex system that captures notes, articles that he reads on the web, articles for his blog, and miscellaneous notes as they occur to him. The system automatically maintains a bibliography and can massage a note intended for his blog to make it compatible with Hugo, which he uses to publish his blog.

His use of Org-roam is a little idiosyncratic. He doesn’t follow Luhmann’s Zettelkasten method as described, for example, by Ahrens’ How to take smart notes: one simple technique to boost writing, learning and thinking. Rather, he uses it as a sort of Wiki to save and index all his notes and the data they pertain to. Org-roam is perfect for that because it maintains forward and backward links between notes and makes it easy to maintain the relationship between notes and index them for easy retrieval.

His system is tightly integrated with Zotero to manage the papers he reads and takes notes on. He lets Zotero handle the bibliography and capturing of papers and websites. Although he provides much of his configuration in his long and detailed post, he doesn’t provide a link to his whole configuration so it may be hard to adapt his approach.

It’s a good post and well worth spending the time to read.

Posted in General | Tagged , | Leave a comment

A Nice Example of Using Bug-hunter from Sacha

Sacha Chua has a great post on using bug-hunter. She had a problem in her large Emacs configuration file and used bug-hunter to find it. If you’re like me—and apparently Sacha—you won’t use it very often but when you’re trying to track down an issue in your configuration, it’s just what you need. Every time I’ve used it, it found my problem quickly and easily.

For those not familiar with bug-hunter, it works by doing a binary search on your configuration: it loads the first half of your configuration and if the bug appears, it starts over loading the first quarter. If the bug is not present, it starts over loading the second half of the configuration. As with a traditional binary search, it recursively narrows down the line causing the problem until there’s only one left.

Sacha’s use case was a little unusual because the error happened asynchronously not at load time so she patched bug-hunter to capture when the offending application was being set up. Take a look at her post to see the details.

It’s a testament to the flexibility of bug-hunter that Sacha was easily able to coerce it into working for her situation. The usual use of bug-hunter is tracking down why Emacs won’t load but as Sacha’s post shows, it can be helpful in more general situations. The next time you need to figure out what part of your configuration is causing you a problem, you should give bug-hunter a try. It’s a great utility.

Posted in General | Tagged | Leave a comment

Sudo-edit

Here’s a nifty bit of Elisp to make opening a file as root a bit easier:

When I first saw it, the idea seemed familiar and it is, in fact, very similar to some code offered by Bozhidar Batsov. I (very) slightly prefer Batsov’s version because it handles my most frequent use case by default. Most of the time when I want to edit a root file, I forget to open it with the sudo tag and have to abort the edit and reopen it. Batsov’s version handles this automatically.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Life Of An Emacser

As anyone who has ventured into the event horizon of their Emacs configuration knows, it can be extraordinarily difficult to get out. As the cartoon suggests, sometimes it can even suck up every available mental cycle leaving no time for other pursuits such as work.

Users of those other editors doubtlessly consider the cartoon a ding on Emacs but every Emacs user I know considers that a feature not a bug. After all, what could be more fun than hacking on your Emacs configuration? That other stuff can wait.

Posted in General | Tagged , | Leave a comment

A Short Essay on Reproducible Research

As everyone around here knows, I am a big fan of reproducible research and the idea of including data, code, and explanatory text in the same file. For researchers, that makes it easy for others to verify and extend the results but it’s also a great way for others to explain some process and embed the code to implement it in a single file.

Norman Walsh has a short post that explores these ideas by using the Org-mode Babel functionality. His example involves calculating the Fibonacci sequence. There’s some explanatory text—more of a place holder, really—and then some code to implement the calculation. The nice thing about Babel, of course, is that you can actually execute that code and place the result right in your document. As Mike Hamrick has explained, that makes it easy to keep the results consistent with the data as it evolves.

If you’re writing explanatory material that involves code samples, I know of no better way than using Org mode. You get consistent documents that can be exported to HTML, PDF, and many other formats. Take a look at Walsh’s post and Hamrick’s video to see this in action.

I know I flog this idea a lot but it’s such a powerful method that I’m always amazed by it. If you do research or write explanatory material, you really should consider the Org mode/Babel/reproducible research approach.

Posted in General | Tagged , , | Leave a comment

On The Collaboration of Ken Thompson and Dennis Ritchie

Periodically I see a reference to Ken Thompson’s 1983 Turning Award Lecture, Reflections on Trusting Trust, and I almost always end up commenting on it. It’s, by far, my favorite CS paper and I’m always delighted at the brilliant trick that it describes. The Jargon File calls it a truly moby hack and if you’re not familiar with it you should definitely follow the first link. The paper is short and very accessible.

The talk and paper are about that hack and it so outshines everything else Thompson had to say that it’s easy to miss a small but amazing unrelated detail. In the introduction, Thompson comments on his collaboration with Dennis Ritchie and how seamless that collaboration was. He says that in all the years they’d worked together he could recall only one instance of “miscoordination of work” In that case they both wrote the same 20-line assembly language program. Thompson was astounded when he realized they’d written exactly the same code right down to the character level.

Imagine being so in tune with a colleague that the only time you misallocate your joint efforts, you end up producing exactly the same output. That wonderful partnership shines through in the work that they created. Unix was so successful that Rob Pike argued, more or less, that Operating System research had come to a stop.

Posted in General | Tagged | Leave a comment

Time To Ditch Your Wallet

It’s been a while since I’ve written the walletless aspect of my quest for a digital lifestyle. Those of you who are long time readers know that my end goal to to be able to leave the house with nothing but my iPhone. On the one hand, I’m almost there. On the other, I’m not any closer than I was the last time I wrote about this.

Entry to my house is controlled from from my iPhone and if I leave the neighborhood and return the door unlocks automatically so I don’t even need to take out my phone. That means I no longer have to carry house keys.

Sadly, I still don’t have a car that is completely keyless. Although my current car allows me to open the door and even warm it up with my phone, I still need the key fob to drive it.

That brings us to my wallet. Apple Pay means that I theoretically don’t need to carry credit cards but, of course, there’s always the odd merchant who still won’t accept NFC payments. The driver’s license situation is even worse: Florida has had a digital license—which I have—for over a year but they still haven’t officially rolled out the program so I still need to carry my license. Their pilot program has been ongoing since 2011 so I’m hoping they’ll launch soon. Right now, I carry my license and a single credit card in my Slim Clip wallet, which is very compact but still something else I have to carry.

This post was inspired by Christine Romero-Chan’s article, In 2023, it’s time to finally ditch your real wallet for Apple Pay. She says that it’s mostly possible to do away with carrying credit cards but that you do occasionally find a merchant who won’t accept it. Similarly, she is still waiting for California to get its act together with a digital license.

Meanwhile, Mike D’Avella who is currently living in Australia has basically ditched his wallet. He uses Apple Pay everywhere and—at least where he is—they have a digital driver’s license. I continue to hope and believe that Florida and the rest of the US will catch up soon.

Posted in General | Tagged | Leave a comment