Makefiles for Elisp

Chris Wellons has another great post over at Null Program. This post discusses how he uses makefiles to build his Emacs packages. If you’re like most Elisp programmers, you probably write only small bits of Elisp to add to your init.el and, of course, that doesn’t require a makefile.

Wellons, on the other hand, is writing Emacs packages for others to use. The majority of those consist of a single file but there’s still a good reason to use a makefile. In the first place, Wellons has tests for his packages and he has rules to run those tests in the package’s makefile. That makes it easy to run the tests after every update. The other issue is subtler but still important. As Wellons says, the Elisp compiler may be dumb but it does do static analysis and it’s a useful way of finding problems before they manifest themselves at run time. Therefore, the default rule in his makefiles is to compile the Elisp files.

Most of the post documents the conventions that he uses in his makefiles. He shows the Makefile for each of his projects so you can see real examples of what he does. The other important point is that Wellons makes a point of writing portable makefiles. That means they will work with any make adhering to the POSIX make standard, not just GNU make. If you’re writing software that will be used in a variety of Unix/Linux systems, this can make your life a lot easier because you can use the system make rather than installing GNU make.

Besides serving as a good example of using makefiles for Elisp projects, Wellons’ post is also a nice tutorial on makefiles. If you don’t know anything about make, it won’t help you much but if you’re an occasional user, it’s an excellent reminder of the important points. If you’re a beginner, you should check out his make tutorial.

If you’re writing Emacs packages or you’re just in need of a booster shot for your make-foo, this post is definitely worth your time. As usual, Wellons presents useful information in an interesting way.

Update [2020-01-24 Fri 14:26]: find → finding

Posted in General | Tagged , | Leave a comment

Another Victory in the Walletless Crusade

As you regular readers know, I’m always in search of ways to minimize the things I have to carry around and, in particular, to avoid carrying a wallet with the cash and credit cards that goes with it. My main strategy has been to move as much of my wallet as I can into my iPhone. Other than my driver’s license, which Florida is still dragging its feet on, I’ve pretty much completed that process.

It turns out, though, that’s there’s another possibility. Sirius and Visa are collaborating to let your car pay for gas, tolls, and food. The idea is that your in-car digital interface would act like, say, Apple Pay to let you pay digitally for your gas or food.

My first thought was why would I want this when I already have my smartphone but then I realized it could be useful in certain use cases. It’s hard to use your smartphone in a fast food drive-through but this system promises to make that easy. Look at it as another arrow in your quiver. It enables another way of paying with a minimum of mess and fuss. You don’t even have to get out of your car. Or pull your smartphone out of your pocket. As the article says, this could be the end of our fumbling for our credit cards when we want to gas up or grab a burger at our local fast food drive-through.

Posted in General | Tagged | Leave a comment

Karl Voit on Starting to Use Org-mode

Karl Voit has a nice post in his Using Org Mode Features series. It’s advice on how to start using Org-mode. Org-mode is large and complicated and can seem intimidating. That leads many people to start with someone else’s configuration. I did that and can testify that it’s a big mistake.

I was completely awed by Bernt Hansen’s Org Mode – Organize Your Life In Plain Text!. I thought it was brilliant and wanted to recreate his wonderful workflow for myself. It didn’t work out well. I had all these capabilities enabled and didn’t understand how to use any but the simplest.

That brings us to to Voit’s first point: start simple. I always advise people to start out with just headers, lists, and tables and to add other features as you find you need them. Whatever you need is almost certainly there but there’s no point in enabling it and adding the extra complexity until you really need it. Voit agrees with that and his own list of things to start with is similar to mine. The point, though, is to start with a minimal set of features.

Voit also suggests starting out with a single file. That’s really good advice. It’s easy to add new files later if you need them but it’s really hard to combine several files into one if you discover that’s your best strategy. This is in keeping with Voit’s advice to not overthink your file structure. It’s certainly going to change as your workflow does so your best strategy is to hone it as you go along rather than trying to get it perfect from the beginning.

Voit also discusses learning Org, discovery, and the Org-mode community. It’s a good post and definitely worth reading if you’re thinking about starting to use Org or are just beginning your journey.

