You are using a version of Emacs that doesn't have the version of the "called-interactively-p" function that takes 1 argument (earlier versions of the function didn't take an argument). You can get around this by putting this workaround (posted here: http://paste.lisp.org/display/115598/raw) in your Emacs init file:
(condition-case nil (called-interactively-p 'interactive)
(error
; Save reference to called-interactively-p in
; inglorion-system-called-interactively-p
(fset 'inglorion-system-called-interactively-p
(symbol-function 'called-interactively-p))
; Define called-interactively-p so that it discards
; its arguments and calls inglorion-system-called-interactively-p
(fset 'called-interactively-p
(lambda (&rest args)
(inglorion-system-called-interactively-p)))))
However, when I did this and attempted to test with Emacs 22, I encountered other errors as well due to certain functions not being present so you may have to upgrade your version of Emacs if you want to use lua-mode.
With Emacs 23 & 24, "lua-mode.el" seems to work (I'm not a lua programmer so I couldn't test it properly) with existing lua files but breaks when you attempt to create a new lua file. It's actually a bug in the "lua-mode.el" code that occurs when you try to open a new lua file (it doesn't occur if you attempt to open an existing lua file). The problem is that the "remove-text-properties" call at line# 1218 (in the "lua-unmark-multiline-literals" function) is calling the "remove-text-properties" function with a begin value of "1" and an end value of "0" (it's "0" because the buffer-size is "0" for a new file. You can fix this by changing line# 1218 from:
(remove-text-properties (or begin 1) (or end (buffer-size)) '(syntax-table ()))
to:
(remove-text-properties (or begin 1)
(or end
(if (> (buffer-size) 0)
(buffer-size)
(or begin 1)))
'(syntax-table ()))
You should let the developer of "lua-mode.el" know about the bug and possibly also request support for earlier Emacs versions.
'("\\.lua$ . lua-mode)should read'("\\.lua$" . lua-mode)- sanityinc