Making Things Easier

A family member and I were having an argument a discussion about the relative ease of using a MacBook Pro with macOS and a Lenovo laptop with Linux. A lot of you guys are thinking, “Yeah, I’m with the Linux guy!” but before you choose sides you should know that he has been seduced by the dark side and is a Vim user1.

Anyway, the discussion evolved into how you would put a link to a Web page open in your browser into an email. My family member said he would double click on the URL bar of the browser, switch to his email, and middle click to insert the link. I replied that I don’t even have a middle button but that I don’t need one because I’m an Emacs user and had written a bit of Elisp to automatically insert the URL of the browser’s currently active page. Thus I merely started writing my email and when I got to the place that needed the link, I just called my Elisp.

That bit of Elisp is a function called jcs-insert-url but I said that the most I ever had to type was Meta+x j i u and often I only needed part of it depending on how autocompletion was feeling at the time. I added that I could, of course, add a key binding like Hyper+u to call the function and make the whole process even easier. Then I started wondering why I hadn’t done that. I keep on typing Meta+x j i u whenever I want to insert a URL. That’s crazy. So I added the binding and now my life is even easier.

The point of this post—finally—is a reminder to myself and to you to occasionally think about your workflow and ask if there’s some adjustment that would make things easier. It’s amazing how often the answer is yes.

Footnotes:

1

I’m just trash talking. Regular readers know I was a Vi/Vim user for many years, still think highly of it, and consider it one of the two best editors for serious programmers.

Posted in General | Tagged | 11 Comments

Language/Editor Integration

In yesterday’s post, I discussed Karl Voit’s love letter to Org mode and how he’s come to depend on it for personal information management. Articles about Org mode almost always make the point that Org documents are plain text and can be edited with any editor. That’s true and it’s part of what gives Org its power.

On the other hand, just because you can edit Org mode documents with any editor doesn’t mean you should or would. Who, other than in an emergency, would do such a thing1? One reason not to do so is, of course, that Org mode runs in the Emacs lisp interpreter so you can’t get agendas, generate reports, use the spreadsheet functionality, or a host of other things in other editors.

A more subtle reason, though, is that the Org language is integrated with the Emacs editor. Alex Beal explores this integration in an interesting post over at his blog usr/bin/blog. The way you deal with Org structures and operate on the data is deeply integrated into Emacs. One of the examples he gives is editing tables. You can, of course, build an Org table in any editor but the Emacs editor will automatically format them for you and allow operations such as adding, deleting, or moving rows or columns in an easy way.

Beal argues that this integration is very valuable and is something missing in most languages. Emacs does, of course, provide minor modes that do some of this integration but not as much as with Org mode. It’s an interesting and thoughtful post that’s worth reading.

Footnotes:

1

Leaving aside the possibility of programmatically generating such a file, of course.

Posted in General | Tagged , | 1 Comment

Karl Voit on Org Mode

Karl Voit has a lovely paean to Org mode in which he recounts his journey to Org in a years-long quest to organize his life and maintain a knowledge database. I’m sympathetic. I started with a Rolodex and a pocket full of index cards. Years later I find myself, like Voit, spending the majority of my tube time in Org mode.

Voit is an expert on personal information managers and has spend a considerable amount of time building up his work environment. He suggests an often proffered but frequently ignored piece of advice for using Org mode: start off with one or two simple functions—note taking, say—and add more functionality as the need arrives. Bernt Hansen’s excellent Org Mode – Organize Your Life In Plain Text! is an excellent place to see what Org can do. It’s short enough the read the whole thing but comprehensive enough to show you what’s possible and to serve as a go-by for implementing your own workflow.

As Voit says, one of the major benefits of Org—besides its power—is that the data format is plain text. You can, if you like or need to for some reason, write an Org document with any editor, even echo if it comes to that. That’s a huge advantage because it means you don’t have to worry about being locked into proprietary data formats that might stop being supported sometime in the future. That’s one of the main reasons I feel comfortable living in the Apple ecosystem: all my data (other than specialized data such as pictures and PDFs, which are also in open source formats) are plain text so if I have to leave Apple for some reason, I can take all my data with me. I largely have Org to thank for this.

If you’re an Org user or wondering if you should be, take a look at Voit’s post. It’s an interesting read.

Posted in General | Tagged , | Leave a comment

How Do I Exit Vi?

As I’m sure all of you know, there’s a meme going around about people not being able to figure out how to exit Vi/Vim. I haven’t joined in the fun because, after all, exiting Emacs is just as obscure. Nevertheless, you have to love this story:

It’s another one of those anecdotes that’s too good not to be true but I have to admit to a certain skepticism. Still, it’s an amusing tale even if its provenance is questionable.

Via rjzii

Posted in General | Tagged , | 1 Comment

Comparing Doom Emacs, Spacemacs, and Vanilla Emacs