Posted in General | Tagged , | Leave a comment

Digital Inheritance

I know all you readers think you’re going to live forever—and if you’re young enough that might even be (approximately) true—or you at least think it’s way too early to be thinking about wills and other such unpleasant matters. Nonetheless, things happen: you could contract a deadly disease, get hit by a bus, or have your life cut short by any number of other things.

If you’re reading Irreal, the chances are you have a rich digital life and that much of your data having monetary or sentimental value is stored online. If something did happen to you, would your family be able to access that data? What about your online accounts? Your investment and insurance data? Your blog or social media accounts? A recent issue of Sans’ Ouch! Newsletter addresses the issue of Digital Inheritance and the steps you should take to ensure that your family and loved ones will have access to your digital life after you’re gone.

It’s a useful exercise to spend 10 minutes listing your digital assets and taking note of which ones you would like to be available to your family if something happened to you. You’ll probably be surprised at how many there are. I know I was.

The Ouch! article is short and definitely worth taking a minute or two to read even if you’re sure you are going to live forever.

Posted in General | Tagged | Leave a comment

The Ebola Vaccine That Almost Didn’t Happen

Unless you follow these things, you might not know that a vaccine for the deadly Ebola virus has been licensed in both Europe and the U.S. The vaccine appears to be highly effective and is a big deal. Although Ebola has not, historically, been widespread, it is so deadly and its effects so horrible that an effective vaccine is a big deal. That and the fact that Ebola has shown signs of spreading outside of its traditional habitat of Africa means that this is news we should all welcome.

Stat News has an excellent and interesting article that tells the story of the vaccine’s development and how close it came to not happening. The story is involved and complicated so I won’t try to retell it here but it has all the elements that such a story should have: good ideas, luck, independent researchers sharing knowledge and techniques, serendipity, bureaucratic interference, fierce opposition even after trials showed that the vaccine was effective, and much more.

The article is definitely a good read and a reminder of how fragile a success like this can be. Lots of little pieces had to fall into place and it would have been easy for the project to fail. It’s an inspiring story. Take a few minutes to read it.

Posted in General | Tagged , | Leave a comment

Zamansky 64: Notmuch Mail Client

Mike Zamansky has another video up in his Using Emacs Series. This time it’s about the Notmuch email client and how it compares to mu4e. Zamansky uses mu4e for his work email and Gmail for his personal email but decided he’d like to do all his email chores from Emacs. It’s pretty easy to set up mu4e to work with Gmail but Zamansky thought he’d look into the Notmuch client to see if he liked it better than mu4e.

They’re actually pretty similar except for how they organize your emails. Mu4e puts your emails in folders. That’s not as onerous as it might sound. Both Zamansky and I basically just use Inbox, Archive, and Trash folders to hold everything. Notmuch uses tags instead so if you want to save a particular email, you’d just tag it with ARCHIVE. You can, of course, use any tag(s) you like so it’s easy to organize your mail. As with mu4e, you locate emails with the powerful Xapian-based search functionality they both provide.

Although I love mu4e and have no plans or desire to change, there are folks who are just as passionate about Nomuch. Many of them tried mu4e first so their preference is not just “it’s what I use so it’s best.” The use of tags is a very nice feature and a powerful way of handling your email. You can, of course, use the tags to essentially replicate mu4e’s folder system if you like to organize your email that way but ever since I read Ben Maughan’s post on how he handles email with mu4e by keeping everything in a single archive folder, I’ve been a big believer in that method. I don’t need to use brain cells trying to decide which folder to store an email in. I just put them all in the same place and rely on the mu4e’s powerful search capability to find them when I need them.

So what did Zamansky decide? He says he likes Notmuch a little bit better but in the end his choice came down to a mundane pragmatic issue. Watch the video to see what it was. The video is 19 minutes, 40 seconds long so plan accordingly. As always with Zamansky’s videos, it’s well worth the time.

Posted in General | Tagged | Leave a comment

How Fast Is Ripgrep?

