Fork me on GitHub

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


we use pjstadig/humane-test-output


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.)


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


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


@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.


thanks! I will have a look at it


@timok you mean clojure defn or emacs-lisp?


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


@ag I mean clojure defn


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


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


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


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


@ag thanks! will try that tomorrow


And why is C-u better than SPC u?


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


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


> 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


Ah, i see. You are right.


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.


super-useful, thank you so much.