sanel / monroe

Clojure nREPL client for Emacs
161 stars 21 forks source link

Use buffer-detected ns when doing monroe-jump. #17

Closed technomancy closed 7 years ago

technomancy commented 7 years ago

Previously the current ns of the monroe repl buffer would determine how the var resolution would happen; this allows you to leave your repl buffer alone when jumping in any open buffer.

sanel commented 7 years ago

Previous behavior was that var resolution would happen in only current ns run by repl, if I got you right?

Also, I'd be careful of direct (clojure-find-ns) usage. It is clojure-mode specific function and will fail if clojure-mode wasn't loaded.

And I've noticed one thing: monroe-jump would not jump to line of resolved var, but just open source file and keep cursor at the top of it.

technomancy commented 7 years ago

Previous behavior was that var resolution would happen in only current ns run by repl, if I got you right?

Yes, I would consider this a bug.

Also, I'd be careful of direct (clojure-find-ns) usage. It is clojure-mode specific function and will fail if clojure-mode wasn't loaded.

I see--I assumed clojure-mode.el was a dependency since it's the first thing listed in the readme under the install instructions, but looking at the code I can see it is probably intended to be an optional dependency? Maybe the readme should be updated.

I've updated monroe-jump to make that function optional; it falls back to the old behavior.

And I've noticed one thing: monroe-jump would not jump to line of resolved var, but just open source file and keep cursor at the top of it.

Yes, this patch fixes that problem too.

sanel commented 7 years ago

Maybe the readme should be updated.

In readme it is stated: ... generic approach - you can use it with other languages than Clojure, but yes, readme could be organized better.

Thanks for the patch and quick fix.

technomancy commented 7 years ago

cool; thanks!