Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
paraita opened this issue May 9, 2015 · 19 comments

Comments

@paraita
Copy link

paraita commented May 9, 2015

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
Copy link

Also having this problem

@pdvcs
Copy link

pdvcs commented Jun 27, 2015

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
Copy link
Contributor

russel commented Jul 25, 2015

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

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

@russel
Copy link
Contributor

russel commented Jul 25, 2015

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
Copy link

nmaynes commented Jul 28, 2015

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
Copy link

tsdh commented Jul 29, 2015

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.

rjarzmik pushed a commit to rjarzmik/rscope that referenced this issue Sep 2, 2015
Using emacs version 24.5, several functions fail with this error:
Symbol's function definition is void: set-difference

Same issue here:
Groovy-Emacs-Modes/groovy-emacs-modes#11

The set-difference is an alias to cl-set-difference and should be set
by the cl library. This patch adds a clean depency to the cl library.

Signed-off-by: Clement Calmels <clement.calmels@free.fr>
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
@kgthegreat
Copy link

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
Copy link
Contributor

russel commented Oct 30, 2015

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

@benignbala
Copy link

I have this problem on FreeBSD

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

@russel
Copy link
Contributor

russel commented Nov 16, 2015

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
Copy link

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

@russel
Copy link
Contributor

russel commented Dec 28, 2015

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
Copy link

zakame commented Apr 14, 2016

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
Copy link
Contributor

russel commented Apr 14, 2016

@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?

fhd added a commit to fhd/emacs-config that referenced this issue Oct 27, 2016
@badbob
Copy link

badbob commented Nov 18, 2016

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
Copy link

chooie commented May 15, 2017

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

@russel
Copy link
Contributor

russel commented May 16, 2017

@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 russel closed this as completed May 16, 2017
@russel
Copy link
Contributor

russel commented May 16, 2017

@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
Copy link

root42 commented May 16, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.