From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#3437: Add patch to bug #3437 Date: Tue, 09 Jun 2009 18:17:45 +0300 Message-ID: <87ab4hzbae.fsf@iki.fi> Reply-To: Teemu Likonen , 3437@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1244561858 18718 80.91.229.12 (9 Jun 2009 15:37:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Jun 2009 15:37:38 +0000 (UTC) To: 3437@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 09 17:37:35 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ME3OI-0003nF-JS for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2009 17:37:34 +0200 Original-Received: from localhost ([127.0.0.1]:39227 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME3OI-0004DS-3g for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Jun 2009 11:37:34 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ME3OD-0004DH-T9 for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2009 11:37:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ME3O9-0004BV-8V for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2009 11:37:29 -0400 Original-Received: from [199.232.76.173] (port=33004 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ME3O8-0004BI-SA for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2009 11:37:24 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:36085) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ME3O8-0000ki-9j for bug-gnu-emacs@gnu.org; Tue, 09 Jun 2009 11:37:24 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n59FbJsm019460; Tue, 9 Jun 2009 08:37:19 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n59FP563017633; Tue, 9 Jun 2009 08:25:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Teemu Likonen Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 09 Jun 2009 15:25:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3437 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3437-submit@emacsbugs.donarmstrong.com id=B3437.124456067516795 (code B ref 3437); Tue, 09 Jun 2009 15:25:05 +0000 Original-Received: (at 3437) by emacsbugs.donarmstrong.com; 9 Jun 2009 15:17:55 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from jenni2.inet.fi (mta-out.inet.fi [195.156.147.13]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n59FHoVO016788 for <3437@emacsbugs.donarmstrong.com>; Tue, 9 Jun 2009 08:17:52 -0700 Original-Received: from imladris.arda.local (84.251.6.80) by jenni2.inet.fi (8.5.014) id 49F5CB64019EEB34 for 3437@emacsbugs.donarmstrong.com; Tue, 9 Jun 2009 18:17:49 +0300 Original-Received: from dtw by imladris.arda.local with local (Exim 4.69) (envelope-from ) id 1ME357-0001Pr-La for 3437@emacsbugs.donarmstrong.com; Tue, 09 Jun 2009 18:17:45 +0300 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 09 Jun 2009 11:37:29 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28585 Archived-At: --=-=-= 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=simple.el.patch --- 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) --=-=-=--