Fork me on GitHub
#cider
<
2017-04-14
>
Lambda/Sierra13:04:10

How can I set clojure-indent-style as a file-local variable?

Lambda/Sierra13:04:43

To answer my own question,

;; Local Variables:
;; clojure-indent-style: always-indent
;; End:

Lambda/Sierra13:04:08

(no leading colon on always-indent)

voxdolo16:04:32

Is there any way to get the debugger to break at exactly the point in the function where you set it at? seems to go through every s-expression prior to it first (or is this just some weirdness with spacemacs?)

voxdolo16:04:13

tanzoniteblack okay, it's definitely spacemacs weirdness (or maybe just missing functionality) then, since there's no equivalent binding for #break... it just binds #dbg on the function you're inside of

tanzoniteblack16:04:01

you don't need a binding for #break

tanzoniteblack16:04:10

if you have a function like

(defn test-fn [x]
  (if (even? x)
    #break (* 3 x)
    (* 2 x)))

tanzoniteblack16:04:33

and then you eval it with cider-eval-defun-at-point (`C-M-x` in normal keybindings)

tanzoniteblack16:04:59

it will open the debugger if you get to the line that has the #break (i.e. pass in an even number)

tanzoniteblack16:04:13

(defn test-fn [x]
  (if (even? x)
    #dbg (* 3 (inc x))
    (* 2 x)))
with #dbg works the same, except instead of only showing you the results for the entire sexp (* 3 (inc x)) like #break would, #dbg will let you step through all the sexp inside the fn

voxdolo16:04:08

@tanzoniteblack I think Spacemacs breaks #dbg and #break. normal function invocation (this happens to be a web app endpoint controller-style function) doesn't pause execution at all and C-M-x isn't really a great option here because there's a rather large and complicated request map required as input.