Bespoke Notetaking with Org-mode

Matt Young over at Code Thrasher describes his bespoke notetaking workflow based on Org-mode. Rather than depend on packages like Org-roam for things such as backlinks, Young implemented his own version that worked just the way he wanted.

For example, in addition to backlinks, Young implemented a database that linked a person in his database to the any headlines that involved them. That allowed him to answer question like, “Who did I discuss [some topic] with?”

His setup is very idiosyncratic but finely tuned to work exactly the way he finds most useful. Others who don’t want the heavy machinery of things like Org-roam may find his system useful.

Regardless, the main takeaway for me is that his workflow is yet another example of how flexible Emacs is. You can bend it in almost any direction to get just the workflow you want.

Posted in General | Tagged , | Leave a comment

Why Use Org

Over at the Emacs subreddit, YakumoYoukai wonders why he should use Org-mode. He’s not some clueless n00b whining that it’s all too hard and why should he bother anyway. YakumoYoukai is a 30 year, dedicated, user of Emacs who doesn’t get what Org-mode is about and is looking for some tutorials or overviews.

You see this type of request a lot. They all result from the natural desire to understand everything that Org can do or to at least have an overview of its capabilities. The truth is Org is ever-evolving and it’s hard to get a grasp on the overall picture. Org-roam is an example. It’s a fairly new addition to the Org panoply that didn’t exist for most of the life of Org-mode so if your view of Org was not formed recently, it’s out of date.

My advice to people like YakumoYoukai is what it’s always been: don’t try to understand the whole package. Instead, pick a particular problem and investigate how Org can help with it. It’s much easier to find videos and tutorials dealing with some particular aspect of Org than it is to find any that cover the whole package.

Once you’ve solved that first problem, look at what else Org might help you with. My own journey started with using Org as a sort of time logging application. I expanded that into a more general agenda and record keeping application, and finally into my main writing engine. Somewhere along the line I started using code blocks as a sort of low level literate programming. I’ll doubtless use it for additional tasks as they come up.

Even though I’ve been using it almost as long as it’s existed, I still don’t understand the whole package. Like Emacs itself, there’s always more to discover and learn.

Posted in General | Tagged , | Leave a comment

Delete to Trash from Within Emacs

Generally you have to work hard to delete a file from within Emacs but it is possible. The most common way is probably with Dired but my favorite is with Magit. Regardless, once you get used to using Dired or Magit to delete files it can be distressingly easy to inadvertently delete a file.

The problem is that with vanilla Emacs the file is gone when you do. Most modern OS file delete operations move the file to the Trash folder where it can be retrieved but that doesn’t happen when you delete from within Emacs.

Álvaro Ramírez has a solution. It’s possible to tell Emacs to move files to the Trash folder instead of actually deleting them when asking Emacs to remove them. Ramírez’s solution is specific to macOS but the same idea mutatis mutandis should work for any OS that has a Trash folder.

I’ve known about this hack for some time but have never bothered to implement it. That’s just foolish because sooner or later I’m going to lose a file and wish I hadn’t been so lazy. Don’t be like me: tell Emacs to make your deletes provisional. That way if you inadvertently delete a file it will be easy to recover. The change is easy to implement and there really isn’t any reason not to install it.

Posted in General | Leave a comment

Webster’s 1913 Redux

Seven years ago, I wrote about James Somers’ beautiful article on John McPhee’s New Yorker article, Draft #4. If you write any prose at all, I urge, urge, you to read Somers’ article. It will be a revelation to you.

The very abbreviated TL;DR is that after McPhee has done all the creative work on a piece of writing, he looks for ways to “punch up his writing.” He does this by looking up words in his Webster’s 1913 dictionary. Read Somers for why the choice of dictionary is important.

For a long time the dictionary was available on line from the University of Chicago but, sadly, it disappeared and has not returned. Happily, Marcin Borkowski found a way to make the dictionary available from within Emacs. I’ve used it ever since when I’m stuck on finding the right word. If you’re an Emacser, you should follow Borkowski’s recipe and install it in your Emacs too.

I’m revisiting this because Mario Jason Braganza has rediscovered Somers’ post and, like me, was enchanted. Somers’ article tells you how to add the Webster’s 1913 to your macOS dictionary app so you can have it available even if you’re not an Emacs user. Braganza also points to a new on line version of the dictionary that I didn’t know about. Since I do virtually all my writing from within Emacs now, I no longer need an on line version but I’m glad to see this valuable resource available to everyone.

Posted in General | Tagged | Leave a comment

Modulo Bias

A common operation in software is to reduce a larger number to a smaller one by the modulo operation. As a toy example, suppose we have random numbers in the range 0–7 but need to reduce those values to the range 0–4. The standard way of doing that is to reduce the first set modulo 5.

Now suppose the first set is uniformly distributed. That is, each value from 0 to 7 is equally likely. Suppose that we want the reduced set to be uniformly distributed too. Let’s see what happens:

n n (mod 5)
0 0
1 1
2 2
3 3
4 4
5 0
6 1
7 2

Notice that the values 0, 1, 2 occur twice but the numbers 3 and 4 occur only once so the reduced set is definitely not uniformly distributed. That’s because 5 does not divide the number of values in the first set (8) evenly. If the original set had been 0–9, the reduced set would have been uniformly distributed too.

