GNU bug report logs - #23794
Make sort-lines respect visible lines

Previous Next

Package: emacs;

Reported by: rswgnu <at> gmail.com

Date: Sat, 18 Jun 2016 15:48:02 UTC

Severity: normal

Full log


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

From: Robert Weiner <rsw <at> gnu.org>
To: 23794 <at> debbugs.gnu.org
Cc: Richard Stallman <rms <at> gnu.org>
Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
Date: Sat, 23 Dec 2017 21:21:02 -0500
[Message part 1 (text/plain, inline)]
On Mon, Aug 28, 2017 at 12:00 AM, Robert Weiner <rsw <at> gnu.org> wrote:

> ---------- Forwarded message ----------
> From: Richard Stallman <rms <at> gnu.org>
> Date: Wed, Jun 22, 2016 at 2:34 AM
> Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines
> respect visible lines (fairly urgent)
> To: rswgnu <at> gmail.com
>
>   > > I think the old behavior was only correct for Outline mode in SOME
>   > > cases.  Not in all cases.  Likewise for the new behavior.
>
>   > Can you list the cases you think exist and how you think each should
>   > be handled?
>
> When the first line of some substructure is visible and the rest of
> that substructure is hidden, it seems to make sense to sort the
> substructure with the first line.
>

​I agree.
​

> ​​
> However, if there are two substructures at the same level
> ​​
> and they are both invisible, it does not seem right for them
> ​​
> to stick together in sorting.
>

​This I'll argue against.  The point of hiding the substructure in an
outline is not just a visual one but also so you can operate on a hierarchy
as a single entity.  You might want to move it, delete it or sort it but
you typically want to treat it as a single unit.  Its visual
representation, often as a single line, reflects this.

So, I would argue, when you sort an outline with certain elements visible
and others hidden, you want to sort just the visible elements and keep the
hidden substructures together with their visible ancestors but not sort
them.  If you want to sort substructure, you expand it and visually reflect
its existence.  That would make for pretty consistent and understandable
behavior.

​​
> I have a feeling that sort-lines doesn't really make
> ​​
> sense for an
> ​
> ​​
> o
> ​​
> u
> ​​
> t
> ​​
> l
> ​​
> i
> ​​
> n
> ​​
> e
> ​​
>
​​
​Personally, I have often found it useful.
​

> ​​
> , and other operations are needed for sortin
> ​​
> g in outlines.
>
​​
​Yes, we could write other commands or we could apply something like the
simple patch I provided and make this do something ​useful before Emacs 26
is released.
We all agree that the current behavior of sort-lines is not useful in
outlines as it stands.

​​
> But I am not sure of that.
> ​​
>
​​
​I have contributed what I can on this and I hope someone is willing to try
to get this patched before Emacs 26 goes out or we'll have a whole other
long-lived generation of Emacs without a basic way to sort visible lines in
a file.

Bob
​
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 202 days ago.

Previous Next


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