inf-clojure

GitHub: https://github.com/clojure-emacs/inf-clojure Discord (official chat): https://discord.gg/nFPpynQPME
2021-04-04T03:16:11.010800Z

Hey folks. I’m experimenting using inf-clojure with some lein projects. I added this to my lein profile:

:jvm-opts     ["-Dclojure.server.repl={:port 5555 :accept clojure.core.server/repl}"]
Some questions on inf-clojure + emacs: • I’m running lein repl and then using inf-connect in Emacs. Is that correct? There’s no way to skip the lein repl step, right? • After starting a repl in one lein project, I won’t be able to use another one with this config, as it would attempt to use the same port. Any practical solution for that? (w/o changing the project.clj source code) • The go-to definition functionality won’t work for stuff in m2 (it asks for creating the folder in the maven dir.) I’m using Doom Emacs, if that matters. What do I need to do in order to navigate source code from external libs? (to be honest, I’m not familiar with thisto worked in my previous setup anyway – maybe cider knew how to handle it? If so, any solutions or workarounds for not using cider?

bozhidar 2021-04-04T13:33:20.011900Z

> I’m running lein repl and then using inf-connect in Emacs. Is that correct? There’s no way to skip the lein repl step, right? You can also run lein repl directly in Emacs. This would also solve your other problem with the unique port number. inf-clojure doesn't need a socket REPL per se, as it just runs the REPL process direction in Emacs. > The go-to definition functionality won’t work for stuff in m2 (it asks for creating the folder in the maven dir.) Sounds like some bug to me. Best to file a ticket.

2021-04-04T16:47:07.015500Z

> You can also run `lein repl` directly in Emacs. Do you mean using inf-clojure and selecting lein repl? If so, I’m able to connect to it, but something is adding extra whitespaces to the repl. For example, this is the result of evaluating some namespace twice:

user=>   #_=>   #_=>   #_=> nil
postman.aux.event=>                #_=>                #_=>                #_=> nil
This does not happen when I manually start a lein repl and use inf-connect. I’m wondering if this is a known issue.

2021-04-04T16:49:34.016Z

Also, [1] says that ‘terminal repls’ are discouraged: > It is highly recommended to use a cons pair like `("localhost" . 5555)` to connect to a socket REPL, terminal REPLs are inherently hard to work with and support will be deprecated in the foreseeable future. I’m wondering what exactly is a ‘terminal repl’ in this context. [1]: https://github.com/clojure-emacs/inf-clojure#caveats

2021-04-04T16:53:27.016200Z

> Sounds like some bug to me. Best to file a ticket. Okay, I’ll investigate it further.

bozhidar 2021-04-05T06:28:13.035300Z

Hmm, I missed that message about the future deprecation, and this was never on the table, so I guess I just didn't read carefully enough some PR. 😄

bozhidar 2021-04-05T06:29:05.035500Z

Yeah, I meant just selecting lein repl in the list - new extra prompts likely indicate the evaluation of several expressions or something along those lines.

bozhidar 2021-04-05T06:30:06.035700Z

@dpsutton might be able to share more on the topic.

bozhidar 2021-04-05T06:31:09.035900Z

(I see that according to git blame he added this to the README)

dpsutton 2021-04-05T13:07:32.037300Z

I probably reformatted the paragraph but that copy preceded me

dpsutton 2021-04-05T13:44:03.037500Z

That wording seems to have showed up in this commit: https://github.com/clojure-emacs/inf-clojure/commit/b53074a1eeae9e21f6f99f4d5a96bb294c7ba79a

bozhidar 2021-04-06T07:12:32.037700Z

Ah, okay. I'll just remove it then.

Shantanu Kumar 2021-04-04T11:10:30.011800Z

Hi, is anybody using inf-clojure with clojure-lsp? Can you share any config snippets?

bozhidar 2021-04-04T13:33:20.011900Z

> I’m running lein repl and then using inf-connect in Emacs. Is that correct? There’s no way to skip the lein repl step, right? You can also run lein repl directly in Emacs. This would also solve your other problem with the unique port number. inf-clojure doesn't need a socket REPL per se, as it just runs the REPL process direction in Emacs. > The go-to definition functionality won’t work for stuff in m2 (it asks for creating the folder in the maven dir.) Sounds like some bug to me. Best to file a ticket.

bozhidar 2021-04-04T13:40:05.012500Z

@kumarshantanu This article is for CIDER https://emacs-lsp.github.io/lsp-mode/tutorials/clojure-guide/, but the setup for inf-clojure should be more or less the same.

bozhidar 2021-04-04T13:41:26.014Z

The important thing is decide which version of some functionality do you want in case it's provided by both inf-clojure and lsp - e.g. code completion. In the case of CIDER you'd be leaning more on CIDER's features and in the case of inf-clojure probably people would like to lean more on lsp-mode features.

Shantanu Kumar 2021-04-04T13:43:38.014600Z

@bozhidar Thanks. You intended to share an article link maybe?

bozhidar 2021-04-04T13:43:59.015100Z

Indeed. 😄

2021-04-04T16:47:07.015500Z

> You can also run `lein repl` directly in Emacs. Do you mean using inf-clojure and selecting lein repl? If so, I’m able to connect to it, but something is adding extra whitespaces to the repl. For example, this is the result of evaluating some namespace twice:

user=>   #_=>   #_=>   #_=> nil
postman.aux.event=>                #_=>                #_=>                #_=> nil
This does not happen when I manually start a lein repl and use inf-connect. I’m wondering if this is a known issue.

2021-04-04T16:49:34.016Z

Also, [1] says that ‘terminal repls’ are discouraged: > It is highly recommended to use a cons pair like `("localhost" . 5555)` to connect to a socket REPL, terminal REPLs are inherently hard to work with and support will be deprecated in the foreseeable future. I’m wondering what exactly is a ‘terminal repl’ in this context. [1]: https://github.com/clojure-emacs/inf-clojure#caveats

2021-04-04T16:53:27.016200Z

> Sounds like some bug to me. Best to file a ticket. Okay, I’ll investigate it further.