From 2066b4fe21ed0e925edbc3eff9ebf37be74ee77e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 15 Jul 2009 02:05:32 +0000 Subject: [PATCH] * simple.el (kill-visual-line): Obey kill-whole-line (Bug#3695). --- lisp/ChangeLog | 4 ++++ lisp/simple.el | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0215d0aead6..4120f6e1c58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2009-07-15 Chong Yidong + + * simple.el (kill-visual-line): Obey kill-whole-line (Bug#3695). + 2009-07-15 Chong Yidong * simple.el (deactivate-mark): Optional argument FORCE. diff --git a/lisp/simple.el b/lisp/simple.el index 68966cf95a7..959076b11cb 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4533,7 +4533,8 @@ even beep.)" (interactive "P") ;; Like in `kill-line', it's better to move point to the other end ;; of the kill before killing. - (let ((opoint (point))) + (let ((opoint (point)) + (kill-whole-line (and kill-whole-line (bolp)))) (if arg (vertical-motion (prefix-numeric-value arg)) (end-of-visual-line 1) @@ -4545,7 +4546,9 @@ even beep.)" ;; whether the trailing whitespace is highlighted. But, it's ;; OK to just do this unconditionally. (skip-chars-forward " \t"))) - (kill-region opoint (point)))) + (kill-region opoint (if (and kill-whole-line (looking-at "\n")) + (1+ (point)) + (point))))) (defun next-logical-line (&optional arg try-vscroll) "Move cursor vertically down ARG lines. -- 2.39.2