branch: elpa/paredit
commit ab99e9398dc136df52cb38d48d3db53b09aa9d44
Author: Taylor R Campbell <[email protected]>
Commit: Taylor R Campbell <[email protected]>
Simplify definition of `paredit-kill-line-in-string'.
Ignore-this: 2675f8bbbfd6cd029b434f233344b4a2
Now it relies on Emacs's S-expression parser to find where the string
ends, rather than parsing and handling character escapes itself. It
does a little more work this way, because it moves forward over the
whole string even if the line ends long before the string ends, but
this definition is simpler and more robust for correctness.
darcs-hash:20100918151218-00fcc-5362e4359bb7ce34076f875c6d8b3eb444f0f360
---
paredit.el | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/paredit.el b/paredit.el
index 550de92..c4e19f3 100644
--- a/paredit.el
+++ b/paredit.el
@@ -1356,13 +1356,9 @@ With a numeric prefix argument N, do `kill-line' that
many times."
;; Be careful not to split an escape sequence.
(if (paredit-in-string-escape-p)
(backward-char))
- (let ((beginning (point)))
- (while (not (or (eolp) (eq ?\" (char-syntax (char-after)))))
- (forward-char)
- ;; Skip past escaped characters.
- (if (eq (char-before) ?\\ )
- (forward-char)))
- (kill-region beginning (point))))))
+ (kill-region (point)
+ (min (point-at-eol)
+ (cdr (paredit-string-start+end-points)))))))
(defun paredit-kill-sexps-on-line ()
(if (paredit-in-char-p) ; Move past the \ and prefix.