The Emacs Help System

One of the really nice features of Emacs is its builtin help system, which often results in Emacs being described as the self documenting editor. Experienced Emacsers usually take it for granted but it’s really a wonderful thing. There’s no need for storing or losing manuals; it’s all there all the time as part of the application.

Old hands take advantage of this documentation without thinking about it but n00bs may wonder how to get started. Davide Mastromatteo has an excellent tutorial on how to access the Emacs help system and use it effectively. He starts by mentioning the builtin tutorial and recommends that everyone go through it at least once. Fortunately, Emacs will remember where you left off so you don’t to complete it in a single sitting.

Next he mentions that the Emacs manual is also built in (in info format) and easily accessed with the Ctrl+h r sequence. I find it more convenient to access the Web version of the manual but it’s nice to have it available when I don’t have Internet connectivity.

From there Mastromatteo moves on to the three help commands most of us use the most: describe-key, describe-function, and describe-variable bound to Ctrl+h k, Ctrl+h f, and Ctrl+h v respectively.

Finally, he mentions the appropos command (Ctrl+h a) to do fuzzy searches of the help commands. If you’ve been using Emacs for a while, you’ve doubtlessly internalized these commands by now. If you’re new to Emacs, Mastromatteo’s post is definitely worth your while.

Posted in General | Tagged | Leave a comment

Red Meat Friday: Exiting Vim (Again)

One would think—I certainly did—that the “exiting Vim” meme has been exhausted by now and only invoked by the type of people who inspired the eternal September joke. But, it turns out, there is some new wine for the old wineskins. Nicola Fankhauser has this offering, which I must admit, is both new and funny.

And, of course, it offers the excellent advice to embrace Emacs instead. As Fankhauser suggests, someone is trying to start a war. It’s probably some AI that wants to get back to making paper clips. Don’t let this happen to humanity; switch to Emacs while there’s still time.

UPDATE [2023-01-27 Fri 15:14]: Read → Red

Posted in General | Tagged , | Leave a comment

Layoffs Generally Don’t Make Sense

Sadly, our industry is undergoing another of its periodic spasms of layoffs. Most of the major software companies—Google, Microsoft, Amazon, Meta and many others with the exception of Apple—have announced significant layoffs. Almost all of us have experienced this and it’s certainly no fun. Still, we tell ourselves that it’s understandable. After all, it is—at least according to management—a choice between pain for a few or the company going out of business.

It’s a nice story but according to much research it’s just not true. The research shows that layoffs almost never make sense. They don’t really save much money and almost always incur unexpected costs. Why do them then?

Melissa De Witte has an interesting article over at the Stanford Graduate School of Business that discusses the findings of Jeffrey Pfeffer, a professor of organizational behavior at Stanford. Pfeffer says that most of the current layoffs are copycat layoffs, implemented simply because all the other tech companies are doing them. Pfeffer makes the case that layoffs are bad for employees and bad for the companies that implement them.

Pfeffer says that layoffs almost always fail to address the real problems such as an ineffective strategy, too little revenue, or a loss of market share. It’s easy to make this into a management versus worker screed but regardless of your feelings about that it does seem fair to point out that layoffs are often the result of management failing at their jobs and making the workers pay for that failure.

Take a few minutes to read De Witte’s article. It will change the way you think about layoffs.

Posted in General | Tagged | Leave a comment

Warning: You’re About To Discard Undo Information

Just a quickie today. Here’s something I didn’t know:

It’s nice to know that Emacs has our back and warns us when we’re about to lose information or state. I don’t think I ever converted to hexl so I’ve never seen this but it’s nice to know that Emacs, as always, is looking out for us.

Posted in General | Tagged | Leave a comment

Remembering What You Read

Charanjit Singh says he has a hard time remembering what he reads. It’s a common enough problem and Singh has settled on a common solution: he takes notes on what he reads. There are lots of ways of doing that, of course, but this being Irreal, it’s not a hard guess that his note taking workflow revolves around Emacs.

His workflow involves three components:

  1. Emacs
  2. Denote
  3. Spookfox

Spookfox is Singh’s package for talking to Firefox.

He takes two types of notes:

Reading notes
These are notes he takes on what he reads, usually in Firefox, and
Normal note
These are notes that summarize and discuss his reading notes. They link back to the reading notes so that he can see the source.

You can get the details in his post but Singh’s workflow is pretty much like mine except that I use Org mode rather than Denote and talk to my browser (Safari) using some homegrown AppleScript and Elisp glue. It’s a great way of keeping tack of what you read, especially if you read a lot or have a hard time remembering what you read.

Using Org means that it’s easy for me to search my journal—where all these notes go—for a topic or tag. Regardless of the tools you use, taking notes on what you read is a great way of boosting your native memory.

Posted in General | Tagged | Leave a comment

Some Good Advice From Brian Krebs

Brian Krebs over at Krebs on Security has a post on the latest T-Mobile breach in which 10 million users in Australia had their account details stolen by cybercriminals. There aren’t many details about the exploit other than it “abused” an API to gain access to the records.

The majority of the post discusses the consequences of the breach for T-Mobile and most Irreal readers probably won’t find it all that interesting. For me, the most valuable part of the post was the last two paragraphs. The penultimate paragraph begins, “Regardless of which mobile provider you patronize, please consider removing your phone number from as many online accounts as you can.”

