summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paredit.el11
1 files changed, 10 insertions, 1 deletions
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)