branch: elpa/cider
commit 814f72f44c6452a32dc5ff2002c6ea07ac866ca3
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>
Replace cider-inspire-on-connect with cider-connection message
While digging through the code I've noticed that it was still around
and offers a slightly more generic behavior.
---
CHANGELOG.md | 1 -
cider-connection.el | 8 --------
cider.el | 16 +++++++++-------
3 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4430c57605..25739a6540 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,6 @@
## 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
diff --git a/cider-connection.el b/cider-connection.el
index b81ba4f4bc..77326e1e90 100644
--- a/cider-connection.el
+++ b/cider-connection.el
@@ -45,14 +45,6 @@ See `cider-format-connection-params' for available format
characters."
:group 'cider
:package-version '(cider . "0.18.0"))
-(defcustom cider-connection-message-fn #'cider-random-words-of-inspiration
- "The function to use to generate the message displayed on connect.
-When set to nil no additional message will be displayed. A good
-alternative to the default is `cider-random-tip'."
- :type 'function
- :group 'cider
- :package-version '(cider . "0.11.0"))
-
(defcustom cider-redirect-server-output-to-repl t
"Controls whether nREPL server output would be redirected to the REPL.
When non-nil the output would end up in both the nrepl-server buffer (when
diff --git a/cider.el b/cider.el
index 357925e2f7..af0db858b7 100644
--- a/cider.el
+++ b/cider.el
@@ -1637,16 +1637,18 @@ assume the command is available."
(executable-find (concat command ".bat")))))
(shell-quote-argument command)))
-(defcustom cider-inspire-on-connect t
- "Controls whether to display an inspirational message on connect."
- :type 'boolean
- :package-version '(cider . "1.4.0")
- :safe #'booleanp)
+(defcustom cider-connection-message-fn #'cider-random-words-of-inspiration
+ "The function to use to generate the message displayed on connect.
+When set to nil no additional message will be displayed. A good
+alternative to the default is `cider-random-tip'."
+ :type 'function
+ :group 'cider
+ :package-version '(cider . "0.11.0"))
(defun cider--maybe-inspire-on-connect ()
"Display an inspiration connection message."
- (when cider-inspire-on-connect
- (message "Connected! %s" (cider-random-words-of-inspiration))))
+ (when cider-connection-message-fn
+ (message "Connected! %s" (funcall cider-connection-message-fn))))
(add-hook 'cider-connected-hook #'cider--maybe-inspire-on-connect)