Commit 70971d0a918053d86e76e4ff8248b25a8646940e removed support for emacs 24.3 and below. This removed a file called cider-compat.el and replaced it with an emacs core file subr-x.el Supposedly this allowed the if-let
macro to be from subr-x.el, with the thinking being that this file stayed the same from 24.4+ to 25+. It seems like the if-let
macros did not make it into the emacs branch for 24.x.
So long story short, the if-let
macro is undefined. Some people aren't running into this issue as some other projects define if-let
. Some have old .elc files laying around which might be swept up in how emacs reads in files.
But the quick fix is to install CIDER (edited used to be emacs) from melpa-stable. Another fix is to upgrade emacs. Another fix is for you to run your own copy of cider locally but without the offending commit. And finally, if you can get this function into your personal emacs directory and it loads before cider, you should be good.
(defmacro if-let (bindings then &rest else)
"Process BINDINGS and if all values are non-nil eval THEN, else ELSE.
Argument BINDINGS is a list of tuples whose car is a symbol to be
bound and (optionally) used in THEN, and its cadr is a sexp to be
evalled to set symbol's value. In the special case you only want
to bind a single value, BINDINGS can just be a plain tuple."
(declare (indent 2)
(debug ([&or (&rest (symbolp form)) (symbolp form)] form body)))
(when (and (<= (length bindings) 2)
(not (listp (car bindings))))
;; Adjust the single binding case
(setq bindings (list bindings)))
`(let* ,(internal--build-bindings bindings)
(if ,(car (internal--listify (car (last bindings))))
,then
,@else)))
Please note that the above is my copy of if-let
from emacs. I did not write this code and I hope that the sharing of this code in this venue is fine. I'm happy to take it down if anyone thinks that it is out of place.
You can find an issue tracking all of this at cider issue 1882
If you want to run emacs locally you can use this
;; load local version of cider
(add-to-list 'load-path "~/projects/cider")
(load "cider")
and then run git checkout 3be082ae4a3d0b40d360648b20fb7caa14c0a9fc
to get the commit right before it borked.