summaryrefslogtreecommitdiff
path: root/test.el
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@mumble.net>2011-04-09 18:25:23 +0000
committerTaylor R Campbell <campbell@mumble.net>2011-04-09 18:25:23 +0000
commit6918d89538657a9d31efdb1f51465df65bb4bb7f (patch)
tree813d9e8ea947160f711ae21d1983585f83bead7b /test.el
parent678d843137c5a58b586ad0fd6eafe06dfdcf3cce (diff)
Don't indent while the buffer is in intermediate broken states.
Ignore-this: eb090de24ae6a8502605aefee51420a4 Emacs may have indentation methods that rely on the buffer's being balanced. The change to `paredit-forward-barf-sexp' is OK because when `paredit-forward-and-indent' calls `indent-region', the point will be on the same line as the closing delimiter, so it will get indented correctly. Add regression tests. darcs-hash:20110409182523-00fcc-5ed49a704f12afa1fb9353eb8dcd5d97e963964c
Diffstat (limited to 'test.el')
-rw-r--r--test.el17
1 files changed, 17 insertions, 0 deletions
diff --git a/test.el b/test.el
index 987048a..ddb61c8 100644
--- a/test.el
+++ b/test.el
@@ -183,4 +183,21 @@ Four arguments: the paredit command, the text of the buffer
;; (";;|foo(" ";|foo(" error)
))
+(defun paredit-canary-indent-method (state indent-point normal-indent)
+ (check-parens)
+ nil)
+
+(put 'paredit-canary 'scheme-indent-function 'paredit-canary-indent-method)
+
+;;; Check for regressions the indentation behaviour of forward slurping
+;;; and barfing.
+
+(paredit-test 'paredit-forward-slurp-sexp
+ '(("(paredit-canary|)\n(lose)"
+ "(paredit-canary|\n (lose))")))
+
+(paredit-test 'paredit-forward-barf-sexp
+ '(("(paredit-canary| ;\n (lose))")
+ ("(paredit-canary| ;\n)\n(lose)")))
+
;++ Killing commands...ugh...