2026-11-09 A tip on removing functions from hooks interactively

When I customize my Emacs, I often utilize hooks. However, when experimenting, I often inadvertently add the wrong thing to a hook – a function I later decide to rename or even a lambda. I have always painstakingly written the correct remove-hook invocation to remove it. A few days ago it occurred to me that it would be nice to write an interactive wrapper around remove-hook to make it easier. As usual in such cases, I started with a bit of research to see if someone did something similar already. To my surprise, not only is this a solved problem, but it’s solved in Emacs itself! Apparently, almost six years ago remove-hook was made into a command and you can just M-x it, provide the hook variable name and use autocompletion to decide what to remove from it (including lambdas!). How cool is that?

See you next time!

CategoryEnglish, CategoryBlog, CategoryEmacs