[英]Emacs Erlang mode indenting twice what erlang-indent-level specifies
Emacs is indenting my Erlang twice as much as I think I'm telling it to. Emacs使我的Erlang缩进的次数是我想告诉我的两倍。
If I set erlang-indent-level to 2, it indents to 4: 如果将erlang-indent-level设置为2,则将其缩进为4:
fun(Keys, Values, ReReduce) ->
lists:sum(Values)
end.
If I set erlang-indent-level to 4, it indents to 8: 如果将erlang-indent-level设置为4,则将其缩进为8:
fun(Keys, Values, ReReduce) ->
lists:sum(Values)
end
I've verified, using "od -c", that there are no tab characters in my Erlang files. 我已经使用“ od -c”验证了我的Erlang文件中没有制表符。
Why is the indentation level twice what erlang-indent-level is set to? 为什么缩进级别是erlang-indent-level设置的两倍?
The parts of my .emacs having to do with indentation: 我的.emacs部分与缩进有关:
(custom-set-variables
'(indent-tabs-mode nil)
...
; Set to 2 in order to get 4
(setq erlang-indent-level 2)
Versions: 版本:
It's because "fun" is a special keyword. 这是因为“乐趣”是一个特殊的关键字。 If you name your function to something else, it will indent the function as you expect. 如果您将函数命名为其他名称,则它将按预期缩进函数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.