New tools that make Emacs better and faster
Marie-Hélène Burle
March 5, 2024
Introduced in version 24
Lexical binding can be used instead of dynamic binding for Emacs Lisp code
Set as a file local variable
Name resolution depends on program state (runtime context), determined at run time
Global environment for all variables
Makes modifying behaviour easy
Name resolution depends on lexical context (static context), determined at compile time
Local environments of functions and let
, defconst
, defvar
, etc. expressions
Makes compiler optimization much easier → faster Elisp code = faster Emacs
Introduced in version 28
Requires libgccjit
Build Emacs --with-native-compilation
Packages can also be compiled natively (automatic with straight)
Built-in since version 29
Fine-tuned loading of packages with use-package
Integrates nicely with straight
Built-in since version 29
Tree-sitter for Emacs
Code is parsed accurately instead of using regexp
Simplest setup with treesit-auto:
With optional Counsel & Swiper
External packages
Use default Emacs functions (less code)
Faster, flexible, customizable with discrete units
Vertico (frontend for completion in minibuffer)
(use-package vertico
:init
(vertico-mode 1)
(vertico-multiform-mode 1)
:config
(setq vertico-multiform-commands
'((consult-line buffer)
(consult-line-thing-at-point buffer)
(consult-recent-file buffer)
(consult-mode-command buffer)
(consult-complex-command buffer)
(embark-bindings buffer)
(consult-locate buffer)
(consult-project-buffer buffer)
(consult-ripgrep buffer)
(consult-fd buffer)))
:bind (:map vertico-map
("C-k" . kill-whole-line)
("C-u" . kill-whole-line)
("C-o" . vertico-next-group)
("<tab>" . minibuffer-complete)
("M-<return>" . minibuffer-force-complete-and-exit)))
;; save search history
(use-package savehist
:init
(savehist-mode 1))
Built-in since version 29
Eglot (Emacs Polyglot) allows to connect to a programming language server
Need to install an LSP for Julia:
Then run eglot-jl-init
Now eglot
in a Julia buffer connects to the server
In particular,
developers, maintainers, and contributors to Emacs core,
developers and maintainers to some of the mentioned packages:
Daniel Mendler
Omar Antolín Camarena
João Távora
Robb Enzmann
John Wiegley
Adam B
and all their contributors