-
-
Notifications
You must be signed in to change notification settings - Fork 44
Occasionally, the wrong REPL type is selected. #151
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
Comments
The repl detection part is not tested and I am not surprised this happens. Maybe at some point I had empty string detection but I removed it for ...reasons... Character based interaction is not good and imho should be at some point deprecated in |
Having said that, this is a bug so you caught it. Nice! |
It's at the heart of comint, so I doubt we can ever deprecate it, but we should certainly promote the usage of the socket REPL (or pREPL). |
I've had some issues with various functions using inf-clojure with Arcadia, and one of them is |
Regarding inf-clojure-detect-repl-type, I found the following in inf-clojure.el: (defvar-local inf-clojure-repl-type nil
"Symbol to define your REPL type.
Its root binding is nil and it can be further customized using
either `setq-local` or an entry in `.dir-locals.el`." ) I wanted to try the setq-local approach and am currently trying the following in an initialization file: (defun arcadia-set-repl-type ()
(setq-local inf-clojure-repl-type 'clojure))
(add-hook 'inf-clojure-mode-hook #'arcadia-set-repl-type) So far it seems to be working -- i.e. I haven't yet observed any attempts at detection via the sending of forms. Does that seem appropriate? |
Yes that var will take precedence over the detection machinery so it is probably good to set it in case things go wrong. |
Thanks for the explanation :) |
Here is how to repro the issue:
At this point the repl type is set to I think either of the following two approaches would solve the repro case I showed above: What do you think @arichiardi ? |
Thanks for the repro. That var needs to be reset to However, we might need option number one in any case if we want to manage "reconnecting". It sounds like a different issue though. Not the original one in this open issue. |
Occasionally, inf-clojure will select the wrong REPL type. The problem appears to start here at inf-clojure--detect-repl-type: https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L297
I added debug messages around inf-clojure--process-reponse-match-p ( https://github.com/clojure-emacs/inf-clojure/blob/master/inf-clojure.el#L1277) and it looks like what is happening is that one of the calls to inf-clojure--process-response, to check if a certain namespace, like planck.repl, is available, will return a blank string, and then the corresponding type will be selected because it isn't nil.
The most obvious symptom of this issue is that the eldoc output will either be absent or show part of an error message. I added a message to print out the type as soon as it was selected, but you can also see it calling the wrong functions if you follow the instructions for logging process activity here: https://github.com/clojure-emacs/inf-clojure#log-process-activity.
To test this, I had to
M-: (setq-local inf-clojure-repl-type nil) RET
in the buffer that I was testing in order for inf-clojure to reattempt to determine the REPL type.Initially, I thought I could reproduce the problem by evaluating the buffer after the REPL starts, but before triggering eldoc (by moving the cursor inside an expression), but I haven't been able to trigger the issue consistently (only about 3 out of 25 attempts).
The text was updated successfully, but these errors were encountered: