Skip to content

Commit e1d7007

Browse files
committed
Touch up the previous commit
1 parent f7b6a8e commit e1d7007

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,14 @@ processes, you might need to change `inf-clojure-buffer` to
317317
whichever process buffer you want to use.
318318

319319
You can use the helpful function `inf-clojure-set-repl`. If called in
320-
an inf-clojure repl buffer, it will assign that buffer as the current
321-
connection (`(setq inf-clojure-buffer (current-buffer)`). If you are
322-
not in an inf-clojure repl buffer, it will offer a choice of
323-
acceptable buffers to set as the repl buffer. If called with a prefix,
320+
an `inf-clojure` REPL buffer, it will assign that buffer as the current
321+
REPL (`(setq inf-clojure-buffer (current-buffer)`). If you are
322+
not in an `inf-clojure` REPL buffer, it will offer a choice of
323+
acceptable buffers to set as the REPL buffer. If called with a prefix,
324324
it will always give the list even if you are currently in an
325-
acceptable repl buffer. Renaming buffers will greatly improve the
325+
acceptable REPL buffer.
326+
327+
**Tip:** Renaming buffers will greatly improve the
326328
functionality of this list; the list "project-1: clojure repl",
327329
"project-2: cljs repl" is far more understandable than "inf-clojure",
328330
"inf-clojure<2>".

inf-clojure.el

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Given a REPL-TYPE ('clojure, 'lumo, ...) and a FEATURE ('doc,
191191

192192
(defun inf-clojure-proc (&optional no-error)
193193
"Return the current inferior Clojure process.
194-
When NO-ERROR is non-nil, don't throw an error when no connection
194+
When NO-ERROR is non-nil, don't throw an error when no process
195195
has been found. See also variable `inf-clojure-buffer'."
196196
(or (get-buffer-process (if (derived-mode-p 'inf-clojure-mode)
197197
(current-buffer)
@@ -200,14 +200,14 @@ has been found. See also variable `inf-clojure-buffer'."
200200
(error "No Clojure subprocess; see variable `inf-clojure-buffer'"))))
201201

202202
(defun inf-clojure-repl-p ()
203-
"Indicates if current buffer is an inf-clojure repl.
203+
"Indicates if the current buffer is an inf-clojure REPL.
204204
Checks the mode and that there is a live process."
205205
(and (derived-mode-p 'inf-clojure-mode)
206206
(get-buffer-process (current-buffer))
207207
(process-live-p (get-buffer-process (current-buffer)))))
208208

209-
(defun inf-clojure-repls-list ()
210-
"Return a list of all known inf-clojure repls."
209+
(defun inf-clojure-repls ()
210+
"Return a list of all inf-clojure REPL buffers."
211211
(let (repl-buffers)
212212
(dolist (b (buffer-list))
213213
(with-current-buffer b
@@ -216,18 +216,18 @@ Checks the mode and that there is a live process."
216216
repl-buffers))
217217

218218
(defun inf-clojure-set-repl (always-ask)
219-
"Set an inf clojure buffer as the active repl.
220-
If in a repl already, use that unless a prefix is used (or
219+
"Set an inf-clojure buffer as the active (default) REPL.
220+
If in a REPL buffer already, use that unless a prefix is used (or
221221
ALWAYS-ASK). Otherwise get a list of all active inf-clojure
222-
repls and offer a choice. Recommended to rename buffers as they
223-
are created with `rename-buffer`."
222+
REPLS and offer a choice. It's recommended to rename REPL
223+
buffers after they are created with `rename-buffer'."
224224
(interactive "P")
225225
(if (and (not always-ask)
226226
(inf-clojure-repl-p))
227227
(setq inf-clojure-buffer (current-buffer))
228-
(let ((repl-buffers (inf-clojure-repls-list)))
228+
(let ((repl-buffers (inf-clojure-repls)))
229229
(if (> (length repl-buffers) 0)
230-
(when-let ((repl-buffer (completing-read "Use for repl: " repl-buffers nil t)))
230+
(when-let ((repl-buffer (completing-read "Select default REPL: " repl-buffers nil t)))
231231
(setq inf-clojure-buffer (get-buffer repl-buffer)))
232232
(user-error "No buffers have an inf-clojure process")))))
233233

@@ -275,13 +275,13 @@ mode. Default is whitespace followed by 0 or 1 single-letter colon-keyword
275275
:type 'regexp)
276276

277277
(defun inf-clojure--modeline-info ()
278-
"Return modeline info.
279-
Either \"not connected\" or \"repl-type: buffer-name\""
278+
"Return modeline info for `inf-clojure-minor-mode'.
279+
Either \"no process\" or \"buffer-name(repl-type)\""
280280
(if (and (bufferp inf-clojure-buffer)
281281
(buffer-live-p inf-clojure-buffer))
282282
(with-current-buffer inf-clojure-buffer
283-
(format "%s: %s" inf-clojure-repl-type (buffer-name (current-buffer))))
284-
"not connected"))
283+
(format "%s(%s)" (buffer-name (current-buffer)) inf-clojure-repl-type))
284+
"no process"))
285285

286286
(defvar inf-clojure-mode-map
287287
(let ((map (copy-keymap comint-mode-map)))
@@ -378,7 +378,7 @@ about mode line templates.
378378
379379
Customize this variable to change how inf-clojure-minor-mode
380380
displays its status in the mode line. The default value displays
381-
the current connection. Set this variable to nil to disable the
381+
the current REPL. Set this variable to nil to disable the
382382
mode line entirely."
383383
:type 'sexp
384384
:risky t)

0 commit comments

Comments
 (0)