summaryrefslogtreecommitdiff
path: root/cider-compat.el
diff options
context:
space:
mode:
authorTianxiang Xiong <tianxiang.xiong@gmail.com>2017-12-11 01:17:50 -0800
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2017-12-11 16:09:54 +0000
commitb34057a1944354cbd2100e2beb08d6c6e1e06da3 (patch)
treea033bdacf950d04623b1f78824c171ee7dceab07 /cider-compat.el
parentb484daa718c09c3d41e260878f93a35f05edb5b4 (diff)
Replace `if-let` and `when-let` with starred versions
Fix #2130. Emacs 26 obsoletes `if-let` and `when-let`, replacing them with `if-let*` and `when-let*`. This raises byte-compilation warnings (treated as errors) when testing against Emacs 26. See: http://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-26#n1278
Diffstat (limited to 'cider-compat.el')
-rw-r--r--cider-compat.el12
1 files changed, 6 insertions, 6 deletions
diff --git a/cider-compat.el b/cider-compat.el
index 7387f833..4debff12 100644
--- a/cider-compat.el
+++ b/cider-compat.el
@@ -125,8 +125,8 @@ threading."
(eval-and-compile
- (unless (fboundp 'if-let)
- (defmacro if-let (bindings then &rest else)
+ (unless (fboundp 'if-let*)
+ (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
@@ -143,15 +143,15 @@ to bind a single value, BINDINGS can just be a plain tuple."
,then
,@else))))
- (unless (fboundp 'when-let)
- (defmacro when-let (bindings &rest body)
+ (unless (fboundp 'when-let*)
+ (defmacro when-let* (bindings &rest body)
"Process BINDINGS and if all values are non-nil eval BODY.
Argument BINDINGS is a list of tuples whose car is a symbol to be
bound and (optionally) used in BODY, 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 1) (debug if-let))
- `(if-let ,bindings ,(macroexp-progn body)))))
+ (declare (indent 1) (debug if-let*))
+ `(if-let* ,bindings ,(macroexp-progn body)))))
(eval-and-compile