Groovy-Emacs-Modes / groovy-emacs-modes

A groovy major mode, grails minor mode, and a groovy inferior mode.
84 stars 39 forks source link

Failure to load in Emacs 25 #30

Closed DarthFennec closed 7 years ago

DarthFennec commented 8 years ago

I'm using Emacs 25.1.1. When I try to run groovy-mode, the mode fails to start, with the following error:

Eval error in the ‘c-lang-defconst’ for ‘c-constant-kwds’ in groovy-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-basic-matchers-before’ in groovy-mode:
Eval error in the ‘c-lang-defconst’ for ‘c-matchers-2’ in groovy-mode:
c-get-lang-constant: Invalid function: (quote ("true" "false" "null"))
bltavares commented 7 years ago

I have very little context on elisp and the package itself, but I gave it a try.

--- /Users/bruno/groovy-mode.el 2016-10-03 11:14:50.000000000 -0300
+++ groovy-mode.el  2016-10-03 11:14:00.000000000 -0300
@@ -330,7 +330,7 @@
 ;;  Java does not define these pseudo-kewords as keywords, why not?

 (c-lang-defconst c-constant-kwds
-  groovy '( "true" "false" "null" ))
+  groovy `( "true" "false" "null" ))

 ;;  Why does Java mode not put `super' into the `c-primary-expr-kwds?

Changing the quoting mark did the trick here. Not sure why. It does not work on Emacs 24.5 with this change.

russel commented 7 years ago

@DarthFennec Debian Sid has now switched from Emacs 24 to Emacs 25 (25.1.1). I just tried editing a Groovy file and did not see the problem you reported. Even though it "works for me", is there still a problem for you?

russel commented 7 years ago

@bltavares The normal quote (') is correct here. Although backquote(`) should work, the extra facilities of that quote form would not be used here so the behaviour using either should be identical.

DarthFennec commented 7 years ago

Yeah, I don't have this problem anymore. No idea what was causing it, seeing as my emacs hasn't been updated since, and this mode hasn't changed in a way that would affect this either. Very strange. Also very strange that the quasiquote would work when a normal quote didn't (by the way, thank you @bltavares for this, it fixed the issue for me in the meantime). But everything seems to work normally now, so I think this is resolved.

bltavares commented 7 years ago

@DarthFennec Yeah, it was odd that ` worked. I don't have the issue anymore. Probably something unrelated, or it was bad compiled file.

russel commented 7 years ago

Good to know it works now. I was having a very hard time thinking what the problem could be. The idea of a badly compiled file that got recompiled would fit, but I am not sure what might have caused that.

mcraveiro commented 7 years ago

Hi,

I experienced a similar problem [1] and managed to fix it by uninstalling and reinstalling the package from within package-list-packages.

Hope it helps.

[1] https://github.com/josteink/csharp-mode/issues/97