GNU bug report logs - #3437
23.0.91; kill-visual-line at the end of logical line deletes also th next line

Previous Next

Package: emacs;

Reported by: Teemu Likonen <tlikonen <at> iki.fi>

Date: Sun, 31 May 2009 17:15:04 UTC

Severity: normal

Tags: patch

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 3437 in the body.
You can then email your comments to 3437 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3437; Package emacs. (Sun, 31 May 2009 17:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sun, 31 May 2009 17:15:05 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: emacs-pretest-bug <at> gnu.org
Cc: rfrancoise <at> debian.org
Subject: 23.0.91; kill-visual-line at the end of logical line deletes also th next line
Date: Sun, 31 May 2009 20:08:42 +0300
When "kill-visual-line" command is executed at the end of line it kills
the next line up to the cursor column. To reproduce:

 1. Take a scratch buffer. Turn on visual-line-mode:

        C-u M-x visual-line-mode RET

 2. Put the following lines to the buffer (at the column 0):

        foobar
        123456789

 3. Move the cursor at the end of "foobar" line.

 4. Execute kill-visual-line (C-k). The buffer looks like this:

        foobar789


I think the expected result would be

        foobar123456789

with the point between "r" and "1". This is how "kill-line" works, that
is, only kill the newline.



In GNU Emacs 23.0.91.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11))
 of 2009-03-21 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20090320-1~lenny1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.91/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.91/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fi_FI.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  TeX-PDF-mode: t
  gnus-agent-mode: t
  shell-dirtrack-mode: t
  gnus-undo-mode: t
  ergo-movement-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3437; Package emacs. (Tue, 09 Jun 2009 15:25:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Teemu Likonen <tlikonen <at> iki.fi>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Tue, 09 Jun 2009 15:25:09 GMT) Full text and rfc822 format available.

Message #10 received at 3437 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: 3437 <at> debbugs.gnu.org
Subject: Add patch to bug #3437
Date: Tue, 09 Jun 2009 18:17:45 +0300
[Message part 1 (text/plain, inline)]
Here's a patch that does what I mean. It changes the original "if" form
to "cond" form and adds a condition branch for the case when the point
is at the end of logical line:

    (cond ((eolp)
           (goto-char (1+ (point))))
          ...)

The semantics of the original "if" form is reproduced in the place of
"..." above, that is, as other "cond" branches.

[simple.el.patch (text/x-diff, inline)]
--- simple.el.orig	2009-06-09 17:42:26.000000000 +0300
+++ simple.el	2009-06-09 17:54:16.000000000 +0300
@@ -4488,15 +4488,18 @@
 	  (signal 'end-of-buffer nil))
       (setq end (save-excursion
 		  (end-of-visual-line) (point)))
-      (if (or (save-excursion
-		;; If trailing whitespace is visible,
-		;; don't treat it as nothing.
-		(unless show-trailing-whitespace
-		  (skip-chars-forward " \t" end))
-		(= (point) end))
-	      (and kill-whole-line (bolp)))
-	  (line-move 1)
-	(goto-char end)))
+      (cond ((eolp)
+	     (goto-char (1+ (point))))
+	    ((or (save-excursion
+		   ;; If trailing whitespace is visible,
+		   ;; don't treat it as nothing.
+		   (unless show-trailing-whitespace
+		     (skip-chars-forward " \t" end))
+		   (= (point) end))
+		 (and kill-whole-line (bolp)))
+	     (line-move 1))
+	    (t
+	     (goto-char end))))
     (kill-region opoint (point))))
 
 (defun next-logical-line (&optional arg try-vscroll)

Tags added: patch Request was from Teemu Likonen <tlikonen <at> iki.fi> to control <at> emacsbugs.donarmstrong.com. (Wed, 10 Jun 2009 03:00:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3437; Package emacs. (Sat, 13 Jun 2009 19:05:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chong Yidong <cyd <at> stupidchicken.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 13 Jun 2009 19:05:05 GMT) Full text and rfc822 format available.

Message #17 received at 3437 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Teemu Likonen <tlikonen <at> iki.fi>
Cc: Deniz Dogan <deniz.a.m.dogan <at> gmail.com>,
        Rudi Schlatte <rudi <at> constantly.at>, emacs-devel <at> gnu.org,
        3437 <at> debbugs.gnu.org
Subject: Re: Please consider fixing #3437 before release
Date: Sat, 13 Jun 2009 14:57:31 -0400
I've checked in a fixed-up version of kill-visual-line into CVS.  Please
test it and see if there are any problems.



Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#3437; Package emacs. (Sat, 13 Jun 2009 19:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Deniz Dogan <deniz.a.m.dogan <at> gmail.com>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Sat, 13 Jun 2009 19:15:04 GMT) Full text and rfc822 format available.

Message #22 received at 3437 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Deniz Dogan <deniz.a.m.dogan <at> gmail.com>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Teemu Likonen <tlikonen <at> iki.fi>, Rudi Schlatte <rudi <at> constantly.at>,
        emacs-devel <at> gnu.org, 3437 <at> debbugs.gnu.org
Subject: Re: Please consider fixing #3437 before release
Date: Sat, 13 Jun 2009 21:09:28 +0200
2009/6/13 Chong Yidong <cyd <at> stupidchicken.com>:
> I've checked in a fixed-up version of kill-visual-line into CVS.  Please
> test it and see if there are any problems.
>

Seems fixed to me.

-- 
Deniz Dogan



bug closed, send any further explanations to Teemu Likonen <tlikonen <at> iki.fi> Request was from Chong Yidong <cyd <at> stupidchicken.com> to control <at> emacsbugs.donarmstrong.com. (Sat, 13 Jun 2009 19:35:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sun, 12 Jul 2009 14:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 350 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.