[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cider aa51f13ce6 1/5: Disable Cider only when cider-auto-m
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cider aa51f13ce6 1/5: Disable Cider only when cider-auto-mode is enabled |
Date: |
Sat, 17 Jun 2023 04:01:33 -0400 (EDT) |
branch: elpa/cider
commit aa51f13ce655afa014ebc68edbd2327617dd90e2
Author: yuhan0 <qythium@gmail.com>
Commit: Bozhidar Batsov <bozhidar@batsov.dev>
Disable Cider only when cider-auto-mode is enabled
---
cider-connection.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/cider-connection.el b/cider-connection.el
index 9d0aad8fd0..6421e45362 100644
--- a/cider-connection.el
+++ b/cider-connection.el
@@ -55,7 +55,14 @@ available) and the matching REPL buffer."
:package-version '(cider . "0.17.0"))
(defcustom cider-auto-mode t
- "When non-nil, automatically enable cider mode for all Clojure buffers."
+ "When non-nil, automatically enable and disable CIDER in all Clojure buffers.
+
+After an initial connection, `cider-mode' is added to `clojure-mode-hook' and
+automatically enabled on all existing Clojure buffers. After the last
+connection has been closed, `cider-mode' is disabled in all Clojure buffers,
and
+has to be manually re-enabled via \\[cider-mode].
+
+Useful for switching between alternative minor modes like `inf-clojure-mode'."
:type 'boolean
:group 'cider
:safe #'booleanp
@@ -395,7 +402,8 @@ buffer."
This function is appended to `nrepl-disconnected-hook' in the client
process buffer."
;; `nrepl-connected-hook' is run in the connection buffer
- (cider-possibly-disable-on-existing-clojure-buffers)
+ (when cider-auto-mode
+ (cider-possibly-disable-on-existing-clojure-buffers))
(run-hooks 'cider-disconnected-hook))