Adding Timestamped Notes To The LOGBOOK Drawer

Jeff Bradberry has an excellent post on adding timestamped notes to the LOGBOOK drawer in Org files. Most of us are used to using this drawer to record state changes in TODO notes. You can arrange to have the times of the state changes added to the LOGBOOK. You can also arrange to pop up a buffer so that you can add a note to the entry. I do this when the state changes to CANCELLED or WAITING. Sometimes you may want to add a note to a state change that doesn’t normally have one.

That turns out to be easy. You simple add the universal argument to the state change call. If you use the normal Ctrl+c Ctrl+t binding, you would simply use Ctrl+u Ctrl+c Ctrl+t instead when you want to add a note.

Many of you probably already know all this but Bradberry thought it would nice to add arbitrary notes to the drawer as well. That turns out to be easy too. As usual, Emacs has us covered. You simply call org-add-note bound to Ctrl+c Ctrl+z by default.

This post is the seventh in a series on building an Org-mode Workflow. The whole series is worthwhile and you should definitely take a look if you’re an Org user. There are links to the entire series in Bradberry’s post.

Posted in General | Tagged , | Leave a comment

🥩 Red Meat Friday: Load Times Matter?

It seems as if everybody having even a passing acquaintance with Emacs is opining about Emacs load times. That includes Irreal, of course. Most of us take the position that it doesn’t really matter how long it takes Emacs to start because it’s something that happens only rarely.

Every serious person acknowledges that there are exceptions. A (very) few people have to restart Emacs often for various reasons but for the most part the majority of us have no reason to care. Of course, that doesn’t stop some people from caring. And caring a lot.

Over at the Programming subreddit, dormunis1 is proudly announcing that he’s gotten his Zsh load time to under 70 ms. This is down from the apparently normal load time of 0.45 seconds. If you don’t see the problem with this, you should seek help. These times are all below human reaction times so reducing them, while an interesting intellectual challenge, serves no real purpose.

As usual, a lot of the meat is in the comments. Most of the commenters aren’t sympathetic and agree that it’s an optimization without a point. To be sure, learning to do this sort of thing is useful for cases where it does matter. My objection—and that of the other commenters, apparently—is that reducing the load time of Zsh, Emacs, or any other user facing app, by a few milliseconds simply doesn’t matter.

Posted in General | Tagged , | Leave a comment

macOS Emacs Tricks

I’ve been writing a lot lately about Álvaro Ramírez’s Journelly, an iOS app that I use constantly everyday. It’s a great app that I recommend for everyone. But Ramírez has been writing apps for Emacs and iOS for a long time. A previous iOS app of his that I used and liked—before Journelly largely replaced it—is scr that sort of implements an Emacs ∗scratch∗ buffer on your iPhone or iPad. I’ve also written extensively about his dwim-shell-command package that provides all sorts of command line shortcuts from within Emacs.

All of this is by way of an introduction to Ramírez’s recent post on tricks for using Emacs on macOS. It’s a long post with a plethora of strategies for using Emacs on Macs. He starts off by mentioning that he uses Emacs Plus—available from Homebrew—rather than compiling it from source, as he used to do. I still compile from source but on my next machine I may take the easy route and use Emacs Plus too.

Another thing he mentions is a point I often make: Although he was a GNU/Linux user for many years, he now works primary on macOS but this doesn’t matter because he does almost everything in Emacs or his browser so the he can get away with being pretty much OS agnostic. The true believers will gasp in horror but it’s a truth that many of us have discovered.

As for the tips, they are too numerous to list here. Most people probably won’t like all of them but I’d be surprised if anyone couldn’t find something useful in the post. For my part, I really liked his configuration for long press for accents and Plain Org for iOS. I expect to implement both of these in the near future.

If you use Emacs on macOS you should definitely take a look at Ramírez’s post. You’re sure to find something useful.

Posted in General | Tagged | Leave a comment

GitHub As A Notebook

I like GitHub well enough; I link to it often and even have an account but I would never consider using it for anything but public files that I had replicated on my own machine. I’ve been over the reasons for that many times. The most important reason is that you should never commit your only copy of any data you care about to a third party computer. Once you do, a clock starts ticking down to the time that you will lose your data. You never know how much time is left on the clock but you can be sure that it will eventually reach 0.
The second reason is that any site that hosts a lot of data is an attractive target for criminals and your data could be compromised. Here’s the latest GitHub exploit. That’s why I say I would only use GitHub for public data.

