Fork me on GitHub

Occasionally (and for reasons unknown) I break paredit's "jail", creating unbalanced/missing delimiters. Then determining where the error is can be hard... e.g. the function is 20 LOC long, is the missing parens at the end? in the middle? wondering if there's an emacs (or clojure) function that will tell me "things begin to be broken at line x, column y"


@vemv Two hacks I've found helpful: - evaluating regions, so I can find where the problem isn't - using code-folding: folding a block that's malformed will often get a complaint from the editor about an unbalanced parenthesis


but i don't know about an auto function --- it might even be a harder-than-you'd-think problem, since it's about trying to read data for structure but the data is incorrectly structured

👍 5

hacks noted, thanks! what do you use for code folding? I have some code-folding setup, but I currently don't know how to fold an arbitrary sexp


evil-fold or something. Came with spacemacs


oh, and I use a LOT more do/comment blocks than I used to.... so it can be nice to make a do block for what you're working on, slurp things into it, and evaluate the toplevel


if that all works great, slurp the next form in


when this happens, i go to the top of the file and start hitting paredit-forward until i get a scan error


tried out. doesn't appear to help me point out the exact location (example: place a stray ( in the middle of a defn)


> it might even be a harder-than-you'd-think problem sounds spot on. For example if I insert a stray ( in L50, it might pair with the nearest ) in L51, but things don't start to break until L70. So how could an error reporter notice that something was off in L50 when in fact one can see a perfectly paired ( ...) there? Sounds pretty hard without heuristics that try to understand the meaning of the code


@mathpunk are you familiar with (setq clojure-toplevel-inside-comment-form t)? It changes how top level works so the comment form isn't see as the top level but the forms one level underneath it are


no! if i understand right from your description that is very useful