Is Emacs Bloated?

Icy-Repair8024 says he’s a new Emacs user who started using it believing that Emacs was a “lightweight” editor but upon discovering all its features now believes it’s bloated and wonders if he should give up on it. I have to admit that that’s the first time I’ve ever heard the claim that Emacs is a lightweight editor. You almost always hear the reverse. I suppose that compared to Electron-based editors you could argue that Emacs is comparatively lightweight but no one ever does.

It’s interesting to read the comments. Most of them

  1. Scoff at the idea that Emacs could be described as lightweight in any meaningful way, and
  2. Make the point that whatever bloat there is doesn’t matter because most features you don’t use aren’t loaded and don’t take up much space on the disk.

A bigger question, to my mind, is what, exactly, do we mean by bloated. Some of the comments make the point that Emacs is, in fact, more a Lisp Machine than an editor so of course it has a lot of features and the ability to easily add those features is one of its strengths. Its memory and disk storage footprints are modest by today’s standards so Emacs can’t reasonably be said to be a resource hog.

One of the commenters notes that Icy-Repair8024’s account history shows that he’s merely trolling. I don’t know if he is or not but if it was a troll, it didn’t work. There were no angry retorts or denunciations, just reasoned rebuttals that marshal the facts.

My takeaway is that of course Emacs isn’t lightweight in any way that matters and that we should stop obsessing about its so called bloat and instead embrace its many features whether or not we use any particular one.

Posted in General | Tagged | Leave a comment

Moving To The Beg/End Of Structures

Over at the Emacs subreddit, justsellingmykeeb asks for the best way of moving to the beginning or end of various structures such as regions delimited by some sort of brace or HTML tag. I usually use Ctrl+Meta+f, Ctrl+Meta+b, and, when I remember, expand-region for this but those don’t always do exactly what I want.

There are a lot of good answers in the comments and they’re definitely worth reading if you have the same problem. These range from the simple like expand-region to the more complex like paredit. I like the simpler answers—even though I am a paredit user—because I’m terrible at remembering key shortcuts that I don’t use frequently. Maybe Charles Choi should consider a paredit porcelain.

Regardless of your proclivities, there’s probably a suggestion in the comments that will work for you. Take a look and see.

Posted in General | Tagged | Leave a comment

Configuring A Private Ispell Dictionary

Chris Maiorana has a useful piece of information for all Emacs users. If you’ve used Emacs at all for writing you’re doubtlessly familiar with ispell. I’m a terrible speller and absolutely couldn’t live without it. I have it set up with flyspell so that my frequent typos/misspellings are highlighted in the buffer as I make them. All it takes is a single keystroke to correct—or at least suggest a list of corrections to—the error.

You can configure various dictionaries for use with ispell but whatever you choose you will inevitably encounter correctly spelled words that are not in the dictionary. Perhaps it’s your last name, the name of your blog, or a technical term; you’re going to have it pop up as an error every time you use it.

Maiorana tells us how to have a “private dictionary” to which we can add these outliers and have them accepted by ispell. It’s a small thing, I suppose, but it’s nice to be able to write without having a bunch of errors pop up.

It’s pretty easy to set up. All you need to do is specify a file to hold your outlaw words and then add your private words to it. That’s easily done as the errors pop up. A simple keystroke adds the unknown word to your private dictionary and you never have to worry about it again.

It’s a short post and well worth a couple of minutes of your time to read if you’re tired of having special words that you use all the time pop up as errors.

Update [2024-07-06 Sat 16:56]: Added link to Maiorana’s post.

Posted in General | Tagged | Leave a comment

Ready Player Mode

Álvaro Ramirez has announced another of his “ease my workflow” projects. Like many, or perhaps most, of the best projects, this one was conceived to scratch an author’s itch. This particular itch was finding a way of taking a quick look—or listen—to a media file from within Emacs.

It’s pretty easy to launch an external app to display or play a media file but Ramírez wanted to take his quick peek without leaving Emacs. He was inspired by image-mode and used it as a model for his solution. He liked being able to get out of the app quickly by simply pressing q and being able to navigate between media files in a directory easily with n and p. The actual playback is handled by one of mpv, vlc, ffplay, or mplayer according to the user’s configuration or by simply trying each of them in the order listed.

The application is brand new, has been tested only on macOS, and is not yet on Melpa but it is available from his from GitHub repository if it sounds like something you need right now. If it sound intriguing but not urgent you should probably wait a bit until he gets the wrinkles ironed out.

In any event, it’s one more way of staying in Emacs while still performing (non-editing) tasks on your computer.

Posted in General | Tagged | Leave a comment

Charles Choi on Imenu

Charles Choi has an excellent post on imenu. I’ve used it for a long time via the excellent councel-imenu but I’ve never really understood its scope or essential raison d’être. I’ve always thought of it as a way of locating functions and variables in a programming language buffer but that turns out to be a very circumscribed view of its purpose.

Choi has a much better explanation. He explains that what it really does is index many types of files that have some sort of definitions. This includes programming language files, of course, but also text files such as Org, Markdown, and other structured files.

You can get a feeling for how it works by trying it out on various types of files. It’s builtin so there’s no need to load it or do anything special to try it out. If you’re a swiper user, I recommend binding some easy binding to councel-imenu. I have it bound to Ctrl+. so it’s easy to invoke. Councel-imenu will bring up a completing read list of targets in the minibuffer that makes it easy to select the target.

Take a look at Choi’s post for other ways of using imenu. If you’re a menu user, you can easily add it to the menu. If, like me, you avoid the mouse, imenu is completely accessible through the keyboard. Choi recommends having it enabled by default but I find that having it an easy key shortcut away works well for me.

Posted in General | Tagged | Leave a comment

