all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Copley <rcopley@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 41934@debbugs.gnu.org
Subject: bug#41934: reverse-region no longer works
Date: Thu, 18 Jun 2020 18:59:21 +0100	[thread overview]
Message-ID: <CAPM58ojjwcr_cquxyjsejpeHbdtiuf=V8jnq490KXaDFdAQD1w@mail.gmail.com> (raw)
In-Reply-To: <CAPM58oi==RcRJGdvOA34bW2R5MDz7=GHFtcYe9=8cHYRWUfBuA@mail.gmail.com>

On Thu, 18 Jun 2020 at 18:52, Richard Copley <rcopley@gmail.com> wrote:
> On Thu, 18 Jun 2020 at 18:42, Eli Zaretskii <eliz@gnu.org> wrote:
> Thanks,
> No, that fails on this example [...]

How's this?

diff --git a/lisp/sort.el b/lisp/sort.el
index de0e1b9519..f878db24a3 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -554,9 +554,6 @@ is the one that ends before END."
   (if (> beg end)
       (let (mid) (setq mid end end beg beg mid)))
   (save-excursion
-    (when (or (< (line-beginning-position) beg)
-              (< end (line-end-position)))
-      (user-error "There are no full lines in the region"))
     ;; Put beg at the start of a line and end and the end of one --
     ;; the largest possible region which fits this criteria.
     (goto-char beg)
@@ -568,6 +565,8 @@ is the one that ends before END."
     ;; reversal; it isn't difficult to add it afterward.
     (or (and (eolp) (not (bolp))) (progn (forward-line -1) (end-of-line)))
     (setq end (point-marker))
+    (when (<= end beg)
+      (user-error "There are no full lines in the region"))
     ;; The real work.  This thing cranks through memory on large regions.
     (let (ll (do t))
       (while do





  reply	other threads:[~2020-06-18 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 16:41 bug#41934: reverse-region no longer works Richard Copley
2020-06-18 17:42 ` Eli Zaretskii
2020-06-18 17:52   ` Richard Copley
2020-06-18 17:59     ` Richard Copley [this message]
2020-06-18 18:28       ` Eli Zaretskii
2020-06-18 18:33         ` Richard Copley
2020-06-18 18:44           ` Eli Zaretskii
     [not found]             ` <CAPM58oijG1t__9DtYyBPjA+EPHYA7hDFizz9oXv=hqVAyFEPiw@mail.gmail.com>
2020-06-19 11:31               ` Eli Zaretskii
2020-06-20 10:03                 ` Richard Copley
2020-06-22 15:43                   ` Eli Zaretskii
2020-06-18 18:20     ` Eli Zaretskii

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='CAPM58ojjwcr_cquxyjsejpeHbdtiuf=V8jnq490KXaDFdAQD1w@mail.gmail.com' \
    --to=rcopley@gmail.com \
    --cc=41934@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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.