Groovy-Emacs-Modes / groovy-emacs-modes

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

Can't load groovy-mode : File mode specification error: (void-function set-difference) #11

Closed paraita closed 7 years ago

paraita commented 9 years ago

I installed groovy-mode via melpa (20141209) today. I opened a simple groovy file:

class Main {
    static void main(String... args) {
        println 'Hello'
    }
}

groovy-mode should have fired up but failed: File mode specification error: (void-function set-difference)

During the installation with melpa, there was that error:


Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-electric.el at Sun May 10 00:37:58 2015
Entering directory `/home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/'
groovy-electric.el:55:1:Error: Symbol's function definition is void: set-difference

Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/groovy-mode.el at Sun May 10 00:37:58 2015
groovy-mode.el:354:1:Error: Symbol's function definition is void: set-difference

Compiling file /home/paraita/.emacs.d/elpa/groovy-mode-20141209.1133/inf-groovy.el at Sun May 10 00:37:58 2015
inf-groovy.el:51:1:Error: Symbol's function definition is void: set-difference

but it installed anyway.

Forcing the (require 'cl) in groovy-mode.el solved my problem.

I am using Emacs 24.5.1 on Archlinux x86_64 and yeah I'm aware of the cc-mode bug.

misterzirillo commented 9 years ago

Also having this problem

pdvcs commented 9 years ago

I had this problem on Emacs 24.5; it seems this line in groovy-mode.el is to blame for not requiring cl:

(if (and (= emacs-major-version 24) (< emacs-minor-version 5))
    (require 'cl))
russel commented 9 years ago

I am not seeing this error, I am now getting:

File mode specification error: (void-function inf-groovy-keys)

russel commented 9 years ago

I had some residual files causing the problem notes above, with clean up everything seems to work as expected. I am on 24.5.1 on Debian Sid.

nmaynes commented 9 years ago

I pulled the package today with GNUEmacs v 24.5 and ran into the error listed by @paraita. I followed his steps and removed the if statement, to require cl and groovy-mode now works. I am on amachine running Windows 7.

tsdh commented 9 years ago

I can't see any occurrence of set-difference in the code. But anyhow, packages should not (require 'cl) at runtime. They may require it at compile time if they use only cl macros but set-difference is a function.

The right fix would be to make the groovy-mode package depend on the cl-lib package, and then use the cl-set-difference function.

kgthegreat commented 8 years ago

Emacs 24.5.1 OSX El Kapitan

Tried to install groovy-mode, ran into the same error as @paraita . Removed the if condition and now it works

russel commented 8 years ago

I'll take a look at this when I can get my hands on an OSX machine running El Kapitan, hopefully next week.

benignbala commented 8 years ago

I have this problem on FreeBSD

10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014

russel commented 8 years ago

Progress report: I now have an OSX machine and got it running El Capitan, getting Emacs installed, will be able to test soon. I have no access to FreeBSD, so I just have to hope that if I can fix it for OSX and it continues to work for Debian and Fedora, then it will be fixed for FreeBSD.

benignbala commented 8 years ago

I can help with Debian Jessie and FreeBSD - Please do let me know once you have fixed it. Thanks

russel commented 8 years ago

It seems that the problem exists on Debian Emacs 24.5.1 with the code as was. I have therefore updated the fix version number, which should fix it for everyone. The hint is that the problem is not as was originally thought…

zakame commented 8 years ago

Still happening on groovy-mode 20151228.951 from MELPA, on GNU Emacs 24.5.1 (x86_64-slackware-linux-gnu, GTK+ Version 2.24.28.)

But anyhow, packages should not (require 'cl) at runtime.

Just require cl directly instead of testing for the emacs-version. c-lang-defconst/cc-mode seems to use it.

russel commented 8 years ago

@zakame Sorry that you are still finding the problem. I wonder why I do not, I am on Debian Sid with Emacs 24.5.1 and Fedora Rawhide with 25.0.92.1. I guess a big difference is the GTK+ version, I am on 3.18 or 3.19, but I am not sure why this should be a factor.

Are you suggesting just taking the version number check out, but leaving the "are we compiling or running" check in?

badbob commented 7 years ago

Have the save issue in GNU Emacs 25.1.1 (i686-w64-mingw32) on Windows. Please advice, how I can collect more debug info for report. (I'm too noob in Emacs)

chooie commented 7 years ago

Happening to me with groovy-mode-20170503.148 on OSX using Emacs 25.2.1 (with Spacemacs).

russel commented 7 years ago

@chooie This issue has so many bits and pieces to it over such a long time that your comment isn't giving me enough data to create a useful idea of what your problem is. Also the version this issue related to is the old CC-Mode version, and I believe you are using the new standalone version. I am therefore going to close this issue and ask you to raise a new issue. Sorry for this, but it seems the best way forward to get activity to fix things.

russel commented 7 years ago

@badbob Can I get you to raise a new issue outlining how you got the version of the mode that is giving you problems. We have recently switched from a CC_Mode base for the Groovy Mode to a standalone version which is now on MELPA. We are trying to avoid use of the old CC-Mode based version at all now.

root42 commented 7 years ago

@chooie Having the same problem! Although with emacsformacosx.com build using the same 20170503.148 version of groovy-mode.