From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#23794: 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-ID: References: <87mvmji9jv.fsf@163.com> Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113569d24cc79105610cb54c" X-Trace: blaine.gmane.org 1514082016 16905 195.159.176.226 (24 Dec 2017 02:20:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 24 Dec 2017 02:20:16 +0000 (UTC) Cc: Richard Stallman To: 23794@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 24 03:20:12 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSvtZ-0003x6-QA for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Dec 2017 03:20:10 +0100 Original-Received: from localhost ([::1]:46631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSvvY-0007cF-BD for geb-bug-gnu-emacs@m.gmane.org; Sat, 23 Dec 2017 21:22:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSvvR-0007bJ-IW for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2017 21:22:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSvvO-0006Fw-NO for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2017 21:22:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41083) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eSvvO-0006FT-Iy for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2017 21:22:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eSvvO-0004Ie-Cx for bug-gnu-emacs@gnu.org; Sat, 23 Dec 2017 21:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 24 Dec 2017 02:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23794-submit@debbugs.gnu.org id=B23794.151408210316496 (code B ref 23794); Sun, 24 Dec 2017 02:22:02 +0000 Original-Received: (at 23794) by debbugs.gnu.org; 24 Dec 2017 02:21:43 +0000 Original-Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSvv5-0004I0-CD for submit@debbugs.gnu.org; Sat, 23 Dec 2017 21:21:43 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eSvv3-0004Ho-9z for 23794@debbugs.gnu.org; Sat, 23 Dec 2017 21:21:41 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eSvuv-0005py-Ez for 23794@debbugs.gnu.org; Sat, 23 Dec 2017 21:21:36 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eSvuv-0005pt-Bi for 23794@debbugs.gnu.org; Sat, 23 Dec 2017 21:21:33 -0500 Original-Received: from mail-qt0-f169.google.com ([209.85.216.169]:40113) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1eSvuv-0007rH-4n for 23794@debbugs.gnu.org; Sat, 23 Dec 2017 21:21:33 -0500 Original-Received: by mail-qt0-f169.google.com with SMTP id u42so40280378qte.7 for <23794@debbugs.gnu.org>; Sat, 23 Dec 2017 18:21:33 -0800 (PST) X-Gm-Message-State: AKGB3mKK7noITqAT1HDCPdsggsbfv5ul2Y7CeuY2ivReTiBkKlYLghf9 sRV9t0CLG2z+mVWDTD3+HDip0cueS7zKPQu3thM= X-Google-Smtp-Source: ACJfBotE2MTYoJhkfbFEMHJlFszFSgzUlKowber1BnStMzVIa+kfNlb2rminTc192ZrTDOKQZdtY2cVMTo75HmwSBJA= X-Received: by 10.200.50.39 with SMTP id x36mr28627778qta.255.1514082092761; Sat, 23 Dec 2017 18:21:32 -0800 (PST) Original-Received: by 10.200.55.124 with HTTP; Sat, 23 Dec 2017 18:21:02 -0800 (PST) In-Reply-To: X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141436 Archived-At: --001a113569d24cc79105610cb54c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Aug 28, 2017 at 12:00 AM, Robert Weiner wrote: > ---------- Forwarded message ---------- > From: Richard Stallman > 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@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. > =E2=80=8BI agree. =E2=80=8B > =E2=80=8B=E2=80=8B > However, if there are two substructures at the same level > =E2=80=8B=E2=80=8B > and they are both invisible, it does not seem right for them > =E2=80=8B=E2=80=8B > to stick together in sorting. > =E2=80=8BThis 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. =E2=80=8B=E2=80=8B > I have a feeling that sort-lines doesn't really make > =E2=80=8B=E2=80=8B > sense for an > =E2=80=8B > =E2=80=8B=E2=80=8B > o > =E2=80=8B=E2=80=8B > u > =E2=80=8B=E2=80=8B > t > =E2=80=8B=E2=80=8B > l > =E2=80=8B=E2=80=8B > i > =E2=80=8B=E2=80=8B > n > =E2=80=8B=E2=80=8B > e > =E2=80=8B=E2=80=8B > =E2=80=8B=E2=80=8B =E2=80=8BPersonally, I have often found it useful. =E2=80=8B > =E2=80=8B=E2=80=8B > , and other operations are needed for sortin > =E2=80=8B=E2=80=8B > g in outlines. > =E2=80=8B=E2=80=8B =E2=80=8BYes, we could write other commands or we could apply something lik= e the simple patch I provided and make this do something =E2=80=8Buseful before E= macs 26 is released. We all agree that the current behavior of sort-lines is not useful in outlines as it stands. =E2=80=8B=E2=80=8B > But I am not sure of that. > =E2=80=8B=E2=80=8B > =E2=80=8B=E2=80=8B =E2=80=8BI have contributed what I can on this and I hope someone is willin= g 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 =E2=80=8B --001a113569d24cc79105610cb54c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Aug 28, 2= 017 at 12:00 AM, Robert Weiner <rs= w@gnu.org> wrote= :
---------- Forwarded message ----------
From: Rich= ard Stallman <rms@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@gmail.com

