Fork me on GitHub
#spacemacs
<
2018-03-01
>
Sam H13:03:24

Anyone know how to get better diffs for test failures in spacemacs?

ag18:03:06

we use pjstadig/humane-test-output

jeff.terrell14:03:37

Do you mean like expected vs. actual collections are different, and you want the test failure output to show more clearly where they're different? If so, that seems like less of a spacemacs thing and more of a test library thing. I think speclj might do this, and midje might too. (Lots of people don't like midje; on the other hand, I've been enjoying speclj lately.)

Sam H17:03:24

I’m looking for clearer test output. Need to stick with clojure.test really. https://github.com/venantius/ultra seems good, will have to see how well it plays with cider/spacemacs

timo16:03:58

Is there a possibility to eval a defn in spacemacs and save the output somewhere, like inserting it after the defn?

jeff.terrell16:03:47

@timok - You can do it manually of course: send an expression to the connected cider repl (with , s e I think), then switch to the REPL buffer, copy the result, and paste it into your source buffer. (Though that might not be as interesting on a defn form since IIRC it just returns the var.) I think there may be a cider function to do those steps for you, too. I'd poke around in the helm buffer for SPC SPC cider- and see if anything looks like what you want. If you find something you like, you can create a keybinding for it.

timo16:03:59

thanks! I will have a look at it

ag18:03:40

@timok you mean clojure defn or emacs-lisp?

ag18:03:37

if you give an universal argument to cider-eval-last-sexp it inserts the result in the current buffer

timo18:03:13

@ag I mean clojure defn

timo18:03:04

and I know , e f but searching for something that inserts the result into repl or current buffer. I read that this exists in clojureverse but couldn't find it

ag18:03:17

@timok that's what I said: if you do SPC u , e f - it will put the result back into current buffer

ag18:03:27

although I would suggest to rebind C-u to 'universal-argument, that's Emacs's default and it used a lot

ag18:03:04

Spacemacs unbinds C-u and bind universal-argument to SPC u

timo18:03:47

@ag thanks! will try that tomorrow

spfeiffer18:03:07

And why is C-u better than SPC u?

jeff.terrell19:03:06

Yeah, I'm an old vimmer, so I don't want to unbind C-u (scroll a half-page up). simple_smile

jeff.terrell19:03:22

Nice tip about the SPC u prefix for that command, @ag. 👍

ag19:03:50

> And why is C-u better than SPC u? because it's accessible not just in NORMAL mode. Once you realize that universal-argument is used a lot in Emacs - you would want to have a simple binding for it. Value of universal argument is far more than simply scrolling up half a page

spfeiffer19:03:44

Ah, i see. You are right.

ag19:03:38

yeah, there are many, many cases where universal argument makes a difference. simple examples: - in magit-diff - RET - visits file in other-window - in org mode - TAB - collapses/expands things differently - ag - SPC s f - supplied with an argument, lets you search only in specific kind of files - org-clock-in - with an argument lets you choose a task from the latest ones etc, etc.

jumar10:03:53

super-useful, thank you so much.