From b34057a1944354cbd2100e2beb08d6c6e1e06da3 Mon Sep 17 00:00:00 2001 From: Tianxiang Xiong Date: Mon, 11 Dec 2017 01:17:50 -0800 Subject: 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 --- cider-compat.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cider-compat.el') 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 -- cgit v1.2.3