Fork me on GitHub
#emacs
<
2018-12-06
>
dpsutton05:12:27

does anyone remember or know offhand of an updated brave and true emacs setup? We got an issue on CIDER and I thought someone had updated the for people following the book. ring a bell with anyone?

Eccentric J06:12:08

I remember some discussion a month ago but I don’t see any related issues or pull requests about it.

felipebarros17:12:43

Many functions return stuff like:

({:month 1, :day 1, :human 5.3, :critter 2.3} {:month 1, :day 2, :human 5.1, :critter 2.0} {:month 2, :day 1, :human 4.9, :critter 2.1} {:month 2, :day 2, :human 5.0, :critter 2.5})
Is there a little command I'm missing that turns that into something like:
({:month 1, :day 1, :human 5.3, :critter 2.3}
 {:month 1, :day 2, :human 5.1, :critter 2.0}
 {:month 2, :day 1, :human 4.9, :critter 2.1}
 {:month 2, :day 2, :human 5.0, :critter 2.5})
That is, besides using multiple-cursors or macroing, of course. Tried cider-format-buffer but it doesn't interfere with situations like these since I guess it would be tricky to detect what was intentional or not.

felipebarros17:12:17

Besides pprint

futuro17:12:37

That sounds like the cider-repl-use-pretty-printing variable.

futuro17:12:56

Or is this outside of the repl?

futuro17:12:37

There's also a slew of cider-pprint-*; perhaps one of those will do what you're looking for?

felipebarros17:12:40

Yeah, just found those cider-pprint-* functions, and they solve my problem documenting code snippets I try, but both in buffer and at the repl they are returned without pretty printing.

felipebarros17:12:58

I don't have that variable it seems...

felipebarros17:12:47

Oh, I have cider-repl-use-pretty-printing and cider-repl-toggle-pretty-printing, nice πŸ˜„

dpsutton17:12:50

if you hit , in the repl you'll see some handy options

dpsutton17:12:56

one of which is require-pretty

dpsutton17:12:04

or toggle-pretty i think

felipebarros17:12:16

Oh, the incantation to pprint to comment in a buffer: C-c C-v C-f C-c C-d gotta love Emacs πŸ™‚

felipebarros17:12:44

@dpsutton Oh, nice, I must check those options more carefully.

felipebarros18:12:16

,toggle-pretty yeah

dpsutton18:12:24

require repl utils is a favorite of mine as well

felipebarros18:12:55

Hm, aren't those the default repl utils like dir, source, etc?

felipebarros18:12:14

At least with my setup those are loaded by default

felipebarros18:12:37

In Cider at least

felipebarros18:12:48

I know they aren't in a plain repl

felipebarros18:12:57

C-u C-c C-p also works just the same as C-c C-v C-f C-c C-d and is much more accessible.

dpsutton18:12:43

they are in user by default. but when you switch namespaces they will no longer be there

dpsutton18:12:55

that second shortcut looks sarcastic lol