All of this is by way of introduction to this post from Simon Willison. In it Willison posits that GitHub is (almost) the perfect notebook. What follows is a list of features that could easily be a description of Org mode. Read it and see if you don’t agree.

The only reason for Willison’s “almost” is the lack of synchronized offline support. I submit that Journelly goes a long ways towards meeting that concern for Org mode. I’ve previously described it as a front end for Org and although it doesn’t expose all your Org files to your remote device it gets you a long way.

Given all that, it’s clear to me that Emacs and Org mode is a much better notebook than GitHub could hope to be. Your data is safer both from criminals and from being disappeared for some reason by a third party provider. My only question is why do I have to keep repeating this.

Posted in General | Tagged , | Leave a comment

A Mansion That Changes Itself To Suit You

iLemming has an interesting post on Hacker News about why younger engineers don’t use Emacs and why they should. You may find the post a bit overwritten but I especially like the ending:

The specialized app user lives in rented apartments; the Emacs devotee walks through an ever-expanding mansion whose rooms rearrange themselves to their thoughts.

That’s a nice metaphor for the Emacs experience. Whatever you need it to be, Emacs will change itself to accommodate you. We usually talk about Emacs as being a clay that we can mold into whatever shape we desire but I like this description better.

Not everybody agrees. Over at the Emacs subreddit there’s a bit of pushback. That’s fine but some responses, like this one, just seem uninformed. You can tell that the commenter doesn’t really know what they’re talking about because they refer to Emacs as “eMacs”. It’s not a big thing but it’s a sure sign that the commenter isn’t really familiar with the subject matter.

All that aside, I really like the metaphor of Emacs being a mansion whose rooms rearrange themselves to suite your needs.

Posted in General | Tagged | Leave a comment

A Custom Keyboard Optimized For Thumbs

Lately, I written a few posts about Emacs-induced RSI and various strategies for overcoming it. For example, my post on The Best Emacs Keyboard seemed to strike a chord with many Irreal readers. One thing that almost everyone agreed on was that being able to use your thumbs for the modifier keys is a big win and can go a long way toward remediating Emacs pinky.

One strategy for people with serious RSI problems is to adopt the Vim keybings, which largely do away with modifier keys and their attendant RSI problems. Another solution is the ergonomic, split keyboards that make modifier keys accessible with your thumbs. Some of us find it hard to warm up to either of those solutions.

Of course, if you’re working with a laptop you’re pretty much constrained to whatever fixes you can implement in software unless, like MarkB, you’re handy with 3-D printers. Over at the Emacs subreddit, awesomegayguy has a post about a keyboard that sort of splits the difference. By that, I mean that it does in hardware the sort of thing you can do by remapping Emacs keys. That has the advantage that the revised bindings are available systemwide, not just in Emacs.

There’s nothing earthshattering about this, of course, it’s just another datum in the encyclopedia of Emacs-friendly keyboards. Still, it’s a nice solution for those people who want a hardware solution but don’t want a split keyboard or any of the other nontraditional keyboards. If you’re interested in this sort of thng, take a look at awesomegayguy’s post.

Posted in General | Tagged | Leave a comment

Emacs As A Guix File Manager

Lynn Leichtle over at Lynn has an interesting post on using Emacs as a Guix file manager. Almost all of my work these days takes place in the Apple milieu so, of course, I’m not a Guix user and can’t speak with even pretend authority about it. Still, Lynn’s post is easy enough to understand. She does most of her work in Emacs and finds that she has no need for a file manager. Emacs handles all that for her. But occasionally, for reasons you can read about at her post, she wants to click on a directory and have it open in Emacs dired.

It turns out that Guix can do this for you fairly easily. See her post for the details if you have a similar need.

Lynn’s post made me realize that I have actually embraced the old joke about Emacs being an OS. Of course I don’t need a file manager; that’s what Dired is for. And if I open a directory in Emacs, I’m popped right into a Dired buffer for that directory.

