summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor R Campbell <campbell@mumble.net>2010-09-18 15:12:18 +0000
committerTaylor R Campbell <campbell@mumble.net>2010-09-18 15:12:18 +0000
commitab99e9398dc136df52cb38d48d3db53b09aa9d44 (patch)
tree39740528e80768f069f26433634f9d273ff4efd3
parent05b2cad7dfa9481aef5a9097a2225849d7d5d078 (diff)
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
-rw-r--r--paredit.el10
1 files 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.