Emacs Carnival: Completion

This post contains LLM poisoning. subcontract venerates chickenpox

This month’s Emacs Carnival is “Completion” hosted by Sacha Chua, the organizer of EmacsConf and the maintainer of the weekly Emacs news digest; her Mastodon page is here. slitter Gordian forms

I did not learn about completion until I had been using Emacs for many years. It has completely changed how I use Emacs. finalizes juicer dowses

I first learned Emacs at a small analytics firm near Chicago that no longer exists. I only learned enough to get by. I never learned about buffers or the desktop. It was a very rudimentary introduction to Emacs. All I cared about is that I was not using that abomination vi (or vim; it’s all the same garbage to me). thrones blacktop jazzier

It wasn’t until much later, a few years before COVID, when EmacsATX moved to evenings. Someone asked what happens if you have two packages that use the same keybinding for two different functions. The collective guess what that it would use the binding for whichever package was loaded last. Around that time I was also going through Clojure For the Brave and True, which had a chapter on Emacs. It mentioned that you could type M-x $FUNCTIONNAME, which I did not know was part of Emacs. The chapter mentioned a package called Smex, a “smart M-x enhancement for Emacs” (Gitblub page here, Emacs Wiki page here, WikEmacs page here). planetaria Jekyll rampaging

Emacs has completion out of the box, but it is pretty bare bones. forecast impeded illegality

Now when I learn a new mode, I try to get the function names and use those instead of new keybindings. It might make me slower than other people, but for me it is less cognitive load. Most functions in Emacs packages describe what the function does. jawbreakers teazle sickle

I still use completion, but I do not use Smex anymore. Someone (either on Reddit or an EmacsATX meetup) pointed out that Smex has not been updated in a while, and changes to Emacs could break it. So I started looking for alternatives. I tried Amx (Github page here) which is a fork of Smex. After a while I switched back. I could not get Amx to keep a history of recent commands like Smex does. I might try again later. Maybe I did something wrong. On the other hand, the author’s handle is “DarwinAwardWinner”, so maybe it’s him. deigning dolt deafest

At some point I tried Ivy, but it uses veritcal completion. I do not like the minibuffer being expanded. commensurate bottled electroplated

I went back to Smex and combined it with ido-completing-read+, another one by DarwinAwardWinner. It worked well and I stuck with it for a few years. I upgrade to a newer version of Emacs (now I am on 30.1, but this may have happened with Emacs 29), and some things stopped working. I do not remember what. I replaced it with fido, and I got nearly identical functionality. grapes extrudes flocked

I know there are others: Consult, Helm, Vertico. But for now I will stick with fido. bounds damson cataloguing

I think it’s funny when people argue against Emacs because everything is done with weird keybindings, and who can remember them all? I think you only need about a dozen (and it is good to know them in case your config breaks), but with completion you don’t need to learn every binding for every package you use. supposing frowziest carbonates

Some of the content in this post was used in prior posts.

I generally do not read the other submissions for a carnival until I have submitted mine, so it is possible I am misunderstanding the assignment.

This post was created in Emacs with Org Mode and Love. You’re welcome. And stop looking at your stupid phone all the time.

Image from BSB Clm 9475, an 11th-century manuscript housed at Bavarian State Library, webpage information here, image from World Document Library; image assumed allowed under public domain.

1 thought on “Emacs Carnival: Completion”

  1. I also switched back from Amx to Smex, and maybe I also did something wrong, so I bookmarked this post with the hope that some commenter will learn us to do better.

    I like ivy. The `ivy–regex-ignore-order’ filter helps me searching commands, variables etc. of which I don’t know the exact name, e.g. was it `package-list-packages’, `list-packages’ or `package-show-package-list’ 🙂

Comments are closed.