File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 12731273 ; ; Just verify it differs from the backtracking result
12741274 (expect result :not :to-equal " \n (letfn [(foo [x]\n (+ x 1))]\n (foo 1))" ))))))
12751275
1276+ (describe " clojure-max-backtracking"
1277+ (it " should limit how far up the sexp tree backtracking goes"
1278+ ; ; With max-backtracking = 0, even one level of backtracking is
1279+ ; ; disabled, so letfn bindings lose :defn-style indentation.
1280+ (let ((clojure-max-backtracking 0 ))
1281+ (with-clojure-buffer " \n (letfn [(foo [x]\n (+ x 1))]\n (foo 1))"
1282+ (indent-region (point-min ) (point-max ))
1283+ (let ((result (buffer-string )))
1284+ (expect result :not :to-equal " \n (letfn [(foo [x]\n (+ x 1))]\n (foo 1))" )))))
1285+
1286+ (it " should indent correctly with sufficient backtracking depth"
1287+ ; ; With the default depth (3), letfn works fine.
1288+ (let ((clojure-max-backtracking 3 ))
1289+ (with-clojure-buffer " \n (letfn [(foo [x]\n (+ x 1))]\n (foo 1))"
1290+ (indent-region (point-min ) (point-max ))
1291+ (expect (buffer-string ) :to-equal " \n (letfn [(foo [x]\n (+ x 1))]\n (foo 1))" )))))
1292+
12761293(provide 'clojure-mode-indentation-test )
12771294
12781295; ;; clojure-mode-indentation-test.el ends here
You can’t perform that action at this time.
0 commit comments