Skip to content

Commit c8b49cc

Browse files
committed
Use pcase-let to destructure string boundaries
1 parent ed7f2f9 commit c8b49cc

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

inf-clojure.el

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,14 +1316,11 @@ output from and including the `inf-clojure-prompt`."
13161316
;; Collect the output
13171317
(with-current-buffer redirect-buffer-name
13181318
(goto-char (point-min))
1319-
(let* ((buffer-string (buffer-substring-no-properties (point-min) (point-max)))
1320-
(boundaries (inf-clojure--string-boundaries buffer-string inf-clojure-prompt beg-regexp end-regexp))
1321-
(beg-pos (car boundaries))
1322-
(end-pos (car (cdr boundaries)))
1323-
(prompt-pos (car (cdr (cdr boundaries))))
1324-
(response-string (substring buffer-string beg-pos (min end-pos prompt-pos))))
1325-
(inf-clojure--log-string buffer-string "<-RES----")
1326-
response-string)))))
1319+
(let ((buffer-string (buffer-substring-no-properties (point-min) (point-max))))
1320+
(pcase-let ((`(,beg-pos ,end-pos ,prompt-pos)
1321+
(inf-clojure--string-boundaries buffer-string inf-clojure-prompt beg-regexp end-regexp)))
1322+
(inf-clojure--log-string buffer-string "<-RES----")
1323+
(substring buffer-string beg-pos (min end-pos prompt-pos))))))))
13271324

13281325
(defun inf-clojure--nil-string-match-p (string)
13291326
"Return non-nil if STRING represents a nil REPL response."

0 commit comments

Comments
 (0)