Krebs goes on to explain that even though many sites require a phone number to register an account, you can often delete that number on the account management page. That seems like a lot of trouble and you may wonder why it would be worth the trouble. The TL;DR is that having your phone number tied to an account gives criminals an easy way to compromise that account. See the last paragraph of Kreb’s post to see how this works.

Krebs, of course, is a serious security researcher and his recommendations should be taken seriously. Between this breach and the one in 2021, T-Mobile has leaked the details of 50 million accounts. Even if you’re not a T-Mobile customer, your carrier may be next so it makes sense to reduce the attack surface as much as possible.

Posted in General | Tagged | Leave a comment

Flexible Grepping With Deadgrep (or Ripgrep)

For those who don’t know, deadgrip is an Emacs interface to ripgrep. It displays the results in an Emacs buffer along with some ancillary information. Check the example at the deadgrip link for some example output. Ripgrep, of course, is a powerful and speedy grep utility; deadgrep provides a nice interface for Emacs users. It’s a bit like counsel-rg but provides a little more context.

James Dyer is a deadgrep user but wanted a little more flexibility. Normally, he’d like to search for whatever’s at point and he almost always wants to search his entire user directory rather than the current directory. When he’s in a Dired buffer, though, he just wants to enter the search string because the Dired buffer mostly has file and directory names.

He has an alternate form that does the same thing but uses the current directory. Between the two functions he has most of his needs covered. The amount of code he needed for this is minimal and easily copied to your init.el. If you’re not a deadgrep user, you can very easily modify it to call ripgrep directly.

I’m happy with counsel-rg but if you’d like a slightly better display and a bit more flexibility, Dyer’s post is worth a look.

Posted in General | Tagged | Leave a comment

Writing Prose With (Doom) Emacs

Over at (:doom discourse), Mediapathic has a very nice post on using (Doom) Emacs for prose writing. He’s a writer currently working on a book so he can offer firsthand experience. The unifying theme of his post is using the Org outliner to structure and control your writing.

It isn’t so much about first writing an outline—although you can do that if that method works for you—but using the outliner functionality to write your prose in any order that you like and then easily move things around to achieve a coherent whole. Much of his post discusses ways to do that moving of things around and to generate an overview of your work.

Mediapathic makes use of tags to control the export of his text and also to help him track characters and story arcs. He might, for example, include tags for the characters in a scene and also a tag identifying the story arc.

He explains how he captures and keeps notes for his writing. Capturing a note can be especially tricky because you don’t want to lose the context of what you’re working on to capture a note. The Org mode capture functionality is perfect for this: you can pop up a capture template to record your note and get back to what you were doing.

Mediapathic also discusses some ancillary functions such as word counting, writing with a “blank page” buffer, and Palimpsest, a way of removing text but storing it for later retrieval.

If you’re a writer or interested in seeing how Emacs can be used for prose writing, be sure to take a look at Mediapathic’s post. He’s a Doom Emacs user but everything he describes is easily duplicated by vanilla Emacs users.

Posted in General | Tagged , | Leave a comment

Inbox Zero With Mu4e Bookmarks

Years ago, I read and wrote about Ben Maughan’s excellent method of handling his email. It’s an inbox zero method that insists that for each message in your inbox you should

  1. Read and delete it, or
  2. Read and store it in a single folder, or
  3. Read and store it in a single folder and act on it immediately, or
  4. Read and store it in a single folder and create a TODO entry to act on it later

The important thing is that each message is acted on and removed from the inbox immediately. That makes it pretty easy to achieve inbox zero. When I first read Maughan’s post I was still using the Apple Mail app but I was immediately taken with his method and soon moved to mu4e, the mail client he used, and adopted his method.

That method works very well for me but some folks have a lot of email and require a more complicated method. Alain M. Lafon is, apparently, one such person and although he, too, uses mu4e, he uses the mu4e bookmark facility to organize his emails. You can read his post for the details.

For folks like me with a minimal email overhead, Maughan’s method is ideal. I’m inclined to think it would probably work well for those with more robust email requirements as well but I have no first hand evidence. If you think you need something stronger than Maughan’s method, take a look at Lafon’s post for another possibility.

Posted in General | Tagged | Leave a comment

Find Org Files

Howard Abrams has a nifty idea. Open an Org file by its file name, title, or the tags it contains. If, like me, the majority of the files you deal with are Org files this make a lot of sense. When you call org-find-file instead of find-file, you get a list that contains the file name, title, and tags. Since it’s mediated by completing-read you can narrow down the choices in the usual way. Once you make a choice, find-file is called with the file name from the chosen entry.

The design of the command is interesting. Rather than build something like a TAGS file for use by the command, everything happens dynamically in real time. Abrams leverages the speed of the modern grep ripgrep to build the completing-read selection list on the fly. Of course, it’s a little more complicated than that. First, ripgrep is called to gather the titles and then it is called again to gather the tags in each of the files in the target directory.

Most of Abram’s code is concerned with putting together the information and formatting each entry into a nice looking line for the user to select from. The use of ripgrep makes most of it simple. The main difficulty is gathering the tags because they can appear in an Org file in a couple of ways—see Abrams’ post for the details.

If you’re interested in playing around with his code, it’s available in his GitHub repository. It’s a nice piece of engineering and well worth studying for its ideas.

Posted in General | Tagged | Leave a comment