branch: elpa/cider commit 0a1f8b09d92c2f4a9e67e3dbd933011b2a6c67e3 Author: Bozhidar Batsov <bozhi...@batsov.dev> Commit: Bozhidar Batsov <bozhi...@batsov.dev>
Restore inspirational messages on connect Those were lost long-ago when the connection logic was reworked. --- CHANGELOG.md | 6 ++++++ cider-util.el | 5 +++++ cider.el | 14 ++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 770e16d26b..126a64778f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,18 @@ ## master (unreleased) +## New features + +* Add new interactive command `cider-inspire-me`. It does what you'd expect. +* Add new defcustom `cider-inspire-on-connect`, which controls whether to display an inspiration message on connect. + ### Changes * [#3177](https://github.com/clojure-emacs/cider/pull/3177) Apply ANSI colorization to test assertion output. * Use clojure-mode [5.14.0](https://github.com/clojure-emacs/clojure-mode/blob/v5.14.0/CHANGELOG.md#5140-2022-03-07). * [#3170](https://github.com/clojure-emacs/cider/issues/3170) Skip ensure repl available on xref functions. * [#3173](https://github.com/clojure-emacs/cider/issues/3173) Locally remove `cider-complete-at-point` from `completion-at-point-functions` instead of killing it as a local variable. +* Restore the long-lost (but critical) inspirational message on connect. ## 1.3.0 (2021-03-07) diff --git a/cider-util.el b/cider-util.el index e42988c65a..ece55fc3da 100644 --- a/cider-util.el +++ b/cider-util.el @@ -703,6 +703,11 @@ through a stack of help buffers. Variables `help-back-label' and cider-words-of-inspiration) t)) +(defun cider-inspire-me () + "Display a random inspiration message." + (interactive) + (message (cider-random-words-of-inspiration))) + (defvar cider-tips '("Press <\\[cider-connect]> to connect to a running nREPL server." "Press <\\[cider-quit]> to quit the current connection." diff --git a/cider.el b/cider.el index 2afa9c38c1..defe045e1b 100644 --- a/cider.el +++ b/cider.el @@ -1637,6 +1637,20 @@ assume the command is available." (executable-find (concat command ".bat"))))) (shell-quote-argument command))) +(defcustom cider-inspire-on-connect t + "The version of cider-nrepl injected on jack-in. +Should be newer than the required version for optimal results." + :type 'boolean + :package-version '(cider . "1.4.0") + :safe #'booleanp) + +(defun cider--maybe-inspire-on-connect () + "Display an inspiration connection message." + (when cider-inspire-on-connect + (message "Connected! %s" (cider-random-words-of-inspiration)))) + +(add-hook 'cider-connected-hook #'cider--maybe-inspire-on-connect) + ;;;###autoload (with-eval-after-load 'clojure-mode (define-key clojure-mode-map (kbd "C-c M-x") #'cider)