Yiming Chen has an interesting post that compares Doom Emacs, Spacemacs, and vanilla (i.e out-of-the-box GNU-) Emacs. Chen approaches the subject from the point of view of a Vim immigrant who is heavily invested in the Vim keystrokes and mindset.

Until very recently, I hadn’t even heard of Doom Emacs but it looks to be an excellent configuration for someone who wants to live in the Vim environment as much as possible while still using Emacs. The other choices offer similar functionality to the Vim user. You might wonder why anyone would bother. If you’re most comfortable in the Vim environment, then use Vim. The most common reason you see is to get access to Org mode and that’s certainly a good enough one. Doubtless there are others.

Those who want the Vim experience in Emacs have at least the three choices that Chen explores. If you, too, want a Vim experience from Emacs, take a look at Chen’s post. He gives the pros and cons of each choice as he sees it. You’ll have to follow the link to see which one he chose but it’s worth the read in any event. Even if you aren’t looking to bring Vim with you.

Posted in General | Tagged | 2 Comments

Debugging Elfeed with DTrace

If you don’t follow Chris Wellons over at nullprogram.com, you really should. Wellons always has interesting posts, and often discusses fascinating technical details. He’s shown me how to do things that I didn’t know Emacs could do like rendering fractals. His posts on the Elfeed DSL implementation and working with Emacs strings are brilliant and every Elisp programmer should study them.

A while back, he got a bug report about Elfeed occasionally failing. The bug was not reproducible and Wellons couldn’t get it to happen on his machine at all. I’ve also never experienced it so it’s not common. That makes it particularly hard to debug.

Wellons knew that the problem was somewhere between Curl, which takes care of downloading the RSS XML, and Elfeed. It could be in Curl, in Emacs, or in Elfeed itself. Wellons realized pretty quickly that what he needed was DTrace but that’s not available on Linux, which he uses, so he decided to install FreeBSD on a Raspberry Pi that he had sitting around and do his debugging there. Serendipitously, that had the added benefit that it caused to bug fire reasonably reliability. Using DTrace, he was able to discover what was happening. Be sure to follow the link and discover what that was and see the details of his debugging. One of the unexpected benefits of his fix that affects us all is that Elfeed is now much faster. I saw a dramatic increase in the speed of Elfeed’s RSS downloading. Until I read his post, I didn’t know what had happened.

This is a great post and I learned some new things from it. You probably will too so it’s definitely worth your while.

Update [2018-01-25 Thu 13:03]: Insert missing comma so the sentence makes sense.

Posted in General | Tagged , | Leave a comment

Agenda Alerts

An exception to my all-things-in-Emacs rule is my calendar. I do keep an Org mode agenda for things like projects and tasks to be done but for doctor’s appointments and the like I use the the macOS calendar app—actually Fantastical but that’s a detail. I do that because it makes my calendar easily available on all my devices. When I’m at, say, the doctor’s and am making an appointment for my next physical, it’s nice to be able to bring my calendar up on my iPhone so I can see what days and times are free.

Not everyone does things like me of course. Lots of folks keep their calendar in Org mode and for them there is a need for alerts of upcoming events in the agenda. Happily, Artem Khramov has met that need with org-wild-notifier.el. Take a look at the README to see the what sort of alerting it can do.

If you use Org for your calendar and you like to get alerts a few minutes before meetings or appointments, you should take a look at org-wild-notifier. It a reasonably light-weight solution that will probably serve your needs.

Posted in General | Tagged , | Leave a comment

Emacs 26 Pretest #2

Nicolas Petton has announced that Emacs pretest 26.0.91 is out and available for testing. It’s the second pretest for the upcoming Emacs 26.1. If you don’t mind living on the edge a little, give it a try and help out with the testing.

As always, thanks to Nicolas, Eli, John, and all the others who have worked so hard to bring us Emacs 26.

Posted in General | Tagged | 2 Comments

Twenty Bash Tricks

Most, if not all, developers make heavy use of a shell even if, like me, they run those shells from within Emacs or some other editor. There are lots of shells, of course, but the default these days is almost certainly bash. Ian Miell has two nice posts that explain some of the finer points of bash use.

Even as a long-term bash user, I learned a few things I didn’t know. For example, did you know that bash supports associative arrays? It does and Miell tells you how to use them. There’s lots more so be sure to give the two posts a read.

Posted in General | Tagged | 1 Comment

Redditor-mode

For those of you who are active on reddit, Matthew Carter has written redditor-mode. It allows you to browse reddit from the comfort of Emacs. That’s one more task that can be moved into Emacs. It’s not yet in Melpa but has been submitted so we can expect to see it there soon.

All my visits to reddit are from links to individual postings so I haven’t tried this package but it looks very nice. If in the future I start browsing reddit directly, I’ll certainly give this package a try.

Posted in General | Tagged | Leave a comment