GNU bug report logs - #13521
`sort-lines' on the empty region

Previous Next

Package: emacs;

Reported by: Xue Fuqiao <xfq.free <at> gmail.com>

Date: Tue, 22 Jan 2013 00:56:01 UTC

Severity: wishlist

Tags: patch, wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #55 received at 13521 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: xfq.free <at> gmail.com, rgm <at> gnu.org, stefan <at> marxist.se,
 Drew Adams <drew.adams <at> oracle.com>, 13521 <at> debbugs.gnu.org
Subject: Re: bug#13521: `sort-lines' on the empty region
Date: Sat, 05 Sep 2020 11:34:22 -0400
> The important point here is that sort-lines worked on the region, even
> if inactive, before the proposed changes, so restricting it now only
> to active regions would be a backward-incompatible change of behavior.

Indeed, so the patch should check something like

    (if (or (null transient-mark-mode) (use-region-p))
        (list (region-beginning) (region-end))
      (list (point-min) (point-max)))

`use-region-p` checks `transient-mark-mode` the other way, because it's
used mostly for commands which previously did *not* operate on the
region, unlike `sort-lines`.


        Stefan





This bug report was last modified 4 years and 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.