conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
2021-04-02T00:18:16.039700Z

nate 2021-04-02T16:40:30.043400Z

hm, does anyone have a handy solution to printing maps without namespace collapsing? for instance, if I have this map: {:player/name "Bob" :player/position :defense}, the result in Conjure prints like this:

#:player{:name "Bob", :position :defense}
most of the time it's ok with me, but sometimes I want to use that output as a literal in my code (like running ,e! to format a map in my code), and this syntax is not as nice as {:player/name "Bob" :player/position :defense}. I've taken to doing this:
#_(binding [*print-namespace-maps* false] 
    (clojure.pprint/pprint player))
and transplanting the output into my code, but I was wondering if anyone else had a better way of doing that.. Any thoughts?

adambros 2021-04-02T18:34:45.043500Z

could you set that var to false globally in a user ns?

adambros 2021-04-02T18:35:16.043700Z

alter-var-root maybe?

nate 2021-04-02T18:37:40.043900Z

ah interesting, maybe have a function in my user ns to toggle it

nate 2021-04-02T18:37:47.044100Z

in case I want that

nate 2021-04-02T18:37:56.044300Z

thanks for the idea @adambros

👍 2
dominicm 2021-04-02T21:53:58.045Z

Just had a poke at conjure's docs. Am I right that there's no evaluation operator? Just mappings which run the commands on visual selections and such?

Olical 2021-04-05T12:43:22.047Z

Oh, that should be <prefix>E<motion>

Olical 2021-04-05T12:45:46.047200Z

That can be remapped to whatever you need of course

dominicm 2021-04-05T14:23:26.047500Z

What's the underlying there? Is it a <plug> mapping?

Olical 2021-04-05T14:25:47.047700Z

There's no plug mappings right now, it's prefixed by local leader by default, https://github.com/Olical/conjure/issues/186 is open until I get around to reworking mappings to be plug based for those that like that

Olical 2021-04-05T14:26:07.048Z

All mapping config is done through let g:conjure#mapping#* values

dominicm 2021-04-05T14:26:33.048200Z

Ah, I'll probably wait it out for that issue

Olical 2021-04-05T14:26:41.048400Z

okay np

dominicm 2021-04-02T21:57:43.045200Z

cider-nrepl supports settings :print-namespace-maps in the nrepl messages, so maybe that can be configured in conjure?

dominicm 2021-04-02T22:00:50.045400Z

https://github.com/Olical/conjure/blob/46b766dee43a97266741087085889751b474fb56/fnl/conjure/client/clojure/nrepl/init.fnl#L30-L32 ah, here you are. If you have cider-nrepl installed, you can change this to cider.nrepl.pprint/pprint and add the print-namespace-maps option. While at it, you could also switch to zprint or something, which might not do this anyway.

dominicm 2021-04-02T22:02:13.045700Z

https://github.com/Olical/conjure/blob/a2298d12aaa2065f4a395f017ee1f3d392db283c/fnl/conjure/client/clojure/nrepl/server.fnl#L67-L76 oh, looks like there's just a short hardcoded list of options supported, even though it varies from printer to printer.

dominicm 2021-04-02T22:02:23.046Z

Probably worth a pr 🙂