diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2016-05-01 23:19:42 -0300 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2016-05-01 23:21:00 -0300 |
commit | 1f6fc8d64d50b24fa87491e6b208872cff5ef11d (patch) | |
tree | 0d400cc34eea1256a4091e4b028cc31b2910adb8 | |
parent | 72886462beee998e1420cc6830618efbd55d928a (diff) |
[Fix #1712] Check if when-let is defined even when if-let is
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | cider-compat.el | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 51a99704..6047664d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ ### Bugs fixed +* [#1712](https://github.com/clojure-emacs/cider/issues/1712): Bad compilation issue caused when installed along with `nim-mode`. * Fix arglist display for `def` in the doc buffer. * Use `cider-apropos-select` instead of `cider-apropos` in `cider-apropos-documentation-select`. * [#1561](https://github.com/clojure-emacs/cider/issues/1561): Use an appropriate font-lock-face for variables, macros and functions in diff --git a/cider-compat.el b/cider-compat.el index fc53306c..9585a520 100644 --- a/cider-compat.el +++ b/cider-compat.el @@ -28,8 +28,7 @@ (eval-and-compile - (unless (fboundp 'thread-first) - + (unless (fboundp 'internal--thread-argument) (defmacro internal--thread-argument (first? &rest forms) "Internal implementation for `thread-first' and `thread-last'. When Argument FIRST? is non-nil argument is threaded first, else @@ -39,8 +38,9 @@ last. FORMS are the expressions to be threaded." `(internal--thread-argument ,first? ,(if first? `(,f ,x ,@args) `(,f ,@args ,x)) ,@rest)) (`(,x ,f . ,rest) `(internal--thread-argument ,first? (,f ,x) ,@rest)) - (_ (car forms)))) + (_ (car forms))))) + (unless (fboundp 'thread-first) (defmacro thread-first (&rest forms) "Thread FORMS elements as the first argument of their successor. Example: @@ -59,7 +59,6 @@ threading." `(internal--thread-argument t ,@forms))) (unless (fboundp 'thread-last) - (defmacro thread-last (&rest forms) "Thread FORMS elements as the last argument of their successor. Example: @@ -142,8 +141,9 @@ to bind a single value, BINDINGS can just be a plain tuple." `(let* ,(internal--build-bindings bindings) (if ,(car (internal--listify (car (last bindings)))) ,then - ,@else))) + ,@else)))) + (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 |