Emacs Is Not Just a Text Editor

Over at the Emacs subreddit, analysis230 has a sort of confession. He had long considered the phrase “Emacs is not just a text editor” to be something geezer developers said as they clung desperately to an aging technology. He says he didn’t even know what it meant.

Then one day for unspecified reasons he decided to move from VS Code to Emacs. He was already familiar with the Vim keybindings so he was up and running (with Doom Emacs) in short order. He really liked modal editing and found himself wishing for a keyboard-driven file manager. That’s when he discovered dired and, as he put it, the penny dropped. He finally understood what everyone meant when they said that Emacs is not just a text editor.

He’s since moved on to installing Mu4e but his story makes an important point: it can be hard to understand and appreciate the power of Emacs until you’ve learned some basics and used it for a while. Lots of worthwhile things in life are like that.

Speaking of the “not just a text editor” quote, analysis230 says,

I know I heard people say that but I always thought of them as denial-filled ramblings of people who have sunk a decade into learning a tool that’s slowly fading. Apparently, not the case at all.

His post is, it seems to me, the perfect answer to those who complain that Emacs has a steep learning curve. It may have but the it’s worth the climb.

Posted in General | Tagged | Leave a comment

Webster 1913 and dictionary.el

Time moves on and things you thought you knew turn out to be not as accurate as you hoped. This happened to me recently in regard to using the Webster 1913 dictionary in Emacs. I recently posted about James Somers’ article on Webster’s 1913 and how to use it from withn Emacs. In it I repeated my advice to follow Marcin Borkowski’s recipe for making this wonderful resource available from within Emacs.

In the comments to that post, acdw and Brian Green note that the dictionary is now available from dict.org and that—as of Emacs 28—you can access it from the built-in dictionary-search. That means that any Emacs user can take advantage of this splendid resource without downloading extra packages or data.

If you call dictionary-search without configuring anything, it will prompt you for the dictionary source with a default of dict.org. As Green says, you can avoid that by simply adding

(setq dictionary-server "dict.org")

to your init.el.

That will give you all the definitions from Weber’s 1913 as well as the other dictionaries located at dict.org. If you’re coming to this post without the benefit of reading the backstory, you should definitely read Somers’ post, You’re probably using the wrong dictionary to see why you should bother with Webster’s 1913 to begin with. It is not, after all, the most modern dictionary but as Somers explains, it is the best if you’re looking for just the right word.

UPDATE [2022-10-06 Thu 20:18]: Fixed link to previous post.

Posted in General | Tagged | Leave a comment

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