Very fast, it turns out. Arne Babenhauserheide has a great twitter thread on how fast ripgrep is:

You should click on the tweet to see the full thread but a précis is that Babenhauserheide extolled the performance of ripgrep by noting that he was able to check the usages of over 200 property-keys in 2,000,000 lines of code in less than 5 minutes. That’s technically true but significantly understates ripgrep’s performance.

The author of ripgrep, Andrew Gallant, responded that that seemed slow to him and after some back and forth it turned out that the process actually took 46 seconds. Gallant says that still seems slow but guessed that it’s because ripgrep was being called once for each of the more than 200 property-keys.

Babenhauserheide ends the thread by saying he was able to replace IntelliJ’s find-reference-in-index by using Emacs with dumb-jump. I do the same thing and have been very happy with the result. Dumb-jump is essentially instantaneous with ripgrep even for fairly large codebases.

Posted in General | Tagged | Leave a comment

Quitting Google: A Story

Regular readers know that I regularly reproach those who depend on Google apps. It’s not that I insist that everybody use open source exclusively—I don’t—but I find it excruciating to read about people committing the only copy their valuable data to Google apps.

It’s not that I object to people using, say, Google Docs but that they commit their only copy of their data to it. If it’s a letter to your Aunt Millie the worst that can happen is that they’ll scan your document and arrange for you and Aunt Millie to receive some targeted advertising. But what if it’s the Great American Novel you’ve been working on, or a business plan, or a copy of your family’s history? Google’s algorithms may decide that they don’t like what you’ve written and lock your account—don’t laugh, it’s happened before—and your data could easily be gone forever.

Using a single app like Google Docs is one thing but suppose you were all in on the Google ecosystem. All your documents, pictures, music, contacts, home automation, and other important aspects of your life were held by Google. That’s where Kyle Piira was when he got an email from Google telling him his account was suspended. In Piira’s case, it worked out all right because it was an old throwaway account that was being suspended but the event served as a wakeup call and he moved away from Google towards open source solutions.

I was feeling pretty smug after reading his story but then I realized that I’m not innocent either and that I depend a great deal on the Apple ecosystem. There is, however, a difference. I’m okay with Apple curating my data to make it easy to access from digital devices when I need it but

  1. I keep local copies of all my data in an open source format. None of it is committed exclusively to Apple.
  2. I have reasonable trust in Apple not to harvest and monetize my data and—more importantly—not to scan it looking for something that offends their sensibilities.

I am, I know, like the old man shouting into the wind but if your data is worth something to you, why would you want to entrust it to someone who may not share your beliefs and convictions or who may decide that a particular app is just not worthwhile and terminate it? As Piira says, it’s hard to move away from Google completely but you can limit it to things like YouTube.

Posted in General | Tagged | Leave a comment

The Online Shopping Experience

I don’t usually indulge myself like this but the following so perfectly captures my experience of dealing with my health insurance provider yesterday that I couldn’t resist.

Thanks to Karl Voit for the link.

Posted in General | Tagged | Leave a comment

Using Org-mode To Capture and Report Git Commits

Like most developers, Andrea Richiardi has a certain amount of logging and reporting he has to do to document his work. One such item is a report on the commits he’s made while working on various tickets. He wants to capture:

  1. The ticket number,
  2. The text of the commit description, and
  3. The time and date of the commit.

At the end of the week we wants to generate a report containing all this information.

He manages this with Org-mode and a bit of custom Elisp. He describes the solution in his post Build your productivity tools with org-mode. Almost all the work is done by the built-in Org capture and agenda functionality. Most of the Elisp is simply a couple of regular expressions that retrieve the ticket number and commit description. The only non-obvious Elisp deals with capturing the text of the commit buffer or, possibly, a selected region of text.

The template he uses for capturing the data formats it, adds some metadata, and stores it in an Org file. He has a custom agenda command to list the entries he’s captured that he can use to send the information on.

It’s a nice system that you may find useful but even if you don’t, it serves as an excellent example of how to leverage the built-in Org tools to make what might seem a complicated task easy.

Posted in General | Tagged , | Leave a comment