This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-05
Channels
- # announcements (12)
- # babashka (29)
- # bangalore-clj (3)
- # beginners (153)
- # calva (2)
- # chlorine-clover (46)
- # cider (11)
- # clj-kondo (21)
- # cljfx (20)
- # cljs-dev (3)
- # clojure (393)
- # clojure-australia (2)
- # clojure-europe (15)
- # clojure-spec (40)
- # clojure-uk (1)
- # clojurescript (3)
- # community-development (1)
- # conjure (2)
- # cursive (1)
- # data-oriented-programming (1)
- # datomic (7)
- # defnpodcast (2)
- # docs (2)
- # figwheel-main (5)
- # fulcro (52)
- # graalvm (2)
- # inf-clojure (21)
- # malli (10)
- # meander (6)
- # mid-cities-meetup (13)
- # nrepl (1)
- # off-topic (24)
- # other-languages (1)
- # pathom (3)
- # polylith (18)
- # re-frame (6)
- # reitit (11)
- # ring-swagger (2)
- # shadow-cljs (56)
- # specter (1)
- # xtdb (7)
Hey. The inf-clojure
repl is getting an extra prompt for each newline present in the evaluated form. For example, if I evaluate a form with 5 lines, the repl looks like this:
my.project=> #_=> #_=> #_=> #_=> nil
Anyone facing the same issue? I’m using inf-clojure
and selecting lein repl
.
For some reason, this bug is not reproducible if I start a repl externally and use inf-clojure-connect
.I’ve been using socket repls exclusively. I haven’t tested on a bare repl in a while
Those look like the sub prompts. I think there was some code involved that would make everything a single string and strip new lines for this reason
Oh, I just realized this does not happen when I use inf-clojure-eval-last-sexp
directly, rather than my own fork of lispy
. My bad.
(that’s weird though, as lispy will simply use inf-clojure-eval-last-sexp
with call-interactivelly
[1]. Anyway, will investigate).
[1]: https://github.com/Andre0991/lispy-lite/blob/main/lispy.el#L4237
On the socket repl, I’d like to go to that route, yeap. But since it’s a lein project, I guess using lein repl
is unavoidable, right?
Oh right, I experimented with that as well. The issue is that I haven’t figured out a way of randomising the port in case I need to spin multiple repls - see https://clojurians.slack.com/archives/C9BT75KRC/p1617506171010800
Just out of curiosity: confirmed that (call-interactivelly ’inf-clojure-eval-last-sexp)
inserts the extra prompts, while inf-clojure-eval-last-sexp
(actually called interactivelly by me) doesn’t.
That’s so weird. Maybe something is relying on this-command
. Will investigate.
And I’ll try to run non socket versions more. Also the discord server for cider is more of the official spot for development now these days
By the way, just confirmed that the issue is this-command
, as it has a different value when call-interactivelly
is called: https://github.com/clojure-emacs/inf-clojure/blob/1e99b8246bb1fe7666d613a9ae566e2a939fc2bb/inf-clojure.el#L669
Well, its usage looks legitimate here, of course. I’ll try some workaround.
(add-hook 'comint-preoutput-filter-functions #'inf-clojure-preoutput-filter nil t)
add-hook
is already setting LOCAL
to 't
, so the function that was added to 'comint-preoutput-filter-functions
won’t affect other comint buffers.
In fact, I just opened a shell buffer, inspected comint-preoutput-filter-functions
and #'inf-clojure-preoutput-filter
is not there.
I’ll open an issue about it, but unless I’m missing something, we can simply remove the check
(string-prefix-p "inf-clojure-" (symbol-name (or this-command last-command)))
:thinking_face: