From 7884a429f86df7780d661f853dd25b3228f06404 Mon Sep 17 00:00:00 2001 From: dan sutton Date: Mon, 22 Mar 2021 08:59:18 -0500 Subject: [PATCH] Comint adds *'s to name: docstring: The name of the buffer is made by surrounding NAME with `*'s. Otherwise you end up in a fundamental mode buffer unconnected to the process. --- inf-clojure.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inf-clojure.el b/inf-clojure.el index 88a9c86..c9ede40 100644 --- a/inf-clojure.el +++ b/inf-clojure.el @@ -750,9 +750,11 @@ process buffer for a list of commands.)" nil 'confirm-after-completion)))) (let* ((project-dir (clojure-project-dir)) - (repl-buffer-name (if project-dir - (format "*inf-clojure %s*" (inf-clojure--project-name project-dir)) - "*inf-clojure*"))) + (process-buffer-name (if project-dir + (format "inf-clojure %s" (inf-clojure--project-name project-dir)) + "inf-clojure")) + ;; comint adds the asterisks to both sides + (repl-buffer-name (format "*%s*" process-buffer-name))) ;; Create a new comint buffer if needed (unless (comint-check-proc repl-buffer-name) ;; run the new process in the project's root when in a project folder @@ -766,7 +768,7 @@ process buffer for a list of commands.)" (inf-clojure--prompt-repl-type)))) (message "Starting Clojure REPL via `%s'..." cmd) (with-current-buffer (apply #'make-comint - "inf-clojure" (car cmdlist) nil (cdr cmdlist)) + process-buffer-name (car cmdlist) nil (cdr cmdlist)) (inf-clojure-mode) (setq-local inf-clojure-repl-type repl-type) (hack-dir-local-variables-non-file-buffer))))