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.

Full log


View this message in rfc822 format

From: Teemu Likonen <tlikonen <at> iki.fi>
To: 3437 <at> debbugs.gnu.org
Subject: bug#3437: 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)

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

Previous Next


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