This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (3)
- # babashka (17)
- # beginners (163)
- # bristol-clojurians (1)
- # calva (18)
- # chlorine-clover (17)
- # clj-kondo (13)
- # cljs-dev (50)
- # cljsjs (3)
- # cljsrn (13)
- # clojure (218)
- # clojure-dev (5)
- # clojure-europe (9)
- # clojure-italy (10)
- # clojure-nl (8)
- # clojure-uk (107)
- # clojurescript (25)
- # conjure (163)
- # cursive (63)
- # data-science (9)
- # datomic (38)
- # docker (1)
- # figwheel (34)
- # figwheel-main (3)
- # fulcro (15)
- # graalvm (1)
- # helix (12)
- # jobs (3)
- # juxt (5)
- # kaocha (3)
- # lein-figwheel (2)
- # leiningen (6)
- # luminus (2)
- # malli (1)
- # meander (12)
- # nrepl (4)
- # rdf (2)
- # re-frame (2)
- # reagent (7)
- # reitit (5)
- # remote-jobs (2)
- # rum (1)
- # shadow-cljs (65)
- # spacemacs (27)
- # tools-deps (18)
- # vim (19)
- # xtdb (2)
Hi, I have a question about Conjure’s eval. Is it possible to exclude a function from
clojure.core , replace it with another function in the namespace and do eval with the new function.
Concretely, suppose I have:
With Conjure’s eval, I get:
(ns some-app.core (:refer-clojure :exclude [count])) (defn count [_] 1)
But on the actual REPL:
; lein/eval | (ns some-app.core (:refer-clojure :exclude [count])) ; lein/ret ⤸ nil ; lein/eval | (defn count [_] 1) ; lein/ret ⤸ #'some-app.core/count ; lein/eval | (count [1 2 3]) ; lein/ret ⤸ 3
Looking at the
user=> (ns some-app.core #_=> (:refer-clojure :exclude [count])) nil some-app.core=> some-app.core=> (defn count [_] 1) #'some-app.core/count some-app.core=> some-app.core=> (count [1 2 3]) 1
plugged/conjurefolder, I’m on commit
NVIM v0.4.3. Would appreciate any help I can get! Cheers!
Ah, you're on the older Conjure! I'm about to release the one on the develop branch which is a total rewrite. It doesn't have this issue (I just tried it) and it uses nREPL instead of prepl (like every other Clojure tool) which is VERY well documented.
Would you like some help upgrading? I promise the new experience is better in near enough every way. It has a very similar UX, just polished and a lot easier to get started.
I can try upgrading! Do you have a set of instructions? It’s not on the docs yet right?
So everything you need should be here https://github.com/Olical/conjure/tree/develop and once installed, in
:help conjure (to work out how to configure mappings etc)
Essentially, swap to develop, remove the
bin/compile stuff (no longer needed). Start an nREPL server then open a Clojure file. nREPL is standard basically everywhere, Conjure was the weird one using prepl 😅
But yeah, tried it in the new one and it worked fine, before I realised you were on the old version.
I'm basically soft deprecating the currently released version already, my rewrite is just a lot better.
Hi Oli, I managed to get it to work after half an hour of tinkering! The new Conjure is awesome! Definitely a more seamless experience to get started.
I do have one question though, in the old Conjure, the log buffer opens automatically, and I could adjust the log size. However, in the new Conjure, I have to do
<localleader>lv to open it. This is not as good as before because i) I have to trigger it, ii) the active pane becomes the log buffer, so I have to move over and iii) I have to resize it. Is there a command that I can use to open the log buffer, so that I’m at least one
Edit: managed to get this to work
nmap <Space>al <Space>lv<C-W><C-H>:exe "vertical resize " . (winwidth(0) * 5/4)<CR>. I think it’s okay now!
Oh sweet, well done for working it out! Yeah, there's no special way to do that right now
When I get around to implementing some sort of event system you can hook into "log opened" and resize then too
Oh that's really interesting, thanks for the report! I can't actually see a reason why that wouldn't work. I'll take a stab at it!
Like I'm setting the NS to some-app.core before the eval, so count should be that. I'm never specifying "I need clojure.core" (other than for things like load-file)
Anyone experience the issue (I don't think this is releated to conjure, could be vim-clap?) where the pop-up window appears, but never goes away - have to restart vim...
Oh that's odd, yeah, wouldn't be conjure. I can get vim clap into a broken state like that. I just restart vim
I found a way the HUD could get stuck open: If you save it and don't have bufhidden set, when it closes (or tries to) Vim will say no because it's not saved and it's the last window of that buffer!
but now if you managed to get the HUD window to fail to close (still don't know how you'd do this unless you actively set things in the log buffer), it won't lose sink
So if it's a temporary error you can just move the cursor again and it'll close, it won't become a phantom window you can't kill.
Writing plugins in Fennel is a joy
(defn close-visible  (let [buf (upsert-buf)] (close-hud) (->> (nvim.tabpage_list_wins 0) (a.filter (fn [win] (= buf (nvim.win_get_buf win)))) (a.run! #(nvim.win_close $1 true)))))
Done, you can now use
<prefix>lq to close all visible log windows in your tab (including the HUD!)
So if everything's still looking good on Monday (maybe earlier?) I think I'll release this candidate! Started working on Aniseed documentation too since it goes hand in hand with this.
Got a big list of things to do after release, but I'm happy with the feature set and stability of develop right now, I think it's a great replacement for master, please correct me if I'm wrong!
Gives me more time to document and stuff over the weekend + maybe people will find issues if they're doing weekend hacking.
If anyone wants to write up a wiki page with a workflow (regular JVM, shadow-cljs, CIDER etc) then please let me know. I'm going to write some soon but more than happy for others to jump in front with how they like to set things up!
Or write a blog post and I'll feature it on the Wiki. I've marked all of the existing posts and stuff as for the
legacy-jvm branch, so I need some fresh articles now 😄
I'll try and find time this weekend to have a play :) Or maybe in 10 minutes... Entirely predicated on whether my Cljs still builds after running sed over it.
Haha, definitely not type safe. And yeah, any feedback will be really appreciated! In theory the whole nREPL side is covered, muuuuch more "it just works" than prepl. The stuff that could break would be UI/UX or plugin / OS conflicts.
When it was prepl based, the transport and the UI were my problem. Now it's mostly UI/UX (until I start fixing piggieback or nREPL things)
I feel like we've gone down the same journey now (except you worked harder) 😀 It's a thorny path. I'm thinking being nREPL/cider based is going to make things work more smoothly for me & my esoteric setups
Yep, I think a lot of things will "just work" now and I can't wait. I know you swap out your eval function? So maybe I need to add some config to allow that sort of thing? But it's possible now.
@olical is it a known thing that
make compile on develop fails on macos? (seems to be because Darwin
cp lacks the
Yep, RosaControl on twitter pointed that out, I think she fixed Aniseed's repo and I need to port the change over to Conjure's makefile?
Ah this was the change on Aniseed, it was to do with find https://github.com/Olical/aniseed/commit/56d34ef6dab9defe1c3ab67662ad27d2c6bef027
(seems like some
sed shenanigans too:
deps/aniseed/scripts/compile.sh deps/aniseed/scripts/embed.sh aniseed conjure sed: 1: "lua/conjure/aniseed/eva ...": extra characters at the end of l command
Hmm, maybe without
-u is the same... not sure why I need it now, maybe it was just a guard that I added without really needing it.
If it works totally fine without it maybe I should remove it, that'd be a change to Aniseed.
according to the linux server I’m ssh’d into right now.
-u, --update copy only when the SOURCE file is newer than the destination file or when the destination file is missing
Yep, so I don't really know how it'll behave without it :thinking_face: I don't think it's required.
happy to contrib a patch for
embed.sh that uses this oft-used snippet of mine. Seems
cp -r and
sed -i '' "s/,,," gets me to a passing
this is my hack around the
sed -i issue:
if [[ "$(uname -s)" == "Darwin" ]]; then edit_in_place='-i ""' else edit_in_place="-i" fi sed $edit_in_place ...
I just started using the new conjure in
develop and I'm really liking it. One "issue" I noticed is that (compared to fireplace) it doesn't seem to do as good a job finding
.nrepl-port. Fireplace uses
findfile() to search up from the current file (i think?), while conjure seems to just looks in the currrent working directory. Any chance that functionality could be added?
Ah yes, that's a very good point! Was thinking about this the other day actually 😅 I'll add it to the list
thanks! Great work so far (on aniseed too, i'm in the proces of converting all my vim config to use
aniseed.dotfiles and it's so nice)
Oh that's great to hear! I'm working on documenting aniseed properly using vim help too!
Not sure if this is a bug or not but I just did the following:
(print "Hello world")
<localleader>eb. The output when I do this is
nil(which is fine) but there's no other output at all. If I instead use
printlnthen it works (as I would expect it) and outputs
nilwhile also recording that
"Hello world"was sent to stdout.
Everyone says this but I'm also compelled to note how ridiculously lightweight this feels. Maybe that's partly Babashka but wow.
Ah okay, when I tried it I saw all stdout going to the terminal I started the nREPL in :thinking_face:
Mentioned it in the channel but it's a hard thing to call, you might want stdout there
For what it's worth, writing
(print "Hello world") in BB's REPL (not nREPL), does output
first bit of feedback: conjure doesn't try and find my .nrepl-port file if I start the nrepl after launching vim. It just shouts at me that it doesn't work. I think auto-connect on eval etc is ok
Something I got used to with fireplace is that it auto-requires the current ns :thinking_face: I'll probably adjust to that
It would be cool if Conjure converted ANSI escape sequences into highlighting. As it's a buffer you can rip off some of the ANSI highlighting plugins
I mentioned this with Conjure before, but docs should not be comments in the popup buffer. They're harder to read, especially in floating windows. Ideally they'd be their own type that gets highlighted. Here's how I did it in replant: https://github.com/SevereOverfl0w/vim-replant/blob/c2e2e7e18a47b246735c909e3afba9ce861e463b/src/replant.lisp#L79-L194 But a good start would be just not using comments tbh.
Yeah, that's already in the issues list, been there a while, the escape sequences I mean
Hmm, maybe a syntax + making it an actual comment because I want the log buffer to all be valid clojure
Mmmm kinda goes against my whole "everything is in the log buffer for history reasons" :thinking_face: I'll keep it in my head, for now maybe tweak how your comments show up? Mine are very readable.
I'm really sensitive to fonts/color, so I've spent a lot of time tuning it, so I apologize. But the docstring doesn't stand out at all. I have to scan, a lot to pick out what I'm looking for.
I'd prefer to not use a custom command for config, I'd rather just use g:/b: variables as applicable.
g:conjure_config is purely for those lazy loading Conjure, so the command isn't around yet.
it's custom because I store them all as data within lua land, where the data types are nice and the water is warm
Also I need fast non-interop access to them all the time and I don't know if the C bridge incurs a slight penalty in a tight loop
Other reason for the custom command is to give you a nice syntax for configuring the generic conjure things as well as configuring the individual language clients
> If you need programmable access to the config that can easily be provided. It's more that, I don't want to learn new stuff too much. I know motions, I know mappings, etc. If you had skipped <Plug> and not given me a way to define my own mappings using nmap I'd be equally frustrated. I want to minimize knowledge, I'm very lazy.
I think you can technically watch
g: in order to be notified of updates if you need to cache something in response.
:thinking_face: I'll give it some thought, it's a big change for the system, but might be worth it
I know how to get the current value of one of those, I don't know how to use this custom config system
Conjure marks it as an "initial config", hmm. Not a big fan tbh. Like, I know I can do
g:conjure_nrepl_refresh_before to get current before, or
get(g:, 'conjure_nrepl_refresh_before', 'dev/stop') to get it or a default, etc.
I'd rather use vim concepts I already know, than learn a new system.
Just looked at
:nmap, It would also be useful to have
<Plug> mappings for everything so you can change the lua without me caring. I see there's some prefix thing, but being able to decide that ",E" is too difficult to type compared to "cp" is something I can't choose in the current system.
<Plug> mappings give me that.
Prefixes are a handy tool in plugins, but an option to disable outright is good too.
Example of what I want to read in the doc: https://github.com/romainl/vim-qf/blob/master/doc/qf.txt#L85-L139