Skip to content

Commit 0a1f8b0

Browse files
committed
Restore inspirational messages on connect
Those were lost long-ago when the connection logic was reworked.
1 parent 9130c64 commit 0a1f8b0

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@
22

33
## master (unreleased)
44

5+
## New features
6+
7+
* Add new interactive command `cider-inspire-me`. It does what you'd expect.
8+
* Add new defcustom `cider-inspire-on-connect`, which controls whether to display an inspiration message on connect.
9+
510
### Changes
611

712
* [#3177](https://github.com/clojure-emacs/cider/pull/3177) Apply ANSI colorization to test assertion output.
813
* Use clojure-mode [5.14.0](https://github.com/clojure-emacs/clojure-mode/blob/v5.14.0/CHANGELOG.md#5140-2022-03-07).
914
* [#3170](https://github.com/clojure-emacs/cider/issues/3170) Skip ensure repl available on xref functions.
1015
* [#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.
16+
* Restore the long-lost (but critical) inspirational message on connect.
1117

1218
## 1.3.0 (2021-03-07)
1319

cider-util.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@ through a stack of help buffers. Variables `help-back-label' and
703703
cider-words-of-inspiration)
704704
t))
705705

706+
(defun cider-inspire-me ()
707+
"Display a random inspiration message."
708+
(interactive)
709+
(message (cider-random-words-of-inspiration)))
710+
706711
(defvar cider-tips
707712
'("Press <\\[cider-connect]> to connect to a running nREPL server."
708713
"Press <\\[cider-quit]> to quit the current connection."

cider.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,20 @@ assume the command is available."
16371637
(executable-find (concat command ".bat")))))
16381638
(shell-quote-argument command)))
16391639

1640+
(defcustom cider-inspire-on-connect t
1641+
"The version of cider-nrepl injected on jack-in.
1642+
Should be newer than the required version for optimal results."
1643+
:type 'boolean
1644+
:package-version '(cider . "1.4.0")
1645+
:safe #'booleanp)
1646+
1647+
(defun cider--maybe-inspire-on-connect ()
1648+
"Display an inspiration connection message."
1649+
(when cider-inspire-on-connect
1650+
(message "Connected! %s" (cider-random-words-of-inspiration))))
1651+
1652+
(add-hook 'cider-connected-hook #'cider--maybe-inspire-on-connect)
1653+
16401654
;;;###autoload
16411655
(with-eval-after-load 'clojure-mode
16421656
(define-key clojure-mode-map (kbd "C-c M-x") #'cider)

0 commit comments

Comments
 (0)