// EMACS-ELISP — ENGINEERING REPORT

Emacs major mode for Emacs Lisp (elisprs) · derives from emacs-lisp-mode · elisprs subr/special-form font-lock · run via elisp · LSP via elisp --lsp · DAP via elisp --dap · verified with batch face assertions

>_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.rsSPECIAL_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.

252
Subrs (built-in functions)
18
Special forms
270
Corpus entries (generated)
emacs-lisp-mode
Parent mode
2
LSP clients (eglot + lsp-mode)
4
Detection paths (.el + .emacs + _emacs + shebang)
13
Face assertions
27.1
Min Emacs version

~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.

ComponentDetail
elisprs-mode.elMajor 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.elGenerated builtin surface (18 special forms + 252 subrs) with signatures + docs, sourced from elisprs/src/lsp.rs. Byte-compiles cleanly; loads instantly.
scripts/face-test.elFontify a sample buffer and assert the face at each probe token.
elisp --lsp / elisp --dapLanguage 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 tokenAsserted face
defun / let / when / setq / defvarfont-lock-keyword-face
message / cons / concat / lengthelisprs-subr-face
greet (definition name)font-lock-function-name-face
:ok (keyword symbol)font-lock-builtin-face
double-quoted stringfont-lock-string-face
; commentfont-lock-comment-face