diff options
author | Taylor R Campbell <campbell@mumble.net> | 2010-09-18 15:12:18 +0000 |
---|---|---|
committer | Taylor R Campbell <campbell@mumble.net> | 2010-09-18 15:12:18 +0000 |
commit | ab99e9398dc136df52cb38d48d3db53b09aa9d44 (patch) | |
tree | 39740528e80768f069f26433634f9d273ff4efd3 /paredit.el | |
parent | 05b2cad7dfa9481aef5a9097a2225849d7d5d078 (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
Diffstat (limited to 'paredit.el')
-rw-r--r-- | paredit.el | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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. |