Emacs lua模式问题:(void-function interactively-called-p) [英] Emacs lua-mode issue: (void-function interactively-called-p)

查看:223
本文介绍了Emacs lua模式问题:(void-function interactively-called-p)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为emacs 21.4.1安装lua-mode(版本20110428),并且有问题。在我的.emacs文件中我已经得到:

 (add-to-list'load-path〜/ .emacs。 d / lua-mode /)
...
(setq auto-mode-alist(cons'(\\.lua $。lua-mode)auto-mode-alist) )
(autoload'lua-modelua-modeLua编辑模式t)

我使用了这里的安装说明: http://lua-mode.luaforge.net/另外,在我的.emacs.d / dir中我有lua-mode /它包含lua-mode.el。所有这些文件都具有正确的权限。



除了现在,当我使用emacs打开新文件test.lua时,我会在scratch缓冲区中得到以下消息:



文件模式规范错误:(void-function called-interactiveively-p)



运行RHEL5。我已经上网了,但没有找到太多的帮助。有没有人有什么建议?我不知道任何LISP(所以很难调试lua-mode.el),除了少量的快捷方式,我不太了解emacs。



谢谢。

解决方案

您正在使用一个版本的Emacs,没有版本的 p函数需要1个参数(早期版本的函数没有参数)。你可以通过这个解决方法来解决这个问题(发布在这里: http://paste.lisp.org/您的Emacs init文件中显示/ 115598 / raw

 (condition-case nil(called-interactiveively- p'interactive)
($ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
-interactively-p
(symbol-function'called-interactiveively-p))
;定义被调用的交互式p,以便丢弃
;其参数和调用inglorion-system-called-交互式p
(fset'called-interactiveively-p
(lambda(& rest args)
(inglorion-system-called-interactiveively-p))))
但是,当我这样做并尝试使用Emacs 22进行测试时,我遇到其他错误,由于某些功能不是在场,所以你可能需要升级y我们的Emacs版本,如果你想使用lua模式。



使用Emacs 23& 24,lua-mode.el似乎工作(我不是一个lua程序员,所以我无法正确测试)与现有的lua文件,但当您尝试创建一个新的lua文件时中断。这实际上是当您尝试打开一个新的lua文件时发生的lua-mode.el代码中的错误(如果您尝试打开现有的lua文件,则不会出现此错误)。问题是在行#1218(lua-unmark-multiline-literals)函数中的remove-text-properties调用正在调用起始值为1的remove-text-properties函数并且结束值为0(因为新文件的缓冲区大小为0,这是0,您可以通过更改行#1218来修复此问题:

 (remove-text-properties(或begin 1)(或end(buffer-size))'(syntax-table())

to:

 (remove-text属性(或开始1)
(或结束
(if(>(buffer-size)0)
(buffer-size)
(或begin 1)))
'(syntax-table()))

你应该让开发者lua -mode.el了解错误,也可能要求对早期Emacs版本的支持。


I'm trying to install lua-mode (version 20110428) for emacs 21.4.1 and am having problems. In my .emacs file I've got:

(add-to-list 'load-path "~/.emacs.d/lua-mode/")
...
(setq auto-mode-alist (cons '("\\.lua$" . lua-mode) auto-mode-alist))
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)

I used the installation instructions from here: http://lua-mode.luaforge.net/ Also, in my .emacs.d/ dir I have lua-mode/ which contains lua-mode.el. All of those files have the correct permissions.

Except now when I use emacs to open the new file "test.lua" I get the following message in the scratch buffer:

"File mode specification error: (void-function called-interactively-p)"

I'm running RHEL5. I've looked online but haven't found much help. Does anyone have any suggestions? I don't know any LISP (so it's hard to debug lua-mode.el) and apart from a handful of shortcuts, I don't know that much about emacs.

Thanks.

解决方案

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.

这篇关于Emacs lua模式问题:(void-function interactively-called-p)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