From 9c2a7abce5e8ced606e25bc64b5e3c3d350ccad7 Mon Sep 17 00:00:00 2001 From: Lars Andersen Date: Wed, 29 Jul 2015 00:43:02 +0200 Subject: Include a link on how to fix wrong nrepl version People keep asking about this, which is why we added this section to the readme, but they're still not finding it... --- cider-interaction.el | 8 ++++++-- 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 -- cgit v1.2.3