>_EXECUTIVE SUMMARY
emacs-elisp is the Emacs major mode for Emacs Lisp, targeting the elisprs runtime — Emacs Lisp compiled to the fusevm bytecode VM with a Cranelift JIT. elisprs-mode derives from the built-in emacs-lisp-mode, inheriting its syntax table, indentation, paren handling, and font-lock, then adds a buffer runner (elisp FILE via compile), eldoc + completion over the runtime's builtin surface, an extra subr font-lock layer, an LSP client that launches elisp --lsp, and a elisp --dap debug adapter.
Design principle: the highlighted surface is elisprs' actual runtime surface — the 18 special forms the compiler recognizes and the 252 subrs it implements. Rather than hand-maintain those lists, elisprs-stdlib.el is generated verbatim from elisprs' own LSP metadata (elisprs/src/lsp.rs → SPECIAL_FORMS + SUBRS, each an Entry with name / kind / sig / doc), so eldoc, completion, and font-lock never drift from what the binary evaluates. Deriving from emacs-lisp-mode means the stock lisp editing experience is preserved in full; the runtime tooling is strictly additive.
~WHY DERIVE, NOT REIMPLEMENT
Emacs Lisp already has a canonical, excellent major mode: the built-in emacs-lisp-mode. Reimplementing its syntax table, indentation, and font-lock would be strictly worse. So elisprs-mode derives from it and adds only what is specific to the elisprs runtime: a font-lock layer that gives the runtime's own subrs a distinct face (elisprs-subr-face) — these are plain function calls emacs-lisp-mode leaves unfontified — plus the special forms in font-lock-keyword-face. The builtin surface used for eldoc and completion-at-point is generated from the runtime's LSP metadata rather than hand-authored, so it stays 1:1 with what elisp evaluates.
| Component | Detail |
|---|---|
elisprs-mode.el | Major mode deriving from emacs-lisp-mode — extra subr/special-form font-lock, elisprs-run-buffer (C-c C-c), eldoc + completion, eglot + lsp-mode registration, auto-mode-alist (.el / .emacs / _emacs) + interpreter-mode-alist (elisp), with elisprs-claim-dot-el to opt out. |
elisprs-stdlib.el | Generated builtin surface (18 special forms + 252 subrs) with signatures + docs, sourced from elisprs/src/lsp.rs. Byte-compiles cleanly; loads instantly. |
scripts/face-test.el | Fontify a sample buffer and assert the face at each probe token. |
elisp --lsp / elisp --dap | Language server and debug adapter over stdio; the server is launched with only --lsp. |
$VERIFICATION
CI byte-compiles the package with byte-compile-error-on-warn (warnings are errors) and runs the batch face test. Each probe asserts the actual face text-property after font-lock-ensure.
| Sample token | Asserted face |
|---|---|
defun / let / when / setq / defvar | font-lock-keyword-face |
message / cons / concat / length | elisprs-subr-face |
greet (definition name) | font-lock-function-name-face |
:ok (keyword symbol) | font-lock-builtin-face |
| double-quoted string | font-lock-string-face |
; comment | font-lock-comment-face |