Skip to content

Make conjure#client_on_load option control nREPL popup on Clojure file open#760

Closed
parkuman wants to merge 1 commit intoOlical:mainfrom
parkuman:add-connect-on-load-option
Closed

Make conjure#client_on_load option control nREPL popup on Clojure file open#760
parkuman wants to merge 1 commit intoOlical:mainfrom
parkuman:add-connect-on-load-option

Conversation

@parkuman
Copy link

@parkuman parkuman commented Mar 9, 2026

Overview

Users might be interested in suppressing the nREPL connection popup when first loading a Clojure file. I personally found it quite distracting, especially when just quickly trying to read a Clojure file with no intention of starting a REPL to do work.

This commit makes the setting conjure#client_on_load control that auto nREPL connection on or off. Note that when set to false, Conjure will still auto connect when a form is evaluated as noted in the configuration text file. You can also see it in action in the demo video.

Demo

Before:

Screen.Recording.2026-03-09.at.5.42.36.PM.mov

With client_on_load set to false

Screen.Recording.2026-03-09.at.5.44.11.PM.mov

Notice I load the file and the connection popup doesn't appear. Only when I evaluate a form does it appear, and you can see it still auto connects.

p.s.

I am very open to suggestions! This is just something about Conjure I found particularly annoying and I would love to see it merged.

@russtoku
Copy link
Contributor

This will be very useful to some users.

There is an existing configuration item called g:conjure#client_on_load. It's default value is true.

:he client_on_load says:

If you don't want Conjure to automatically connect you can switch this off.

So, instead of adding connect_on_load, you can just use client_on_load in the M.on-load function in the fnl/conjure/client/clojure/nrepl/init.fnl file.

I've implemented something similar in the Python client's on_load function. However, I forgot to add a note in the Python client's doc.

@parkuman
Copy link
Author

This will be very useful to some users.

There is an existing configuration item called g:conjure#client_on_load. It's default value is true.

:he client_on_load says:

If you don't want Conjure to automatically connect you can switch this off.

So, instead of adding connect_on_load, you can just use client_on_load in the M.on-load function in the fnl/conjure/client/clojure/nrepl/init.fnl file.

I've implemented something similar in the Python client's on_load function. However, I forgot to add a note in the Python client's doc.

Nice! I like the idea of re-using that. Updated.

@parkuman parkuman changed the title Add connection.connect_on_load option to suppress nREPL popup on file open Make conjure#client_on_load option control nREPL popup on Clojure file open Mar 11, 2026
@russtoku
Copy link
Contributor

@parkuman, I can't and don't speak for @Olical but I think he would prefer to leave the default for g:conjure#client_on_load to be false for all Conjure clients and have users set it to true in their own Neovim configuration. This minimizes the impact on existing users; i.e., most probably are expecting the behavior of a connection to the REPL being made when the first source file is edited.

At this point with your PR, only the Python, SQL, Snd-S7, JavaScript, and Clojure clients would obey this setting.

@parkuman parkuman force-pushed the add-connect-on-load-option branch from b4b8d53 to e9f2806 Compare March 11, 2026 20:03
@parkuman
Copy link
Author

@russtoku I might be misunderstanding, but the default for g:conjure#client_on_load is currently set to true which is in line with the deafult behaviour being auto-connect a REPL as you describe.

…ile open

Users might be interested in suppressing the nREPL connection popup when
first loading a Clojure file. This makes the setting
`conjure#client_on_load` controllable by users to turn that auto
connection off.
@parkuman parkuman force-pushed the add-connect-on-load-option branch from e9f2806 to e2020a8 Compare March 12, 2026 18:44
@russtoku
Copy link
Contributor

@russtoku I might be misunderstanding, but the default for g:conjure#client_on_load is currently set to true which is in line with the deafult behaviour being auto-connect a REPL as you describe.

Sorry for the confusion. That was a typo. The default is true.

@Olical
Copy link
Owner

Olical commented Mar 13, 2026

Am I misunderstanding something or can we not get the same behavior by seeing g:conjure#client_on_load to false as Russ mentioned? So we can close this PR and use that option instead? But maybe there's a subtle difference I'm missing!

@parkuman
Copy link
Author

@Olical Ah you're right. I didn't realize that the central gate was in client.fnl, so it is respected by default and I just added a redundant check. Will close 👍

In that case, it seems to me that the JS, SQL, Python clients might not need the second redundant check. Removing the second check locally for the JS client and loading a file i saw the same behaviour with and without that check.

@parkuman parkuman closed this Mar 13, 2026
@russtoku
Copy link
Contributor

I didn't realize that the central gate was in client.fnl, so it is respected by default and I just added a redundant check.

Oh, me, too! You just helped me as well. 😄

In that case, it seems to me that the JS, SQL, Python clients might not need the second redundant check.

OK, I've work to do to clean up the clients that I mentioned. Thanks for your help and working with things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants