Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Emacs&x27;csharp模式';字节编译错误_C#_Emacs_Compilation_Compiler Errors_Elisp - Fatal编程技术网

C# Emacs&x27;csharp模式';字节编译错误

C# Emacs&x27;csharp模式';字节编译错误,c#,emacs,compilation,compiler-errors,elisp,C#,Emacs,Compilation,Compiler Errors,Elisp,当我尝试在Emacs 24.2.1下进行字节编译时,出现以下错误: csharp模式。el:2028:1:错误:作为变量的符号值无效:csharp enum decl re 确认此编译问题,并提供以下补救措施: 我试图通过在上执行C-x C-e来手动定义csharp enum decl re 除常数;这使它得以编译 这种疗法对我也有效!然而,这种补救办法给我留下了几个问题: 没有预先定义csharp enum decl re,为什么csharp mode.el无法进行字节编译?(有关cshar

当我尝试在Emacs 24.2.1下进行字节编译时,出现以下错误:

csharp模式。el:2028:1:错误:作为变量的符号值无效:csharp enum decl re
确认此编译问题,并提供以下补救措施:

我试图通过在上执行C-x C-e来手动定义csharp enum decl re 除常数;这使它得以编译

这种疗法对我也有效!然而,这种补救办法给我留下了几个问题:

  • 没有预先定义
    csharp enum decl re
    ,为什么csharp mode.el无法进行字节编译?(有关csharp mode.el的源代码,请参见第一个链接)
  • 在不修改csharp mode.el的情况下,是否有更好的解决此编译问题的方法
  • 第2028行所示的错误与以下定义有关。其中依赖于
    csharp enum decl re
  • (defconst csharp-font-lock-keywords-2(c-lang-const c-matchers-2 csharp)
    “C#模式的快速正常高亮显示。”)
    
    据我所知:

  • 文件无法进行字节编译,因为宏需要尚未定义的符号值。这个错误会滑向一些程序员,因为他们正在使用emacs会话进行开发,在该会话中,他们评估了正在编写的一些代码。编译错误的典型解决方案是对编译时需要知道的表达式使用
    eval和compile

  • byte compile
    之前使用
    eval buffer
    是一种避免修改源代码的变通方法。编写补丁并将其发送给作者是另一种选择

  • 代码相对比较复杂,因为它严重依赖于宏<假设code>c-lang-defconst为
    c-matchers-1
    c-matchers-2
    c-matchers-3
    定义值,但是对于
    c-matchers-2
    需要
    csharp enum decl re
    的值(参见第1304行)。请注意,符号的名称(c-matchers-*)是由
    c-lang-defconst
    宏本身创建的


  • 这个bug。在这种情况下,可能需要
    eval和compile
    ,因为这个变量似乎也在运行时使用。juanleon-我已经成功地对csharp-mode.el进行了字节编译,您在回答的两部分都给出了指导。(在使用
    --no init file
    选项运行Emacs之后,我独立地测试了每种方法。)我添加了一个数字3。我的问题的第项…您是否了解为什么第2028行的特定定义会抛出编译错误?我不清楚
    csharp-font-lock-keywords-2
    csharp enum decl re
    的依赖性。是的,您添加了第3项。有帮助
    csharp-font-lock-keywords-2
    取决于
    c-matchers-2
    (在cc-fonts.el中定义)
    c-matchers-2
    依次取决于
    c-basic-matchers-after
    (在csharp mode.el中定义)。最后,
    c-basic-matchers-after
    references
    csharp enum decl re