[erlang-questions] Controversial subject of the day: tabs and spaces for indentation

Magnus Henoch <>
Wed Feb 5 20:13:01 CET 2014


Ulf Wiger <> writes:

> One thing for emacs users (or those who need to deal with them) to do is to insert the following at the top of each erlang module:
>
> %% -*- erlang-indent-level: 4; indent-tabs-mode: nil -*-
>
> (Perhaps others have suggestions for the ultimate settings here)                    

As of Emacs 23, you can specify settings for an entire directory tree by
creating a .dir-locals.el file in the top directory.  It needs to be in
Lisp format, so pay attention to dots and parentheses:

((erlang-mode
  (erlang-indent-level . 4)
  (show-trailing-whitespace . t)
  ;; http://www.emacswiki.org/emacs/TabsSpacesBoth
  (indent-tabs-mode . nil)))

Regards,
Magnus



More information about the erlang-questions mailing list