<div dir="ltr"><div><div><div>Hi all,<br><br></div>Just wanted to share a trick I found for using the LLVM coding style in Emacs, although I'm sure this is nothing new to veterans around here. There's an LLVM coding style emacs plugin in /utils/emacs/emacs.el. However this uses a string match against "llvm" to try to guess if the current directory contains llvm sources. A simpler method is to use Emacs directory variable support (<a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html">https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html</a>). Just drop the following lines into a .dir-locals.el file in the root of the LLVM sources, and all files in the source tree will pick up the correct formatting settings:<br><br>((nil . ((indent-tabs-mode . nil)<br>         (fill-column . 80)<br>         (c++-indent-level . 2)<br>         (c-base-offset . 2)<br>         (c-offsets-alist . ((innamespace . 0))))))<br><br><br></div>I hope this helps someone!<br><br></div>- stephen<br></div>