=C2=A0 > > I think the old behavior was only correct for= Outline mode in SOME
=C2=A0 > > cases.=C2=A0 Not in all cases.=C2=A0 Likewise for the new = behavior.

=C2=A0 > Can you list the cases you think exist and how you think each s= hould
=C2=A0 > be handled?

When the first line of some substructure is visible and the rest of<= br> that substructure is hidden, it seems to make sense to sort the
substructure with the first line.
<= div>
=E2=80=8BI agree.
=E2=80=8B
=
=E2=80=8B=E2=80=8B
However, if there are two substructures = at the same level
=E2=80=8B=E2=80=8B
and they are both invisible, it does not= seem right for them
=E2=80=8B=E2=80=8B
to stick together in sorting.
<= /div>

=E2=80=8BThis I'll argue again= st.=C2=A0 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.= =C2=A0 You might want to move it, delete it or sort it but you typically wa= nt to treat it as a single unit.=C2=A0 Its visual representation, often as = a single line, reflects this.

So, I would argue, when you sort an ou= tline with certain elements visible and others hidden, you want to sort jus= t the visible elements and keep the hidden substructures together with thei= r visible ancestors but not sort them.=C2=A0 If you want to sort substructu= re, you expand it and visually reflect its existence.=C2=A0 That would make= for pretty consistent and understandable behavior.

=E2=80=8B=E2=80=8B
I have a feeling that sort-lines doesn&#= 39;t really make
=E2=80=8B=E2=80=8B
sense for an
=E2=80=8B=C2=A0
=E2=80=8B=E2=80=8B
o
=E2=80= =8B=E2=80=8B
u
=E2=80=8B=E2=80=8B
t
=E2=80=8B= =E2=80=8B
l
=E2=80=8B=E2=80=8B
i
=E2=80=8B=E2= =80=8B
n
=E2=80=8B=E2=80=8B
e
=E2=80=8B=E2=80= =8B
=E2=80=8B=E2=80=8B
=E2=80= =8BPersonally, I have often found it useful.
=E2=80=8B
=E2=80=8B=E2=80=8B
, an= d other operations are needed for sortin
=E2=80=8B=E2=80=8Bg in outlines.
=E2=80=8B=E2=80=8B=
=E2=80=8BYes, we could write other commands or we could apply somet= hing like the simple patch I provided and make this do something =E2=80=8Bu= seful before Emacs 26 is released.
We all agree that the current behavior= of sort-lines is not useful in outlines as it stands.

=E2=80=8B=E2=80=8B
But I am not sure of that.
=E2= =80=8B=E2=80=8B
=E2=80=8B=E2= =80=8B
=E2=80=8BI have contributed what I can on this and I hope som= eone is willing to try to get this patched before Emacs 26 goes out or we&#= 39;ll have a whole other long-lived generation of Emacs without a basic way= to sort visible lines in a file.

Bob
=E2=80=8B

--001a113569d24cc79105610cb54c--