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


View this message in rfc822 format

From: Stefan Kangas <stefan <at> marxist.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Xue Fuqiao <xfq.free <at> gmail.com>, Glenn Morris <rgm <at> gnu.org>, 13521 <at> debbugs.gnu.org
Subject: bug#13521: `sort-lines' on the empty region
Date: Thu, 20 Aug 2020 18:18:34 -0700
[Message part 1 (text/plain, inline)]
tags 13521 + patch
thanks

Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:

>>> That seems to be considering a different case: not the case of an empty
>>> region, but the case where there's no active region.
>>> Currently, this case signals an error, but I think I agree it makes
>>> sense to let it apply to the whole buffer if there is no active region.
>> flush-lines, keep-lines instead operate on all lines after point.
>
> Yes, we have an inconsistency in this respect: some commands use "the
> whole buffer" and others use "everything after point".  Whichever choice
> we make for sort-lines, it will be inconsistent with some of the
> existing commands ;-)
>
> I personally prefer the "whole buffer", but whoever makes the change
> gets to make the choice.

The attached patch makes 'sort-lines' sort the entire buffer when there
is no region.

Any comments?

Best regards,
Stefan Kangas
[0001-Make-sort-lines-sort-entire-buffer-without-active-re.patch (text/x-diff, attachment)]

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.