您正在使用的 Emacs 版本没有带有 1 个参数的“调用交互 p”函数版本(该函数的早期版本没有参数)。您可以通过将此解决方法(在此处发布:http: //paste.lisp.org/display/115598/raw)放在您的 Emacs 初始化文件中来解决此问题:
(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)))))
但是,当我这样做并尝试使用 Emacs 22 进行测试时,由于某些功能不存在,我也遇到了其他错误,因此如果您想使用 lua 模式,您可能必须升级您的 Emacs 版本。
使用 Emacs 23 和 24,“lua-mode.el”似乎可以使用现有的 lua 文件(我不是 lua 程序员,所以我无法正确测试它),但是当您尝试创建新的 lua 文件时会中断。它实际上是当您尝试打开一个新的 lua 文件时出现的“lua-mode.el”代码中的一个错误(如果您尝试打开现有的 lua 文件则不会发生)。问题是第 1218 行的“remove-text-properties”调用(在“lua-unmark-multiline-literals”函数中)正在调用“remove-text-properties”函数,开始值为“1”和“0”的结束值(它是“0”,因为新文件的缓冲区大小为“0”。您可以通过将第 1218 行更改为:
(remove-text-properties (or begin 1) (or end (buffer-size)) '(syntax-table ()))
至:
(remove-text-properties (or begin 1)
(or end
(if (> (buffer-size) 0)
(buffer-size)
(or begin 1)))
'(syntax-table ()))
你应该让“lua-mode.el”的开发者知道这个错误,并且可能还请求支持早期的 Emacs 版本。