summaryrefslogtreecommitdiff
path: root/cider-apropos.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@batsov.com>2016-03-19 20:00:28 +0200
committerBozhidar Batsov <bozhidar@batsov.com>2016-03-19 20:00:28 +0200
commit7f0b7a8f5e929d938ae49885bd423e05b3ced566 (patch)
tree612ae381e29876d4127801d69ba6dfa2e41b808a /cider-apropos.el
parentdb23cb5c633d7b64a74f7f79b35ad866c99e8a27 (diff)
Handle missing connection gracefully in apropos commands
Diffstat (limited to 'cider-apropos.el')
-rw-r--r--cider-apropos.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/cider-apropos.el b/cider-apropos.el
index 28c98287..3ba69e08 100644
--- a/cider-apropos.el
+++ b/cider-apropos.el
@@ -111,6 +111,7 @@ strings, include private vars, and be case sensitive."
(y-or-n-p "Search doc strings? ")
(y-or-n-p "Include private symbols? ")
(y-or-n-p "Case-sensitive? ")))))
+ (cider-ensure-connected)
(cider-ensure-op-supported "apropos")
(if-let ((summary (cider-apropos-summary
query ns docs-p privates-p case-sensitive-p))
@@ -122,6 +123,8 @@ strings, include private vars, and be case sensitive."
(defun cider-apropos-documentation ()
"Shortcut for (cider-apropos <query> nil t)."
(interactive)
+ (cider-ensure-connected)
+ (cider-ensure-op-supported "apropos")
(cider-apropos (read-string "Search for Clojure documentation (a regular expression): ") nil t))
(provide 'cider-apropos)