changeset 103896:a4d216dbf517

* simple.el (kill-visual-line): Obey kill-whole-line (Bug#3695).
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 15 Jul 2009 02:05:32 +0000
parents 8f9899f50e02
children e52d10e14bc0
files lisp/ChangeLog lisp/simple.el
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Jul 15 01:29:41 2009 +0000
+++ b/lisp/ChangeLog	Wed Jul 15 02:05:32 2009 +0000
@@ -1,3 +1,7 @@
+2009-07-15  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (kill-visual-line): Obey kill-whole-line (Bug#3695).
+
 2009-07-15  Chong Yidong  <cyd@stupidchicken.com>
 
 	* simple.el (deactivate-mark): Optional argument FORCE.
--- a/lisp/simple.el	Wed Jul 15 01:29:41 2009 +0000
+++ b/lisp/simple.el	Wed Jul 15 02:05:32 2009 +0000
@@ -4533,7 +4533,8 @@
   (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 @@
 	;; 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.