[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41934: reverse-region no longer works
From: |
Eli Zaretskii |
Subject: |
bug#41934: reverse-region no longer works |
Date: |
Thu, 18 Jun 2020 21:20:26 +0300 |
> From: Richard Copley <rcopley@gmail.com>
> Date: Thu, 18 Jun 2020 18:52:48 +0100
> Cc: 41934@debbugs.gnu.org
>
> No, that fails on this example:
>
> [mark]abc
> def
> [point]abcdefghi
How about this:
diff --git a/lisp/sort.el b/lisp/sort.el
index de0e1b9..8a4a56c 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -554,9 +554,18 @@ 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)))
- (user-error "There are no full lines in the region"))
+ (let ((lbeg (save-excursion
+ (goto-char beg)
+ (if (bolp)
+ beg
+ (line-beginning-position 2))))
+ (lend (save-excursion
+ (goto-char end)
+ (if (bolp)
+ end
+ (line-beginning-position)))))
+ (when (>= lbeg lend)
+ (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)
- bug#41934: reverse-region no longer works, Richard Copley, 2020/06/18
- bug#41934: reverse-region no longer works, Eli Zaretskii, 2020/06/18
- bug#41934: reverse-region no longer works, Richard Copley, 2020/06/18
- bug#41934: reverse-region no longer works, Richard Copley, 2020/06/18
- bug#41934: reverse-region no longer works, Eli Zaretskii, 2020/06/18
- bug#41934: reverse-region no longer works, Richard Copley, 2020/06/18
- bug#41934: reverse-region no longer works, Eli Zaretskii, 2020/06/18
- Message not available
- bug#41934: reverse-region no longer works, Eli Zaretskii, 2020/06/19
- bug#41934: reverse-region no longer works, Richard Copley, 2020/06/20
- bug#41934: reverse-region no longer works, Eli Zaretskii, 2020/06/22
- bug#41934: reverse-region no longer works,
Eli Zaretskii <=