Programming Fonts

Many, many years ago I adopted the Inconsolata font because it was one of the first widely available, free, antialiased programming fonts. In those days, I was still using Vim but when I moved to Emacs, I brought it along with me. From time-to-time I see recommendations for the “ultimate” programming font but I always stay with Inconsolata.

Once you’ve dealt with antialiasing, I think that the critical aspects of a programming font are:

  • Distinguishing between oh and zero in a visually obvious way
  • Distinguishing between el, eye, and one in a visually obvious way

It’s a bit shocking how many fonts get this wrong.

Over at Evil Martians there’s a nice post on what constitutes the perfect coding font. That includes my desiderata about 0, o, O, i, I, l, L, 1 but also considers additional characters than can cause confusion. The post recommends

  • Widening the various brackets types so they can be more easily distinguished
  • Making the hyphen and the minus signs the same
  • Making ^ and * resemble the corresponding mathematical symbols
  • Mathematical symbols, ticks, and quotes should not be too small
  • Slashes and bars should be centered

These are all useful criteria but I’m happy if I can distinguish zero and one from other characters. The comments over at reddit suggest all sorts of recommendations for the perfect programming font but, as I say, I’ve been happy with Inconsolata for a long time and probably won’t be changing.

Posted in General | Tagged , | Leave a comment

EmacsConf 2024: Call For Participation

Planning for the 2024 EmacsConf is underway and the organizers are calling for participation. “Calling for participation” means they’re asking folks to submit proposals for talks. The conference will again be virtual and take place on December 7th and 8th.

If you’re interested in contributing, the organizers would like to hear from you as soon as possible but in any event by September 20. Your talk can be short (about 5–10 minutes) or long (about 20 minutes). If you’d like to give a longer talk, that can be arranged too: get in touch with the organizers.

EmacsConf is a great way to share your ideas and get some exposure. It’s virtual so there’s no expensive travel involved. Even if you are unavailable for questions on the day(s) of the conference, the organizers can accommodate that so if you think you have something to say, sign up for talk. The talks are prerecorded so you don’t have to worry about stage fright.

These conferences are a font of great ideas so whether or not you give a talk, be sure to be there. Even if you can’t be there, the talks will be available as recordings so you can enjoy them at your leisure but you won’t be able to join in the after talk discussions.

Posted in General | Tagged | Leave a comment

Gotos Considered Maybe Not Harmful

Way back in 1968, Edgar Dijkstra published a famous letter to the Communications of the ACM that explained why he felt the go to statement was being abused. Ever since then, lots of uninformed folks who haven’t bothered reading it and have missed the nuances in Dijkstara’s argument have been invoking it in what amounts to a jihad against using gotos in any circumstance. The letter almost wasn’t published because the editors felt it wasn’t that interesting and the famous title, “Go To Statement Considered Harmful” was actually written by one of the editors not Dijkstra.

The truth is, there are lots of circumstances in which gotos make perfect sense. I’ve used them myself but I always felt the need to document why my use didn’t violate some sacred dictum by referring to this paper by Knuth in the source code. It saved me a lot of pushback and I could tell those who persisted in arguing the point to direct their comments to Knuth.

Now Joe Marshall offers another example of acceptable goto use. It’s not clear from his post whether he’s using an explicit goto or merely pointing out that gotos occur implicitly in all programming languages. Certainly, the example of tail recursion is like that. His point is that tail recursion is simply a goto even if there’s no explicit goto involved.

The use of gotos that Dijkstra was arguing against is clearly a bad thing but that doesn’t mean that their use in specialized situations is a sign of sin.

Posted in General, Programming | Leave a comment

Favorite Emacs Utilities

Over at the Emacs subreddit, Phovox—a 30-year Emacs user—asks what your favorite Emacs utilities are. He’s started using Doom Emacs and has discovered, through Doom, utilities that he didn’t know about. So he’s wondering what else he may have missed and is asking the community what they recommend.

Some of the answers were general things like the ability to use Emacs to change virtually any part of Emacs to suit your preferences. Others were more on point and included things like Dired, Hippie-expand, the classical version control system, Ediff, Magit, Calc, Org, Projectile, LSP, and Replace-regexp.

Some of the other commenters mentioned third-party packages such as Hyperbole and Everything.

The best advice, I think, came from Wumpitz. That is to spend some time with the Emacs manual. It’s too much to try to read it straight through, of course, but you can decide to read one chapter every day or week. It is, says Wumpitz, amazing how much you don’t know about some of the basic utilities.

All the action is in the comments so take a look to see if there’s some utility you should be using but aren’t.

Posted in General | Tagged | Leave a comment

Emacs For Writing

There’s a great question and answers post over at the Emacs subreddit. The question, from lynnlei, asks how a prose writer who has been using Vim should approach moving to Emacs. This comes up a lot, of course, and it’s always the comments that provide value. I like reading them because I almost always learn something new about Emacs.

That’s certainly the case here: I learned about org-novelist, which will be the subject of an upcoming post even though, as I recently said, I don’t write novels. Even so, it has lots of capabilities to help with any long(ish) form writing.

The rest of the comments are interesting and helpful too. There’s no ankle biting or silliness so you might learn something useful for your own workflow.

A lot of the things we Emacers take for granted seem mysterious and marvelous to immigrants so posts like this are really useful to get new users oriented. They’re also useful to introduce oldtimers to Emacs features that they were previously unaware of.

Lynnlei said she wasn’t interested in Evil, even though she is coming from Vim, and that leads to some interesting discussions on packages that are probably best thought of as “evil-light”. Whether you’re coming from Vim are or an old-time Emacs user, there’s probably something worthwhile for you in this post. The comments are definitely worth perusing.

Posted in General | Tagged | Leave a comment