Emacs Redux: Emacs Prelude 2.2

Wait 5 sec.

Emacs Prelude 2.2 isout! 2.0 and 2.1 shipped within a few days of each other back inMarch, while 2.2 tookeight months and about 150 commits. It’s a big one!A New LookLet’s start with the most visible change. Zenburn had been Prelude’sdefault theme since day one, and I still love it (I’ve been maintainingits Emacs port for ages, so it’s not like we’re breaking up). Still, atsome point I got tired of looking at it. These days I’m mostly usingTokyo Night and Batppuccin (my take on Catppuccin), which I wrote abouta while ago,and I figured it was time to freshen up Prelude’s look as well.Tokyo Night is the newdefault, with its light variant during the day and the dark one atnight. Prelude follows your system’s light and dark mode where Emacsknows about it, and the clock everywhere else (see automatic light/darktheme switchingfor the gory details). If you’re a Zenburn fan, keeping it is a one-linerin personal/preload:(setq prelude-theme 'zenburn)What’s NewBroadly speaking, this release was about four things: internal housekeeping and consistency (every module is now set up thesame way, the way you’d set things up in your own config) modernizing the internals (more of what’s built into Emacs thesedays, fewer third-party packages, faster startup) covering more of the popular programming languages out of the box better defaults for the UI and the overall experienceHere are the changes I’m most excited about.A Welcome ScreenPrelude now shows you a welcome screen when you start Emacswithout a file to open. It points newcomers at the basics (yourpersonal config, the list of enabled modules, the manual) and giveseveryone quick access to their recent files, projects and bookmarks,plus a tip of the day:M-x prelude-welcome brings it back any time. If that’s not your cupof tea, (setq prelude-welcome-screen nil) turns it off.M-x prelude-doctorWhen something doesn’t work, the first question is usually “what’smissing?” M-x prelude-doctor answers that for you. It checks theprograms Prelude relies on (git, ripgrep, a C compiler fortree-sitter grammars), the grammars and language servers of themodules you’ve enabled, modules that do the same job (e.g. Company andCorfu), and the obsolete Prelude hooks your config still uses:It also lists the modules that were added to Prelude since you made yourcopy of the modules file, which is a nice way to find out about newmodules. And the report is exactly what a bug report needs, so paste itthere.More Languages Out of the BoxJava, C#, Kotlin, PHP, Swift, Julia, R, Nix, SQL, Terraform and Zig gotmodules of their own, so Prelude now covers most of the popularlanguages out there. More importantly, the experience of opening a filein a new language got a lot better. Prelude offers to install a missingtree-sitter grammar the first time you need it (and falls back to theclassic major mode if you say no), and it starts a language server onlyif there’s one installed, mentioning it once if there isn’t. No moreEglot complaining every time you open a file. Here it is for a Goproject on a fresh install:M-x prelude-treesit-install-grammars installs the grammars of all themodules you’ve enabled in one go, if you’d rather get that out of theway.Just EmacsThis one isn’t exciting, but it’s the change I like the most. Preludehas always tried not to feel alien to people who know Emacs, yet overthe years the modules picked up Prelude-specific ways of doing things -prelude-ruby-mode-hook, prelude-ruby-mode-defaults and the like.Now every module installs its packages with use-package and sets upits major modes with a named function on the mode’s own hooks:(add-hook 'ruby-mode-hook #'prelude-ruby-setup -50)(add-hook 'ruby-ts-mode-hook #'prelude-ruby-setup -50)The depth of -50 means Prelude’s setup runs before your own functions onthe same hooks, so your config always has the last word. Want somethingextra in Ruby buffers? Add it to ruby-mode-hook, like you would withoutPrelude. Want Prelude’s setup gone? remove-hook does the trick. All ofPrelude’s options also work from M-x customize now, and there’s a newmanual page on writing a module for those of you who’d liketo contribute one.Faster StartupI still think that startup time doesn’t reallymatter,but Prelude now starts in about 0.4 seconds in a terminal with thedefault modules (down from 1.3). There’s a new early-init.el thattunes startup, packages are no longer initialized twice, the shellenvironment is read only for GUI frames and daemons, and a bunch ofthings (TRAMP, Eglot, calc, etc) are loaded only when you need them.You can keep your own early settings in personal/early-init.el.Odds and EndsA few more things worth mentioning: The Vertico module got Embark(C-. and C-;), the vertico-directory extension and consult’snarrowing (e.g. < b in consult-buffer shows only buffers). repeat-mode and context-menu-mode are on by default. New optional modules: Corfu (as an alternative to Company), Apheleia(async format on save), eglot-booster, Forge, MisTTY and AI (a thinwrapper around gptel). You can pick jinx as the spellchecker and ws-butler forcleaning up whitespace, if you prefer them to the defaults. Prelude installs fewer packages - browse-kill-ring,discover-my-major, smartrep and gist are gone, as are which-keyand editorconfig on Emacs 30+, where they’re built in. The manual has a new page on how Prelude differs from stockEmacs, which is handy when you’re wondering why a keydoesn’t do what you expected. Lots and lots of bug fixes (the installer in particular got somemuch needed love).The changelog has the full list.UpgradingMost setups should keep working as they are, but a few things changed:the theme, a handful of key bindings (e.g. the Go test commands, someIvy and Org keys, and M-y is Emacs’s own yank-pop again),prelude-require-package is deprecated in favour of use-package, andthe prelude-*-mode-hooks are obsolete (they still run, andprelude-doctor will tell you which ones you’re using). The upgradenotes cover all of that, so give them a quick read beforerunning M-x prelude-update.15 Years LaterPrelude turned 15 this year, and it’s in better shape today than it hasbeen in a very long time. I’ve got a few more ideas for 2.3, and I hopeit won’t take eight months this time.1 As always, thanks to everyonewho reported problems, sent patches and kept using Prelude over theyears! You rock!That’s all I have for you today. Keep hacking! Famous last words.&nbsp;↩