Posts

  • Declutter M-x with read-extended-command-predicate

    This is another article inspired by my recent cleanup of Prelude and my personal Emacs config, following the one on repeat-mode. I’ve been going through the Emacs 28-30 changelogs looking for features I had overlooked, and this small one from Emacs 28 turned out to be a real gem.

    Ever noticed how M-x shows you every command, including ones that make no sense in your current buffer? Org commands while editing Ruby, Magit commands in a shell buffer, that sort of thing. It’s not a huge deal if you know what you’re looking for, but it adds noise to the candidate list – especially if you’re using a completion framework like Vertico or Ivy that shows everything at a glance.

    Emacs 28 added a simple way to fix this:

    (setq read-extended-command-predicate
          #'command-completion-default-include-p)
    
    Read More
  • Repeat Mode: Stop Repeating Yourself

    I’ve been going through the Emacs 28-30 changelogs recently as part of a big update to Prelude and my personal config, looking for features I never got around to trying. repeat-mode is one I wish I’d adopted sooner.

    How many times have you typed C-x o C-x o C-x o to cycle through a few windows? Or C-x { C-x { C-x { to keep shrinking one? All that prefix repetition is pure friction.

    repeat-mode is a built-in minor mode (Emacs 28+) that lets you drop the prefix after the first invocation and just keep pressing the final key. Enable it with one line:

    (repeat-mode 1)
    
    Read More
  • Creating Emacs Color Themes, Revisited

    Creating Emacs color themes is a topic I hadn’t thought much about in recent years. My first theme (Zenburn) has been in maintenance mode for ages, and Solarized mostly runs itself at this point. But working on my ports of Tokyo (Night) Themes and Catppuccin (Batppuccin) made me re-examine the whole topic with fresh eyes. The biggest shift I’ve noticed is that multi-variant themes (light/dark/high-contrast from a shared codebase) have become the norm rather than the exception, and that pattern naturally leads to reusable theming infrastructure.

    The task has always been simultaneously easy and hard. Easy because deftheme and custom-theme-set-faces are well-documented and do exactly what you’d expect. Hard because the real challenge was never the mechanics – it’s knowing which faces to theme and keeping your color choices consistent across hundreds of them.

    Note: In Emacs, a face is a named set of visual attributes – foreground color, background, bold, italic, underline, etc. – that controls how a piece of text looks. Themes work by setting faces to match a color palette. See also the Elisp manual’s section on custom themes for the full API.

    Read More
  • Automatic Light/Dark Theme Switching

    Most theme families these days ship both light and dark variants. For example, Tokyo Themes has tokyo-day (light) alongside tokyo-night, tokyo-storm, and tokyo-moon (all dark). Batppuccin has batppuccin-latte (light) and batppuccin-mocha, batppuccin-macchiato, batppuccin-frappe (dark). But switching between them manually gets old fast. Here are a few ways to automate it.

    Read More
  • Paredit's Keybinding Conflicts

    Today’s topic came up while I was going over the list of open Prelude issues after doing the recent 2.0 release.

    Paredit and smartparens are structural editing packages that keep your parentheses balanced and let you manipulate s-expressions as units – essential tools for anyone writing Lisp. Paredit has been around since 2005 and its keybindings have become muscle memory for a generation of Lisp programmers (yours truly included). Smartparens inherits the same keymap when used with sp-use-paredit-bindings.

    The problem is that some of those keybindings conflict with standard Emacs key prefixes that didn’t exist when paredit was written – or that have grown more important over time.

    Read More

Subscribe via RSS | View Older Posts