From adfccc519e17f3e7a3596fe20480398d9ea0956a Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Mon, 11 Apr 2011 18:08:57 +0000 Subject: Check `paredit-kill' in a comment more carefully. Ignore-this: 15f19e277834ce01b503d4adde69f56e darcs-hash:20110411180857-00fcc-c3b0a9464be06835aaf1ce7fb06034c31705ea37 --- paredit.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/paredit.el b/paredit.el index 72d7544..0541382 100644 --- a/paredit.el +++ b/paredit.el @@ -1400,7 +1400,7 @@ With a numeric prefix argument N, do `kill-line' that many times." ((paredit-in-string-p) (paredit-kill-line-in-string)) ((paredit-in-comment-p) - (kill-line)) + (paredit-kill-line-in-comment)) ((save-excursion (paredit-skip-whitespace t (point-at-eol)) (or (eolp) (eq (char-after) ?\; ))) ;** Be careful about trailing backslashes. @@ -1421,6 +1421,15 @@ With a numeric prefix argument N, do `kill-line' that many times." (min (point-at-eol) (cdr (paredit-string-start+end-points))))))) +(defun paredit-kill-line-in-comment () + ;; If we're at the end of line, this is the same as deleting the line + ;; end, which `paredit-forward-delete-in-comment' handles carefully. + ;; The variable `kill-whole-line' is not relevant: the point is in a + ;; comment, and hence not at the beginning of the line. + (if (eolp) + (paredit-forward-delete-in-comment) + (kill-line))) + (defun paredit-kill-sexps-on-line () (if (paredit-in-char-p) ; Move past the \ and prefix. (backward-char 2)) ; (# in Scheme/CL, ? in elisp) -- cgit v1.2.1