This problem is called modulo bias. I wrote about it in passing in my post on a Diceware implementation. Yolan Romailler has a nice post on modulo bias over at Kudelski Security Research. He gives a slightly larger example of modulo bias, and describes some of the ways of dealing with it. More importantly, he describes how it can be a significant problem, especially in cryptographical applications, where reduction with the modulo operation is common.

If you ever use the modulo operation, you should take a look at Romailler’s post to make sure you aren’t introducing unintended biases.

Posted in Programming | Tagged | Leave a comment

Everyone Has Something To Hide

One of the most ridiculous arguments about privacy is the oft-stated “If you have nothing to hide, you have nothing to fear.” Irreal has many articles debunking this notion—here’s a list—but it seems the argument is evergreen.

Kev Quirk has (yet another) post laying waste to this completely bogus idea. His post, Privacy vs “I have nothing to hide”, takes a critical look at this outrageous argument. If you’ve followed the issue, nothing in Quirk’s article will be surprising but he does point out the reason that no one reads those terms of service that companies use to excuse their behavior. For example, the Paypal terms of service of is longer (in words) than Shakespeare’s Hamlet. Likewise, the Appletunes terms of service are longer than Macbeth. No one, no one, is going to read through all that but the companies will cite your click through as evidence that you’re fine with their spying on you.

As I’ve said before, if you hear someone raise this argument, walk away. The person advancing it either doesn’t know what they’re talking about or they’re trying to run a scam on you. In either case, ignore them. We all, whether we have something to hide or not, are entitled to our privacy and should tell those who say otherwise to go pound sound.

Posted in General | Tagged | Leave a comment

Adopting A New Emacs Workflow

Over at TAONAW, JTR has a short post post on how his changing work duties—that now include more technical writing—has caused him to evolve his Emacs workflow. A lot of his work involves writing Knowledge Base articles that get added to the ServiceNow platform.

Of course, being an Emacs user, JTR wants to do his writing in Emacs and then import it into ServiceNow. He did this by exporting his Org document to HTML and using a browser to paste it into the ServiceNow platform. Apparently Service Now is not very forgiving about its input so JTR had to tweak his Org headers to get acceptable HTML to import.

The real problem, though, was getting changes made within ServiceNow back out to Emacs. There doesn’t seem to be a good way to do that so JTR was reduced to manually copying the changes back to Emacs.

The big takeaway for me in his post was the ends that an Emacs user will go to to do their work within Emacs. I can sympathize. I’m also willing to jump through some hoops just so that I can do my work in Emacs. Once you’ve been spoiled by an Emacs workflow, it’s hard to use anything else.

Posted in General | Tagged , | Leave a comment

Emacs 28.2 Released

Stefan Kangas writes that Emacs 28.2 has been released and is available in the usual places.

As always, thanks to all the developers who selflessly worked to bring us this newest official release of Emacs.

Posted in General | Tagged | Leave a comment

Fast Emacs Startup by Dumping

Many Emacs users obsess about the editor’s startup time. I’ve never understood this. Even if Emacs takes 15 seconds or more to start, who cares? The thing is that if you are using Emacs correctly, you need only start it when you boot your machine or, perhaps, update your packages. The point is, starting Emacs is, or should be, a rare event.

When I moved to Emacs from Vim 15 or 16 years ago, the hardest thing to get used to was not firing up my editor when I needed it. The correct operation was to simply start it once and switch focus to it when I needed it. Even if you can’t break the “startup the editor when I need it” habit, you can still start it once in server mode and simply invoke emacsclient when you need the editor.

Still, some folks can’t let go of the startup time issue. For those people, mmontone has a solution: dump the Emacs image after it has loaded all its packages and been completely configured. You can see exactly how to do it by following the link but Eli Zaretskii notes in the comments that the technique is not yet 100% reliable and you may have to tweak your configuration a bit to get it to work. Even so, mmontone says it’s working well for him.

Again, you’ll be much happier if you accept that Emacs should be started rarely and can wean yourself from worrying about how long those infrequent startups take.

Posted in General | Tagged | Leave a comment

Entering Special Characters with Abbrev

As I’ve said before, I do almost all my writing in Org-mode so entering special characters is easy. I can either use the built-in Org characters or drop into TeX input mode. But, of course, I’m not always in Org-mode. Sometimes I want a special character when entering a Git description—most often → but occasionally others—and there are other situations where I need them as well.

My solution—that I learned from Xah Lee—is to use the abbrev system that’s built into Emacs. Thus, I have the abbreviation /ra for →. The other day, I saw this post by The Emacs Cat on using abbrev for inputting special characters anywhere within Emacs. It’s basically the same system that I use except that I depend on hippie expand to resolve my abbreviations rather than having them expand automatically, which I find jarring.

The Emacs Cat begins each of the abbreviation keys with 8 to avoid having accidental expansions. That’s a good solution and one that many may prefer. Regardless of which method you employ, using abbrev-mode to enter special characters that you need frequently is a win. You can always drop back to insert-char, bound to Ctrl+x 8 Return, to enter those that you don’t use often.

Take a look at The Emacs Cat’s post for the details on how to set things up.

Posted in General | Tagged | Leave a comment