[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13521: `sort-lines' on the empty region
From: |
Stefan Monnier |
Subject: |
bug#13521: `sort-lines' on the empty region |
Date: |
Sat, 05 Sep 2020 11:34:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> 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