diff options
author | Bozhidar Batsov <bozhidar.batsov@gmail.com> | 2015-07-29 14:51:21 +0300 |
---|---|---|
committer | Bozhidar Batsov <bozhidar.batsov@gmail.com> | 2015-07-29 14:51:21 +0300 |
commit | bb0da75a14daadb34c443955dce9f744be73f8e4 (patch) | |
tree | f1c6458e2e71588da32b56b70eb932c72f7f60e8 | |
parent | 31dba8eb9a21db20ea462d49e119271c536cd8cf (diff) | |
parent | 9c2a7abce5e8ced606e25bc64b5e3c3d350ccad7 (diff) |
Merge pull request #1229 from clojure-emacs/improve-nrepl-warning
Include a link on how to fix wrong nrepl version
-rw-r--r-- | cider-interaction.el | 8 | ||||
-rw-r--r-- | cider-util.el | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/cider-interaction.el b/cider-interaction.el index ce6c22c4..b815e85f 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -297,9 +297,13 @@ Signal an error if it is not supported." (if nrepl-version (when (version< nrepl-version cider-required-nrepl-version) (cider-repl-emit-interactive-err-output - (format "WARNING: CIDER requires nREPL %s (or newer) to work properly" cider-required-nrepl-version))) + (cider--insert-readme-button + (format "WARNING: CIDER requires nREPL %s (or newer) to work properly" + cider-required-nrepl-version) + "warning-saying-you-have-to-use-nrepl-027"))) (cider-repl-emit-interactive-err-output - (format "WARNING: Can't determine nREPL's version. Please, update nREPL to %s." cider-required-nrepl-version))))) + (format "WARNING: Can't determine nREPL's version. Please, update nREPL to %s." + cider-required-nrepl-version))))) (defun cider--check-middleware-compatibility-callback (buffer) "A callback to check if the middleware used is compatible with CIDER." diff --git a/cider-util.el b/cider-util.el index e4f3cf2d..d4f4ae39 100644 --- a/cider-util.el +++ b/cider-util.el @@ -152,6 +152,17 @@ objects." "Return t if SYM is namespace-qualified." (string-match-p "[^/]+/" sym)) +(defun cider--insert-readme-button (label section-id) + "Insert a button that links to the online readme. +LABEL is the displayed string, and SECTION-ID is where it points +to." + (insert-button + label + 'follow-link t + 'action (lambda (&rest _) (interactive) + (browse-url (concat "https://github.com/clojure-emacs/cider#" + section-id))))) + (provide 'cider-util) ;;; cider-util.el ends here |