10 Feb 2026
Deburring Emacs Imenu GUI Configuration
A while back, I made a post on Emacs Imenu configuration that made an unsafe assumption that any mode derived from prog-mode would support Imenu. Turns out, that’s not always true (for example, looking at you gnuplot-mode). This post shows how to deal with this using an error handler.
One such implementation of an error handler is the lambda expression shown below using condition-case.
1 2 3 4 5 6 | |
A couple of observations:
- The error handler is opportunistic in applying
imenu-add-menubar-indexto a mode derived fromprog-mode. - If the error
imenu-unavailableis caught, then a warning message is logged but not messaged to the mini-buffer.- The variable
inhibit-messageis used to avoid sending a warning message to the minibuffer (it will still be logged in *Messages*) to avoid noise from modes that do not support Imenu. (Thanks to bpalmer for this guidance.)
- The variable
If you use Emacs and this is the first time you’ve heard of Imenu, I highly recommend that you learn what it has to offer.
Past Articles
| 7 FEB 2026 |
Using Casual to work with Emacs Registers, Rectangles, and WindowsUse Casual to effectively use Emacs registers, rectangles, and windows on the regular. read more |
| 26 JAN 2026 |
Getting Eshell nth History to WorkOut of the box, Eshell nth history recall is disabled. Here’s how to turn it on. read more |
| 22 JAN 2026 |
Announcing Casual EWWAnnouncing Casual support for EWW, a web browser within Emacs. read more |
| 6 JAN 2026 |
Announcing Casual HTML & CSSAnnouncing Casual support for the HTML and CSS editing modes in Emacs. read more |
| 4 JAN 2026 |
Moment - Thursday January 01, 2026 00:06 PSTPhoto taken Thursday January 01, 2026 00:06 PST. read more |
| 30 DEC 2025 |
F16 F17 F18Binding the function keys above the number pad to window management has been a total win for me. Perhaps it might be the same for you. read more |
| 17 DEC 2025 |
Export Org to Markdown with the ClipboardA companion post to my last one on importing Markdown to Org, but the other way around. read more |
| 4 DEC 2025 |
Import Markdown to Org with the Clipboard in EmacsImport Markdown from other apps into your Org files easy. read more |
| 24 NOV 2025 |
Announcing Casual CSVIf you need to work with CSV files in Emacs, Casual with |
Page 1 / 18 >