Emacs 'csharp-mode' compilation error

When I try to compile csharp-mode in Emacs 24.2.1, I get the following error:

csharp-mode.el:2028:1:Error: Symbol value as variable is void: csharp-enum-decl-re

This post confirms the same compilation problem and offers the following tool:

I tried to manually define csharp-enum-decl-re by running Cx Ce on defconst; it made him compile.

This tool also helped me! However, this tool leaves me with a couple of questions:

  • Without a preliminary determination csharp-enum-decl-re, why csharp-mode.el cannot compile bytes? (See the first source code link for csharp-mode.el .)
  • Without changing csharp-mode.el , is there a better way around this compilation problem?
  • The error indicated on line 2028 refers to the following definition. Where is the addiction to csharp-enum-decl-re?
(defconst csharp-font-lock-keywords-2 (c-lang-const c-matchers-2 csharp)
  "Fast normal highlighting for C# mode.")
+4
source share
1 answer

As I know:

  • The file does not perform byte compilation because the macro requires a character value that has not been defined. This error slips for some programmers because they are developed with an emacs session where they have some code that they write. A typical solution to a compilation error is to use a macro eval-and-compilefor those expressions that you need to know at compile time.

  • eval-buffer byte-compile - , . - .

  • , . 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.

+4

All Articles