xv6, line by line
.dir-locals.el

.dir-locals.el

Emacs Lisp · 4 lines · annotated 100% · upstream

About this file

Settings for the Emacs editor. When you open a file anywhere under this directory, Emacs reads .dir-locals.el and applies the variables listed for that file’s mode. Here they apply to C files only, and make Emacs indent the way the xv6 sources are written: two spaces per level, no tab characters. Users of other editors get the same from .editorconfig, and make fmt (.clang-format) enforces it.

The file is written in Emacs Lisp: a list whose first element names a major mode (c-mode), followed by (variable . value) pairs.

1((c-mode
2 (indent-tabs-mode . nil)
3 (c-file-style . "bsd")
4 (c-basic-offset . 2)))