A N00b Reminisces

Over at the Emacs subreddit, Ok-Machine-6265 is a new(ish) Emacs user who has some thoughts after using Emacs for about a year and a half. His experience has been good. He loves the power that Emacs gives him and lists some of its many benefits:

  • Configurability
  • Visibility into all aspects of Emacs’ code and data
  • Keyboard centricity: no mouse required
  • Stability: core functions just work

and finally, Emacs is an editor for hackers and those who want to make it their own. You don’t have to customize it, of course, but if you need special operations, Emacs makes it possible and easy to add then.

As usual, a lot of the wisdom is in the comments. Ok-Machine-6265 had a few complaints:

  • Emacs can be slow to load large files
  • There are so many commands that it’s easy to forget their key bindings.

The commenters suggest many solutions to these problems. For example, the wonderful which-key goes a long way in helping you remember key sequences. It’s a third part app that I’ve been using for a long time but, happily, it will be builtin as of Emacs 30.

One of the things that Ok-Machine-6265 says is that Emacs is 100% configurable and one of the commenters objected to that saying that, for example, changing the behavior of Meta in Org mode is apt to break things. The commenters responded, and I agree, that 100% compatibility is not the same as easily reconfiguarable. It may be easy or it may be hard but at the end of the day, almost everything in Emacs is configurable.

Posted in General | Tagged | Leave a comment

Inlining The Previous Result In Edebug

Álvaro Ramírez has a very nice post about improving the edebug dislay. He starts be recalling the now nearly 10 year old post from Artur Malabarba on why you should learn to use edebug, the source level Elisp debugger. He says he uses it all the time when he wants to tweak some Emacs behavior.

Edebug will, among other things, let you step through a function and display the results of each expression to the minibuffer. That’s really handy but Ramírez finds it jarring to have to repeatedly move his eyes from the code buffer to the minibuffer. Being Ramírez, he decided to do something about it.

The TL;DR is that he advised the function that displays the value so that the result is displayed on the current line. You can see what that looks like from the animated GIFs on his post. It does seem like a much smoother result and I hope he submits a version upstream as a permanent change.

The big takeaway for me, though, is his account of how he tracked down the appropriate code to advise. If you want to tweak Emacs to do things your way, being able to find the code that needs tweaking is a prerequisite. You can learn a lot about how to do that from Ramírez’s post.

The post is definitely worth a few minutes of your time even if you don’t care about how edebug displays its results. It’s a great example of how it’s not that hard to track down the code that needs your attention.

Posted in General | Tagged | Leave a comment

Casual Ibuffer

Charles Choi is back with a new member of his Casual suite. His Casual suite, in case you don’t know, is a collection of transient based menus to make dealing with Emacs major modes and subsystems easier. Choi’s latest addition is for the ibuffer major mode. If you’re like me, you know exactly two commands for this. The first is to change to a named buffer (Ctrl+x b) and the second is to bring up a list of all the active buffers (Ctrl+x Ctrl+b).

Once you have the list of buffers (the ibuffer list), you’re probably aware that you can do some operations on it but, again if you’re like me, you know only a couple of them. One of the things I learned from Choi’s post is that are an astounding 132 commands available in the ibuffer listing. Who knew.

With that many commands, there’s virtually no chance of remembering them all. That’s where Casual Ibuffer comes in. As with the other Casual apps, it doesn’t try to cover every single command but provide easy access to those you’re most likely to use.

As I said, I always thought of the ibuffer list as simply a list and had no idea of all the hidden functionality hiding in it. Just reading through Choi’s announcement will show you how wrong that idea is. The real value, though, is opening our—or at least my—eyes to a whole new set of powerful commands for dealing with buffers, which are, after all, the fundamental Emacs construct.

Posted in General | Tagged | Leave a comment

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