File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -199,12 +199,14 @@ has been found. See also variable `inf-clojure-buffer'."
199
199
(unless no-error
200
200
(error " No Clojure subprocess; see variable `inf-clojure-buffer' " ))))
201
201
202
- (defun inf-clojure-repl-p ()
203
- " Indicates if the current buffer is an inf-clojure REPL.
202
+ (defun inf-clojure-repl-p (&optional buf )
203
+ " Indicates if BUF is an inf-clojure REPL.
204
+ If BUF is nil then defaults to the current buffer.
204
205
Checks the mode and that there is a live process."
205
- (and (derived-mode-p 'inf-clojure-mode )
206
- (get-buffer-process (current-buffer ))
207
- (process-live-p (get-buffer-process (current-buffer )))))
206
+ (let ((buf (or buf (current-buffer ))))
207
+ (and (with-current-buffer buf (derived-mode-p 'inf-clojure-mode ))
208
+ (get-buffer-process buf)
209
+ (process-live-p (get-buffer-process buf)))))
208
210
209
211
(defun inf-clojure-repls ()
210
212
" Return a list of all inf-clojure REPL buffers."
You can’t perform that action at this time.
0 commit comments