unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Richard Copley <rcopley@gmail.com>
Cc: 41934@debbugs.gnu.org
Subject: bug#41934: reverse-region no longer works
Date: Thu, 18 Jun 2020 20:42:28 +0300	[thread overview]
Message-ID: <83lfkkz2wr.fsf@gnu.org> (raw)
In-Reply-To: <CAPM58og=ovFjpxUga=33hPb=haXR_5h3KtpN_6d9ONuZxapgNA@mail.gmail.com> (message from Richard Copley on Thu, 18 Jun 2020 17:41:19 +0100)

> From: Richard Copley <rcopley@gmail.com>
> Date: Thu, 18 Jun 2020 17:41:19 +0100
> 
> Insert text in a buffer:
> 
> abc
> def
> ghi
> 
> Position the mark before the 'a' and point before the 'g'.
> Do 'M-x reverse-region'.
> 
> An error is signalled, 'There are no full lines in the region'.

Thanks.  Does the patch below look good?

diff --git a/lisp/sort.el b/lisp/sort.el
index de0e1b9..6640c8f 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -554,8 +554,8 @@ reverse-region
   (if (> beg end)
       (let (mid) (setq mid end end beg beg mid)))
   (save-excursion
-    (when (or (< (line-beginning-position) beg)
-              (< end (line-end-position)))
+    (when (< (- end beg)
+             (- (line-end-position) (line-beginning-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.





  reply	other threads:[~2020-06-18 17:42 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 [this message]
2020-06-18 17:52   ` Richard Copley
2020-06-18 17:59     ` Richard Copley
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83lfkkz2wr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=41934@debbugs.gnu.org \
    --cc=rcopley@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).