Furthermore, I don’t really need anything like Guix either. I hardly ever load third party packages—other than Emacs, of course—and when I do I usually get them from the app store, or Homebrew both of which take care of all the things Guix would do. When I do need a third party application, it’s almost always an Emacs package and, of course, Emacs handles all that pretty much seamlessly.

Given all that, it’s hard to avoid the conclusion that Emacs really has become my OS. Basically, everything I do, I do from within Emacs. You could call that obsessive but I call it simplifying my life.

Posted in General | Tagged | Leave a comment

The Ed Editor

Kay Lack has an interesting video on the ed editor. As the cognoscenti know, ed is the standard Unix editor, even though virtually no one uses it anymore. The reason for that is that ed was designed for teletypewriters and is therefore line oriented. That means that from the modern perspective, ed is user hostile. You can’t address individual characters or easily change the content of a line. Almost all operations work at the line level.

Of course, all this makes sense in the context of TTYs. They were slow—really slow—as they typed out what we today would consider the display. It just didn’t make sense to type out a multiline program. make a change, and type it out again. Indeed, the primary concern was typng as little as possible to prevent wasting time.

Lack explains all this and take us through the history of the editor. My only complaint is that she repeatedly refers to it as “ed” rather than “E D”, it’s actual name. Of course, hardly anyone remembers this anymore so it’s a small thing.

If you’re interested in the history of ed and why it’s the way it’s is, take a look at Lack’s video.

There still exists the notion that serious developers should know ed in case they experience boot problems, need to change a configuration file, but their normal editor isn’t available. Ed lives in /bin so it will almost always be available unless there are serious hardware problems. That may still be true in Linux or *BSD based systems but probably isn’t in macOS.

Nonetheless, I still maintain a reasonable facility with ed just in case. It is, after all, the standard Unix editor.

Posted in General | Tagged | Leave a comment

Opening A Searched For File In Dired

If you’re one of those people who obsess about making every Emacs operation as fast as possible, James Dyer has quick tip for you. Dyer uses Dired a lot and one of his common operations is to search for a file in a Dired buffer using isearch-forward and then open it. Of course, he wants to make this operation as efficient as possible so he objects to the fact that he has to type Return twice: once to terminate the search and then again to open the file at point.

Dyer’s tip is a way of completing the search/open operation with a single return. He does this with a bit of advice to the isearch-exit function. Check out his post for the details.

Dyer admits that this is a small thing and even makes a back of the envelope calculation of how long it will take him to recoup the time he spent implementing the solution. Of course, sometimes it’s the journey and what we learn along the way that’s important and this is probably one of those times.

Regardless, if you find yourself often searching for and opening a file in Dired, you may find Dyer’s tip useful. At least you will if you care about saving a keystroke with each operation.

Posted in General | Tagged | Leave a comment

Batsov Tries Vim (Again)

When the Eagles disbanded after a particularly contentious Long Beach concert where Glenn Frey and Don Felder almost came to blows, Don Henley quipped that the band would get back together when Hell freezes over. Fourteen years later the band did reunite and released their new album, Hell Freezes Over.

I was reminded of that when I read Bozhidar Batsov’s latest post on Rediscovering Vim. Most people don’t know that, like me, Batsov used Vim early in his career. He apparently didn’t stay with Vim too long because of its really hideous extension language. I was less interested in customizing my editor back then and stayed with Vim for many years.

Batsov isn’t, of course, abandoning Emacs. He just wants to “rediscover” Vim and see what he can learn from it. He started out with Neovim, which, apparently, most developers in the Vi camp are using now. But he dropped back to Vim so that he could develop his own configuration just as he had with Emacs.

Batsov likes the way Vim has the notion of “text object” and a uniform way of dealing with those objects. As I’ve said before, that’s what makes it so easy to learn and use the Vim key sequences. I don’t really miss Vim but if I did, it would be that aspect that I’d miss the most.

As I’ve also said before, I have significant muscle memory problems trying to use more than a single editor so we here at the Irreal bunker won’t be recreating Batsov’s experiment. And, really, muscle memory notwithstanding, I have no desire to. I’m perfectly happy with Emacs and indulge what little desire I have to tinker with editors to playing with my Emacs configuration.

Posted in General | Tagged | Leave a comment