如何在Emacs中解决 `Company found no Lua executable` 的错误

我的 Emacs (24.5) 在 Ubuntu16.04 上抱怨

Company backend 'company-lua' could not be initialized:
Company found no Lua executable

我已经通过 MELPA 安装了 lua-modecompany-lua,我的环境中的 lua 可执行文件是 /usr/bin/lua5.3,没有叫做 lua 的快捷方式,也不能为环境原因创建快捷方式。

有没有办法让 company-lua 知道 Lua 可执行文件的正确名称或路径?

它的网站上看,company-lua 似乎没有像 lua-mode 那样设置 Lua 可执行文件名称的变量。

company-lua.el 中,我看到了以下版本的提及,似乎在 5.3 中是错误的。这是我应该修改以修复问题的内容吗?

(defcustom company-lua-interpreter 'lua52
  "Lua interpreter."
  :group 'company-lua
  :type '(choice (const :tag "Lua 5.1" lua51)
                 (const :tag "Lua 5.2" lua52)
                 (const :tag "Lua 5.2" lua53)
                 (const :tag "LÖVE" love))
:safe #'symbolp)
点赞
用户4196578
用户4196578

正如 @EgorSkriptunoff 建议的那样,通过修改 company-lua-executable 变量为正确的 Lua 版本可以解决该问题,例如在 Emacs 初始化文件中添加以下代码:

(custom-set-variables '(company-lua-executable (executable-find "lua5.3") ) )
2017-02-05 01:44:49