emacs compile error #295

Closed
opoplawski opened this Issue Apr 22, 2015 · 3 comments

Comments

Projects
None yet
3 participants

Building protobuf 2.4.1 with emacs 24.4 and 24.5:

+ emacs -batch -f batch-byte-compile editors/protobuf-mode.el
Eval error in the `c-lang-defconst' for `c-regular-keywords-regexp' in protobuf-mode:
Eval error in the `c-lang-defconst' for `c-basic-matchers-before' in protobuf-mode:
Eval error in the `c-lang-defconst' for `c-matchers-2' in protobuf-mode:
In toplevel form:
editors/protobuf-mode.el:165:1:Error: Symbol's function definition is void: set-difference

You can see some discussion of the issue here: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18845
That discussion assumed that the issue would be fixed in 24.5, but that does not appear to be the case. I'm currently using:

--- protobuf-2.5.0/editors/protobuf-mode.el
+++ protobuf-2.5.0/editors/protobuf-mode.el
@@ -66,6 +66,10 @@
 (require 'cc-mode)

 (eval-when-compile
+  (and (= emacs-major-version 24)
+       (>= emacs-minor-version 4)
+       (null emacs-repository-version)
+       (require 'cl))
   (require 'cc-langs)
   (require 'cc-fonts))

xfxyjwf added the tooling label Jan 20, 2016

Contributor

hotpxl commented Aug 4, 2016

I'm having the same issue. Please add (require 'cl) to the top of protobuf-mode.el.

Thanks.

Member

xfxyjwf commented Aug 4, 2016

Can you help send a pull request to update the file?

@hotpxl hotpxl added a commit to hotpxl/protobuf that referenced this issue Aug 5, 2016

@hotpxl hotpxl [master] Add dependency cl. Fixes #295. 8acb4ac
Contributor

hotpxl commented Aug 5, 2016 edited

PR #1926 submitted. Thanks!

xfxyjwf closed this in ddf6d1e Aug 5, 2016

@xfxyjwf xfxyjwf added a commit that referenced this issue Aug 5, 2016

@xfxyjwf xfxyjwf Merge pull request #1926 from hotpxl/master
[master] Add dependency cl. Fixes google/protobuf#295.
f1f30b5

@tarsius tarsius pushed a commit to emacsmirror/protobuf-mode that referenced this issue Aug 12, 2016

@hotpxl hotpxl [master] Add dependency cl. Fixes google/protobuf#295. 5880e0e

@phst phst added a commit to phst/protobuf that referenced this issue May 18, 2017

@phst phst Improve fix for google#295
Requiring the legacy ‘cl’ library unconditionally pollutes the namespace.
Instead, require it only when compiling and in known-broken versions.

This is the same patch that opoplawski suggested.
cf0080c

@phst phst added a commit to phst/dart-mode that referenced this issue May 18, 2017

@phst phst Add workaround for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18845
I’ve unfortunately removed a similar workaround in
nex3@bd08208.
This is the same workaround as suggested for
google/protobuf#295 by @opoplawski.
0ce4a8e

@nex3 nex3 added a commit to nex3/dart-mode that referenced this issue May 18, 2017

@phst @nex3 phst + nex3 Add workaround for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=18845 (
#40)

I’ve unfortunately removed a similar workaround in
bd08208.
This is the same workaround as suggested for
google/protobuf#295 by @opoplawski.
35a794c

@phst phst added a commit to phst/protobuf that referenced this issue May 23, 2017

@phst phst Improve fix for google#295
Requiring the legacy ‘cl’ library unconditionally pollutes the namespace.
Instead, require it only when compiling and in known-broken versions.

This is almost the same patch that opoplawski suggested, except that I removed
the test for ‘emacs-repository-version’, which isn’t defined in Emacs 24.3.
979107e

@acozzette acozzette added a commit that referenced this issue May 26, 2017

@acozzette acozzette Merge pull request #3113 from phst/master
Improve fix for #295
4674cc7

@tarsius tarsius pushed a commit to emacsmirror/protobuf-mode that referenced this issue Jun 13, 2017

@phst phst Improve fix for google/protobuf#295
Requiring the legacy ‘cl’ library unconditionally pollutes the namespace.
Instead, require it only when compiling and in known-broken versions.

This is almost the same patch that opoplawski suggested, except that I removed
the test for ‘emacs-repository-version’, which isn’t defined in Emacs 24.3.
9c50d06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment