diff options
author | Taylor R Campbell <campbell@paredit.org> | 2022-11-26 23:19:43 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@paredit.org> | 2022-11-26 23:42:35 +0000 |
commit | 45209275259c71b1f68cce4760747fa0ccc93b9b (patch) | |
tree | 866f72f794c4fc48c6e275eb18c9490142186962 /test.el | |
parent | 4aed723112fb69e52b51b626ee1e4621ed03631b (diff) |
paredit-kill: Tweak rule for adding space if kill-whole-line is t.
For now, disable the yank part of the test -- with kill-whole-line,
killing and then yanking is not always a noop and it's not clear
making it a noop is the right approach. I don't use kill-whole-line
so I'm not sure what expectations are and I'm reluctant to change it,
except to fix obviously-wrong outcomes like (x|(y)) that should be
(x| (y)).
While here, document the effect of kill-whole-line on paredit-kill.
Diffstat (limited to 'test.el')
-rw-r--r-- | test.el | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -752,13 +752,14 @@ Four arguments: the paredit command, the text of the buffer (";f\n(b\n z|)\n" ";f\n(b\n z|)\n"))) (let ((kill-whole-line t)) - (paredit-test (defun paredit-test-kill () + (paredit-test (defun paredit-test-kill-whole-line () (interactive) - ;; Horrible kludge. Do it once, and then yank to make - ;; sure we get back what we expect. Then do it again, - ;; to get the effects on the buffer the automatic test - ;; framework will check. - (save-excursion + ;; For now the check to see that we yanked the + ;; correct string is disabled, because it isn't quite + ;; right: with kill-whole-line enabled, sometimes it + ;; inserts an extra space to avoid joining two + ;; expressions. + '(save-excursion (let ((kill-ring nil)) (let ((text (buffer-string))) (call-interactively 'paredit-kill) @@ -819,9 +820,8 @@ Four arguments: the paredit command, the text of the buffer ("\"\n\"\n|" error) ("|(a (b) (c)\n (d) (e))" "|" error) - (xfail - "(a| (b) (c)\n (d) (e))" - "(a| (d) (e))" + ("(a| (b) (c)\n (d) (e))" + "(a| (d) (e))" "(a|)" "(a|)") (xfail @@ -885,7 +885,7 @@ Four arguments: the paredit command, the text of the buffer ("|(a ((b) (c)\n (d) (e)) (f))" "|" error) (xfail "(|a ((b) (c)\n (d) (e)) (f))" "(| (f))" "(|)" "(|)") - (xfail "(a| ((b) (c)\n (d) (e)) (f))" "(a| (f))" "(a|)" "(a|)") + ("(a| ((b) (c)\n (d) (e)) (f))" "(a| (f))" "(a|)" "(a|)") (xfail "(a |((b) (c)\n (d) (e)) (f))" "(a | (f))" "(a |)" "(a |)") (xfail "(a (|(b) (c)\n (d) (e)) (f))" @@ -968,8 +968,7 @@ Four arguments: the paredit command, the text of the buffer "(| (f))" "(|)" "(|)") - (xfail - "(a| \"(b) (c)\n ) { ;;;; \n\n\n(d)( (e);\" (f))" + ("(a| \"(b) (c)\n ) { ;;;; \n\n\n(d)( (e);\" (f))" "(a| (f))" "(a|)" "(a|)") @@ -1006,7 +1005,7 @@ Four arguments: the paredit command, the text of the buffer "(a \"(b) (c)\n ) { ;;;; \n\n\n|\" (f))") ("|x(\n)(z)" "|(z)" "|" error) - ("x|(\n)(z)" "x|(z)" "x|" error) + ("x|(\n)(z)" "x| (z)" "x|" error) ("x(|\n)(z)" "x(|)(z)" "x(|)(z)") (xfail "x(\n|)(z)" "x(\n|)(z)") ("x(\n)|(z)" "x(\n)|" error) @@ -1015,7 +1014,7 @@ Four arguments: the paredit command, the text of the buffer ("x(\n)(z)|" error) ("|x\"\n\"(z)" "|(z)" "|" error) - ("x|\"\n\"(z)" "x|(z)" "x|" error) + ("x|\"\n\"(z)" "x| (z)" "x|" error) ("x\"|\n\"(z)" "x\"|\"(z)" "x\"|\"(z)") ("x\"\n|\"(z)" "x\"\n|\"(z)") ("x\"\n\"|(z)" "x\"\n\"|" error) |