clojure-emacs / inf-clojure

Basic interaction with a Clojure subprocess
249 stars 45 forks source link

Function to select repls as the current active connection #190

Closed dpsutton closed 3 years ago

dpsutton commented 3 years ago

Helpful little function to ease the use case of multiple connections. There's a global connection that all commands use: inf-clojure-buffer. Changing this allows using different connections. This function just sets that to current buffer if in a repl, shows a list of live process inf-clojure repls if not, and if given a prefix, always shows a list so you can switch even if you're currently in a repl. The repl type is in a defvar-local inf-clojure-repl-type so that doesn't need to be set or re-inferred.

Renaming buffers with projects and repl types makes this quite nice, and the dead simple way it works means that things can be evaluated from any buffer (project irrespective) and no edge cases like last focused buffer or anything like that.

image
bbatsov commented 3 years ago

Nice little change indeed. Might also be a good idea to update the modeline for inf-clojure-minor-mode to display the active REPL (similar to what CIDER does). That's another simple change.

arichiardi commented 3 years ago

Looks like I will have to try inf-clojure again 😃 Good idea here!

dpsutton commented 3 years ago
image image
bbatsov commented 3 years ago

Nice!