all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: 3437@emacsbugs.donarmstrong.com
Subject: bug#3437: Add patch to bug #3437
Date: Tue, 09 Jun 2009 18:17:45 +0300	[thread overview]
Message-ID: <87ab4hzbae.fsf@iki.fi> (raw)

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: simple.el.patch --]
[-- Type: text/x-diff, Size: 951 bytes --]

--- 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)

                 reply	other threads:[~2009-06-09 15:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ab4hzbae.fsf@iki.fi \
    --to=tlikonen@iki.fi \
    --cc=3437@emacsbugs.donarmstrong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.