Default emacs' lua-mode indents like this:
local foo = function() print("Hello, world") end
It takes too many indents, apparently corrupt..
Here you will get:
local foo = function() print("Hello, world!") end
Nice, isnt it.
Put my-lua.el anywhere and append this:
(add-hook 'lua-mode-hook (lambda () (unless (fboundp 'lua-calculate-indentation-right-shift-next) (load-file (locate-file "my-lua.el" load-path)))))
in your .emacs .
See how to configure indentation in emacs lua-mode : stack overflow
In this repository it fixes the bug in above code.