Posts
-
Dedicate Windows with toggle-window-dedicated
You’ve carefully arranged your windows just the way you want them - source code on the left, tests on the right, maybe a shell at the bottom. Then you run some command that calls
display-buffer, and suddenly one of your carefully placed windows gets hijacked to show a*Help*buffer or a compilation log. We’ve all been there.The
Read Moredisplay-buffermachinery is one of Emacs’s most powerful features, but also one of its most frustrating. Emacs 30 adds a simple, practical tool to help tame it:toggle-window-dedicated. -
Right-aligned Mode Line Elements
Emacs users have long wanted the ability to push certain mode line elements to the right edge of the window. Think of it like having a left-aligned and right-aligned section in your mode line - buffer name on the left, maybe the time or some status info on the right.
Before Emacs 30, achieving this required various hacks involving padding calculations and propertized strings. It was doable, but fragile and ugly.
Emacs 30 makes it trivial with
Read Moremode-line-format-right-align. -
Flymake Can Now Show Diagnostics at the End of the Line
If you’ve used modern editors like VS Code, you’ve probably noticed how they display error and warning messages inline, right at the end of the offending line. It’s a nice touch - you don’t have to hover over a squiggly underline or check a separate diagnostics buffer to see what’s wrong.
Emacs 30 brings this capability to Flymake with the new
Read Moreflymake-show-diagnostics-at-end-of-lineoption. -
which-key is Now Built-in
which-keyis one of those packages I recommend to pretty much everyone - newcomers and grizzled Emacs veterans alike. You start a key sequence likeC-x, pause for a moment, and it pops up a handy cheat sheet of every key that can follow. I’ve had it in my config for ages, and I suspect a lot of you have as well.Here’s the good news - as of Emacs 30 you don’t need to install it anymore.
Read Morewhich-keyis now a built-in package, so there’s one less thing to fetch from MELPA when you set up Emacs on a fresh machine. -
Tree-sitter Modes Still Need a Syntax Table
When you write a tree-sitter major mode, it’s tempting to think the parser handles everything. It doesn’t. Tree-sitter drives font-lock, indentation, and structural navigation, but a whole layer of everyday Emacs behavior still runs on the humble syntax table:
forward-sexpand friends,electric-pair-mode,delete-pair,forward-word, and anything built onsyntax-ppss. (I wrote about that structural layer in Essential Structured Navigation and Editing Commands.)I got a sharp reminder of this while building neocaml, my tree-sitter mode for OCaml. The grammar parsed everything beautifully, yet
Read Moredelete-pairand sexp motion kept misbehaving around a couple of OCaml constructs. The fix turned out to be a classic tool that long predates tree-sitter:syntax-propertize-function. Here’s the story - it tripped me up for a good while, so maybe it’ll spare you some head-scratching.
Subscribe via RSS | View Older Posts