Skip to content

Comint adds *'s to name: #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions inf-clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that's needed? At first I thought so myself, but you might have noticed that I just reverted it, before you added it. :D I don't think that the process name has to be unique or derived from the buffer name. After all - it was always the same until now and this worked just fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this change inf-clojure would make a fundamental mode buffer I end up in a fundamental buffer named *inf-clojure build-your-own-logic-engine* and the correct inf-clojure repl buffer is hidden and named **inf-clojure build-your-own-logic-engine**
image

Copy link
Contributor Author

@dpsutton dpsutton Mar 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prior to this change the string "inf-clojure" was passed in, and the buffer name we used was "*inf-clojure*" for this reason

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. that's from IELM:

image

Seems to me there's no need for the names to match, but I might be missing something. I no longer remember comint's APIs well. :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you're right. That's the only place where we pass the buffer name anyways. :D I wonder what I was thinking when I deleted this. :D

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suspect that's the disambiguation that they do when they do match. ie, the same name goes in and it adds a 1 on the end. I suspect the best thing to do is actually start up the repl and then rename it repl-projec-name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably right, I didn't dwell on this much. I was also thinking of making the naming template configurable in case someone wants different names by default.

(inf-clojure-mode)
(setq-local inf-clojure-repl-type repl-type)
(hack-dir-local-variables-non-file-buffer))))
Expand Down