summaryrefslogtreecommitdiff
path: root/cider-selector.el
diff options
context:
space:
mode:
Diffstat (limited to 'cider-selector.el')
-rw-r--r--cider-selector.el31
1 files changed, 15 insertions, 16 deletions
diff --git a/cider-selector.el b/cider-selector.el
index dc6b4ea2..a21032db 100644
--- a/cider-selector.el
+++ b/cider-selector.el
@@ -32,8 +32,9 @@
;;; Code:
(require 'cider-client)
-(require 'cider-interaction)
+(require 'cider-eval)
(require 'cider-scratch)
+(require 'cider-profile)
(defconst cider-selector-help-buffer "*CIDER Selector Help*"
"The name of the selector's help buffer.")
@@ -44,9 +45,11 @@ Each element is a list (KEY DESCRIPTION FUNCTION).
DESCRIPTION is a one-line description of what the key selects.")
(defvar cider-selector-other-window nil
- "If non-nil use `switch-to-buffer-other-window'.")
+ "If non-nil use `switch-to-buffer-other-window'.
+Not meant to be set by users. It's used internally
+by `cider-selector'.")
-(defun cider--recently-visited-buffer (mode)
+(defun cider-selector--recently-visited-buffer (mode)
"Return the most recently visited buffer, deriving its `major-mode' from MODE.
Only considers buffers that are not already visible."
(cl-loop for buffer in (buffer-list)
@@ -64,7 +67,6 @@ Only considers buffers that are not already visible."
The user is prompted for a single character indicating the method by
which to choose a new buffer. The `?' character describes then
available methods. OTHER-WINDOW provides an optional target.
-
See `def-cider-selector-method' for defining new methods."
(interactive)
(message "Select [%s]: "
@@ -85,7 +87,6 @@ See `def-cider-selector-method' for defining new methods."
(defmacro def-cider-selector-method (key description &rest body)
"Define a new `cider-select' buffer selection method.
-
KEY is the key the user will enter to choose this method.
DESCRIPTION is a one-line sentence describing how the method
@@ -127,40 +128,38 @@ is chosen. The returned buffer is selected with
(def-cider-selector-method ?c
"Most recently visited clojure-mode buffer."
- (cider--recently-visited-buffer 'clojure-mode))
+ (cider-selector--recently-visited-buffer 'clojure-mode))
(def-cider-selector-method ?e
"Most recently visited emacs-lisp-mode buffer."
- (cider--recently-visited-buffer 'emacs-lisp-mode))
+ (cider-selector--recently-visited-buffer 'emacs-lisp-mode))
(def-cider-selector-method ?q "Abort."
(top-level))
(def-cider-selector-method ?r
"Current REPL buffer."
- (cider-current-repl-buffer))
-
-(def-cider-selector-method ?n
- "Connections browser buffer."
- (cider-connection-browser)
- cider--connection-browser-buffer-name)
+ (cider-current-repl))
(def-cider-selector-method ?m
"Current connection's *nrepl-messages* buffer."
- (cider-current-messages-buffer))
+ (nrepl-messages-buffer (cider-current-repl)))
(def-cider-selector-method ?x
"*cider-error* buffer."
cider-error-buffer)
+(def-cider-selector-method ?p
+ "CIDER profiler buffer."
+ cider-profile-buffer)
+
(def-cider-selector-method ?d
"*cider-doc* buffer."
cider-doc-buffer)
-(declare-function cider-find-or-create-scratch-buffer "cider-scratch")
(def-cider-selector-method ?s
"*cider-scratch* buffer."
- (cider-find-or-create-scratch-buffer))
+ (cider-scratch-find-or-create-buffer))
(provide 'cider-selector)