GNU bug report logs - #23794
Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly urgent)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: rswgnu@HIDDEN; dated Sat, 18 Jun 2016 15:48:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 25 Jun 2019 13:08:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 25 09:08:36 2019
Received: from localhost ([127.0.0.1]:58913 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hflBb-00020q-6v
	for submit <at> debbugs.gnu.org; Tue, 25 Jun 2019 09:08:36 -0400
Received: from quimby.gnus.org ([80.91.231.51]:48844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1hflBZ-00020h-3g
 for 23794 <at> debbugs.gnu.org; Tue, 25 Jun 2019 09:08:33 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories)
 by quimby.gnus.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89)
 (envelope-from <larsi@HIDDEN>)
 id 1hflBU-0008Tf-OO; Tue, 25 Jun 2019 15:08:31 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Robert Weiner <rsw@HIDDEN>
Subject: Re: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
References: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
Date: Tue, 25 Jun 2019 15:08:28 +0200
In-Reply-To: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 (Robert Weiner's message of "Sat, 18 Jun 2016 11:47:08 -0400")
Message-ID: <m3ef3hbynn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Robert Weiner <rsw@HIDDEN> writes: > sort-lines calls
 forward-line
 rather than forward-visible line, so if > you have emacs outline entries
 that are collapsed/hidden to single lines > each and you try to sort them,
 their bodies and sub [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org, rswgnu@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Robert Weiner <rsw@HIDDEN> writes:

> sort-lines calls forward-line rather than forward-visible line, so if
> you have emacs outline entries that are collapsed/hidden to single lines
> each and you try to sort them, their bodies and subtrees are sorted
> separately because forward-visible-line is not used.
>
> This patch fixes this problem and also unifies the calling convention of
> forward-visible-line with that of forward-line (allowing it to take an
> optional argument) leading to a cleaner calling convention.

This was three years ago, and from what I can tell, nobody has changed
sort-lines to be aware of invisible lines...  I can see the case for
allowing the caller to control this, but none of the patches proposed
look acceptable to me (for instance, one made sort.el check for outline
mode explicitly, which seems backwards).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 24 Dec 2017 02:21:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 23 21:21:43 2017
Received: from localhost ([127.0.0.1]:49764 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eSvv5-0004I0-CD
	for submit <at> debbugs.gnu.org; Sat, 23 Dec 2017 21:21:43 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33974)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1eSvv3-0004Ho-9z
 for 23794 <at> debbugs.gnu.org; Sat, 23 Dec 2017 21:21:41 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1eSvuv-0005py-Ez
 for 23794 <at> debbugs.gnu.org; Sat, 23 Dec 2017 21:21:36 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49863)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1eSvuv-0005pt-Bi
 for 23794 <at> debbugs.gnu.org; Sat, 23 Dec 2017 21:21:33 -0500
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 <rsw@HIDDEN>) id 1eSvuv-0007rH-4n
 for 23794 <at> debbugs.gnu.org; Sat, 23 Dec 2017 21:21:33 -0500
Received: by mail-qt0-f169.google.com with SMTP id u42so40280378qte.7
 for <23794 <at> 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)
MIME-Version: 1.0
Received: by 10.200.55.124 with HTTP; Sat, 23 Dec 2017 18:21:02 -0800 (PST)
In-Reply-To: <CA+OMD9i306uPuixf5G3tQP7zDoaRtacedYg53FJfo8aquFqtUg@HIDDEN>
References: <87mvmji9jv.fsf@HIDDEN>
 <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 <CA+OMD9i=3i5Z3xsnmjUvi8Jfs68x++kkZentoRM8yu9o2srE=Q@HIDDEN>
 <E1bEgMo-0005Ld-M3@HIDDEN>
 <CA+OMD9i8eQFeKV840uP+ecbrtKYjHcKz4e5HsnQaXbSivRdnAQ@HIDDEN>
 <E1bF8FJ-00035J-Vn@HIDDEN>
 <CA+OMD9gMn6cOOa4=Mj+oWs9zg41+PEFtRN6ryeDoZUTq3iY1QA@HIDDEN>
 <E1bFbjx-0002sy-LM@HIDDEN>
 <CA+OMD9i306uPuixf5G3tQP7zDoaRtacedYg53FJfo8aquFqtUg@HIDDEN>
From: Robert Weiner <rsw@HIDDEN>
Date: Sat, 23 Dec 2017 21:21:02 -0500
X-Gmail-Original-Message-ID: <CA+OMD9gn8ZGghYwhCrMSELm1xdiiiCHA2v7HgTFWvvs5CrBNhQ@HIDDEN>
Message-ID: <CA+OMD9gn8ZGghYwhCrMSELm1xdiiiCHA2v7HgTFWvvs5CrBNhQ@HIDDEN>
Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
To: 23794 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary="001a113569d24cc79105610cb54c"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 23794
Cc: Richard Stallman <rms@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

--001a113569d24cc79105610cb54c
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 28, 2017 at 12:00 AM, Robert Weiner <rsw@HIDDEN> wrote:

> ---------- Forwarded message ----------
> From: Richard Stallman <rms@HIDDEN>
> 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@HIDDEN
>
>   > > 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

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace"><span style=3D"font-family:arial,sans-serif">On Mon, Aug 28, 2=
017 at 12:00 AM, Robert Weiner </span><span dir=3D"ltr" style=3D"font-famil=
y:arial,sans-serif">&lt;<a href=3D"mailto:rsw@HIDDEN" target=3D"_blank">rs=
w@HIDDEN</a>&gt;</span><span style=3D"font-family:arial,sans-serif"> wrote=
:</span><br></div><div class=3D"gmail_extra"><div class=3D"gmail_quote"><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"><div di=
r=3D"ltr"><div style=3D"font-family:monospace,monospace"><span style=3D"fon=
t-family:arial,sans-serif">---------- Forwarded message ----------</span><b=
r></div><div class=3D"gmail_quote">From: <b class=3D"gmail_sendername">Rich=
ard Stallman</b> <span dir=3D"ltr">&lt;<a href=3D"mailto:rms@HIDDEN" targe=
t=3D"_blank">rms@HIDDEN</a>&gt;</span><br>Date: Wed, Jun 22, 2016 at 2:34 =
AM<br>Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines =
respect visible lines (fairly urgent)<br>To: <a href=3D"mailto:rswgnu@gmail=
.com" target=3D"_blank">rswgnu@HIDDEN</a><br><span><br>
</span><span>=C2=A0 &gt; &gt; I think the old behavior was only correct for=
 Outline mode in SOME<br>
=C2=A0 &gt; &gt; cases.=C2=A0 Not in all cases.=C2=A0 Likewise for the new =
behavior.<br>
<br>
=C2=A0 &gt; Can you list the cases you think exist and how you think each s=
hould<br>
=C2=A0 &gt; be handled?<br>
<br>
</span>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<br>
substructure with the first line.<br></div></div></div></div></blockquote><=
div><br></div><div class=3D"gmail_default" style=3D"font-family:monospace,m=
onospace">=E2=80=8BI agree.</div><div class=3D"gmail_default" style=3D"font=
-family:monospace,monospace">=E2=80=8B</div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
<div class=3D"HOEnZb"><div class=3D"h5"><div dir=3D"ltr"><div class=3D"gmai=
l_quote">
<div class=3D"gmail_default" style=3D"font-family:monospace,monospace;displ=
ay:inline">=E2=80=8B=E2=80=8B</div>However, if there are two substructures =
at the same level<br>
<div class=3D"gmail_default" style=3D"font-family:monospace,monospace;displ=
ay:inline">=E2=80=8B=E2=80=8B</div>and they are both invisible, it does not=
 seem right for them<br>
<div class=3D"gmail_default" style=3D"font-family:monospace,monospace;displ=
ay:inline">=E2=80=8B=E2=80=8B</div>to stick together in sorting.<br></div><=
/div></div></div></blockquote><div><br></div><div class=3D"gmail_default" s=
tyle=3D"font-family:monospace,monospace">=E2=80=8BThis I&#39;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.</div><div class=3D"gmail_default" style=3D"fo=
nt-family:monospace,monospace"><br></div><div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace">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.</div><div class=3D"gmai=
l_default" style=3D"font-family:monospace,monospace"><br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"><div dir=3D"ltr"=
><div class=3D"gmail_quote">
<div class=3D"gmail_default" style=3D"font-family:monospace,monospace;displ=
ay:inline">=E2=80=8B=E2=80=8B</div>I have a feeling that sort-lines doesn&#=
39;t really make<div class=3D"gmail_default" style=3D"font-family:monospace=
,monospace;display:inline">=E2=80=8B=E2=80=8B</div> sense for an<div class=
=3D"gmail_default" style=3D"font-family:monospace,monospace;display:inline"=
>=E2=80=8B=C2=A0</div><div class=3D"gmail_default" style=3D"font-family:mon=
ospace,monospace;display:inline">=E2=80=8B=E2=80=8B</div>o<div class=3D"gma=
il_default" style=3D"font-family:monospace,monospace;display:inline">=E2=80=
=8B=E2=80=8B</div>u<div class=3D"gmail_default" style=3D"font-family:monosp=
ace,monospace;display:inline">=E2=80=8B=E2=80=8B</div>t<div class=3D"gmail_=
default" style=3D"font-family:monospace,monospace;display:inline">=E2=80=8B=
=E2=80=8B</div>l<div class=3D"gmail_default" style=3D"font-family:monospace=
,monospace;display:inline">=E2=80=8B=E2=80=8B</div>i<div class=3D"gmail_def=
ault" style=3D"font-family:monospace,monospace;display:inline">=E2=80=8B=E2=
=80=8B</div>n<div class=3D"gmail_default" style=3D"font-family:monospace,mo=
nospace;display:inline">=E2=80=8B=E2=80=8B</div>e<div class=3D"gmail_defaul=
t" style=3D"font-family:monospace,monospace;display:inline">=E2=80=8B=E2=80=
=8B</div></div></div></div></div></blockquote><div><div class=3D"gmail_defa=
ult" style=3D"font-family:monospace,monospace">=E2=80=8B=E2=80=8B</div><div=
 class=3D"gmail_default" style=3D"font-family:monospace,monospace">=E2=80=
=8BPersonally, I have often found it useful.<br></div></div><div class=3D"g=
mail_default" style=3D"font-family:monospace,monospace">=E2=80=8B</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"><div dir=
=3D"ltr"><div class=3D"gmail_quote"><div class=3D"gmail_default" style=3D"f=
ont-family:monospace,monospace;display:inline">=E2=80=8B=E2=80=8B</div>, an=
d other operations are needed for sortin<div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace;display:inline">=E2=80=8B=E2=80=8B</div=
>g in outlines.<br></div></div></div></div></blockquote><div><div class=3D"=
gmail_default" style=3D"font-family:monospace,monospace">=E2=80=8B=E2=80=8B=
</div></div><div class=3D"gmail_default" style=3D"font-family:monospace,mon=
ospace">=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.</div><div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace">We all agree that the current behavior=
 of sort-lines is not useful in outlines as it stands.</div><div class=3D"g=
mail_default" style=3D"font-family:monospace,monospace"><br></div><blockquo=
te class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc so=
lid;padding-left:1ex"><div class=3D"HOEnZb"><div class=3D"h5"><div dir=3D"l=
tr"><div class=3D"gmail_quote">
<div class=3D"gmail_default" style=3D"font-family:monospace,monospace;displ=
ay:inline">=E2=80=8B=E2=80=8B</div>But I am not sure of that.<div class=3D"=
gmail_default" style=3D"font-family:monospace,monospace;display:inline">=E2=
=80=8B=E2=80=8B</div></div></div></div></div></blockquote><div><div class=
=3D"gmail_default" style=3D"font-family:monospace,monospace">=E2=80=8B=E2=
=80=8B</div></div><div class=3D"gmail_default" style=3D"font-family:monospa=
ce,monospace">=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.</div><div class=3D"gmail_default" style=
=3D"font-family:monospace,monospace"><br></div><div class=3D"gmail_default"=
 style=3D"font-family:monospace,monospace">Bob</div><div class=3D"gmail_def=
ault" style=3D"font-family:monospace,monospace">=E2=80=8B</div></div><br></=
div></div>

--001a113569d24cc79105610cb54c--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 28 Aug 2017 04:00:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Aug 28 00:00:54 2017
Received: from localhost ([127.0.0.1]:58544 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1dmBEM-0004Pe-A2
	for submit <at> debbugs.gnu.org; Mon, 28 Aug 2017 00:00:54 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37473)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1dmBEK-0004PS-LP
 for 23794 <at> debbugs.gnu.org; Mon, 28 Aug 2017 00:00:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1dmBEB-0007iu-53
 for 23794 <at> debbugs.gnu.org; Mon, 28 Aug 2017 00:00:47 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_20,HTML_MESSAGE,
 RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36688)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1dmBEA-0007ic-Ry
 for 23794 <at> debbugs.gnu.org; Mon, 28 Aug 2017 00:00:42 -0400
Received: from mail-qk0-f171.google.com ([209.85.220.171]:33304)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <rsw@HIDDEN>) id 1dmBEA-00029F-12
 for 23794 <at> debbugs.gnu.org; Mon, 28 Aug 2017 00:00:42 -0400
Received: by mail-qk0-f171.google.com with SMTP id l65so13857137qkc.0
 for <23794 <at> debbugs.gnu.org>; Sun, 27 Aug 2017 21:00:41 -0700 (PDT)
X-Gm-Message-State: AHYfb5gnvAp8Nm/iRR5r0Ix+ZStRqoHQFaBUb2U39Xu8vEj/BAH7EAMY
 Atg1r8/lgBUnMaOfnNlslKpPseP8zw==
X-Received: by 10.233.222.69 with SMTP id s66mr8053269qkf.30.1503892841484;
 Sun, 27 Aug 2017 21:00:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.200.25.35 with HTTP; Sun, 27 Aug 2017 21:00:11 -0700 (PDT)
In-Reply-To: <E1bFbjx-0002sy-LM@HIDDEN>
References: <87mvmji9jv.fsf@HIDDEN>
 <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 <CA+OMD9i=3i5Z3xsnmjUvi8Jfs68x++kkZentoRM8yu9o2srE=Q@HIDDEN>
 <E1bEgMo-0005Ld-M3@HIDDEN>
 <CA+OMD9i8eQFeKV840uP+ecbrtKYjHcKz4e5HsnQaXbSivRdnAQ@HIDDEN>
 <E1bF8FJ-00035J-Vn@HIDDEN>
 <CA+OMD9gMn6cOOa4=Mj+oWs9zg41+PEFtRN6ryeDoZUTq3iY1QA@HIDDEN>
 <E1bFbjx-0002sy-LM@HIDDEN>
From: Robert Weiner <rsw@HIDDEN>
Date: Mon, 28 Aug 2017 00:00:11 -0400
X-Gmail-Original-Message-ID: <CA+OMD9i306uPuixf5G3tQP7zDoaRtacedYg53FJfo8aquFqtUg@HIDDEN>
Message-ID: <CA+OMD9i306uPuixf5G3tQP7zDoaRtacedYg53FJfo8aquFqtUg@HIDDEN>
Subject: Fwd: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
To: 23794 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary="94eb2c0438e898d6cb0557c85653"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -4.5 (----)
X-Debbugs-Envelope-To: 23794
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.5 (----)

--94eb2c0438e898d6cb0557c85653
Content-Type: text/plain; charset="UTF-8"

---------- Forwarded message ----------
From: Richard Stallman <rms@HIDDEN>
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@HIDDEN

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

  > > 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.

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.

I have a feeling that sort-lines doesn't really make sense for an
outline, and other operations are needed for sorting in outlines.
But I am not sure of that.

--
Dr Richard Stallman
President, Free Software Foundation (gnu.org, fsf.org)
Internet Hall-of-Famer (internethalloffame.org)
Skype: No way! See stallman.org/skype.html.

--94eb2c0438e898d6cb0557c85653
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace"><span style=3D"font-family:arial,sans-serif">---------- Forwar=
ded message ----------</span><br></div><div class=3D"gmail_quote">From: <b =
class=3D"gmail_sendername">Richard Stallman</b> <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:rms@HIDDEN">rms@HIDDEN</a>&gt;</span><br>Date: Wed, Jun 22, =
2016 at 2:34 AM<br>Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to mak=
e sort-lines respect visible lines (fairly urgent)<br>To: <a href=3D"mailto=
:rswgnu@HIDDEN">rswgnu@HIDDEN</a><br><br><span class=3D"">[[[ To any =
NSA and FBI agents reading my email: please consider=C2=A0 =C2=A0 ]]]<br>
[[[ whether defending the US Constitution against all enemies,=C2=A0 =C2=A0=
 =C2=A0]]]<br>
[[[ foreign or domestic, requires you to follow Snowden&#39;s example. ]]]<=
br>
<br>
</span><span class=3D"">=C2=A0 &gt; &gt; I think the old behavior was only =
correct for Outline mode in SOME<br>
=C2=A0 &gt; &gt; cases.=C2=A0 Not in all cases.=C2=A0 Likewise for the new =
behavior.<br>
<br>
=C2=A0 &gt; Can you list the cases you think exist and how you think each s=
hould<br>
=C2=A0 &gt; be handled?<br>
<br>
</span>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<br>
substructure with the first line.<br>
<br>
However, if there are two substructures at the same level<br>
and they are both invisible, it does not seem right for them<br>
to stick together in sorting.<br>
<br>
I have a feeling that sort-lines doesn&#39;t really make sense for an<br>
outline, and other operations are needed for sorting in outlines.<br>
But I am not sure of that.<br>
<div class=3D"HOEnZb"><div class=3D"h5"><br>
--<br>
Dr Richard Stallman<br>
President, Free Software Foundation (<a href=3D"http://gnu.org" rel=3D"nore=
ferrer" target=3D"_blank">gnu.org</a>, <a href=3D"http://fsf.org" rel=3D"no=
referrer" target=3D"_blank">fsf.org</a>)<br>
Internet Hall-of-Famer (<a href=3D"http://internethalloffame.org" rel=3D"no=
referrer" target=3D"_blank">internethalloffame.org</a>)<br>
Skype: No way! See <a href=3D"http://stallman.org/skype.html" rel=3D"norefe=
rrer" target=3D"_blank">stallman.org/skype.html</a>.<br>
<br>
</div></div></div><br></div>

--94eb2c0438e898d6cb0557c85653--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 19 Jun 2016 21:00:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 17:00:07 2016
Received: from localhost ([127.0.0.1]:46708 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEjp9-0005Jx-Mj
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 17:00:07 -0400
Received: from aserp1040.oracle.com ([141.146.126.69]:38692)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <drew.adams@HIDDEN>) id 1bEjp8-0005IA-MC
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 17:00:07 -0400
Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])
 by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id
 u5JKxxYl005648
 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Sun, 19 Jun 2016 21:00:00 GMT
Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])
 by userv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u5JKxxeq001601
 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
 Sun, 19 Jun 2016 20:59:59 GMT
Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16])
 by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id u5JKxwDm014007;
 Sun, 19 Jun 2016 20:59:59 GMT
MIME-Version: 1.0
Message-ID: <651e246a-1733-4cba-a29f-4ecbde13fb2c@default>
Date: Sun, 19 Jun 2016 13:59:57 -0700 (PDT)
From: Drew Adams <drew.adams@HIDDEN>
To: rswgnu@HIDDEN, Eli Zaretskii <eliz@HIDDEN>
Subject: RE: Emacs bug #23794; sort-line behavior regressed from prior Emacs
 versions
References: <CA+OMD9g7rO1E=1k7BN6T3B6PUqEOF_PxzG4AAiiB_zMcN98oQQ@HIDDEN>
 <83shwa9zmr.fsf@HIDDEN> <83lh229ywc.fsf@HIDDEN>
 <CA+OMD9h3oQLj6-p2vWEsvg0QA3_QFWMMQAVXPNrHmqxmLtZUkQ@HIDDEN>
 <83inx69xcx.fsf@HIDDEN>
 <CA+OMD9jEwHrM6gsyjzHi5hf2nUGWDPgvFm8Fewh8wmxwTL-RKA@HIDDEN>
 <0984ce22-cbcf-42a6-906e-a03b65f3c71c@default> <8360t5aolu.fsf@HIDDEN>
 <CA+OMD9gYwmYFpa3s_20N4-uLTvKMCkqBdQBOBDUQVbhpngbiaA@HIDDEN>
 <83vb158awq.fsf@HIDDEN>
 <CA+OMD9gB=y6Uo3Sh3HCJNEhJ2jx-8Y8pE35KCPR=7FbEX-SGCA@HIDDEN>
 <83oa6x87ky.fsf@HIDDEN>
 <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
In-Reply-To: <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
X-Priority: 3
X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9  (901082) [OL
 12.0.6744.5000 (x86)]
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Source-IP: userv0021.oracle.com [156.151.31.71]
X-Spam-Score: -3.7 (---)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN>,
 emacs-devel <emacs-devel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.7 (---)

Please don't send to both the bug list and emacs-devel, in general.

(And please consider using plain text, not HTML, mail.)




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 19 Jun 2016 17:04:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 13:04:40 2016
Received: from localhost ([127.0.0.1]:46616 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEg9I-0006WS-KM
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 13:04:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38950)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1bEg9H-0006WE-5x
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 13:04:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1bEg93-0000XQ-66
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 13:04:33 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55545)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEg93-0000XI-2C
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 13:04:25 -0400
Received: from mail-oi0-f42.google.com ([209.85.218.42]:33461)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <rsw@HIDDEN>) id 1bEg91-0002sI-Fo
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 13:04:23 -0400
Received: by mail-oi0-f42.google.com with SMTP id u201so181084747oie.0
 for <23794 <at> debbugs.gnu.org>; Sun, 19 Jun 2016 10:04:23 -0700 (PDT)
X-Gm-Message-State: ALyK8tLq4wYWDEJawHUcu1FyiTqHemQ9177Fb4+QKfPgaIXShZtbrbPbHF30FRT/SLxryhjzZeR/TILw9ddgkw==
X-Received: by 10.157.10.70 with SMTP id 64mr7190958otg.131.1466355862760;
 Sun, 19 Jun 2016 10:04:22 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.236.73 with HTTP; Sun, 19 Jun 2016 10:03:53 -0700 (PDT)
In-Reply-To: <83lh2186fh.fsf@HIDDEN>
References: <CA+OMD9g7rO1E=1k7BN6T3B6PUqEOF_PxzG4AAiiB_zMcN98oQQ@HIDDEN>
 <83shwa9zmr.fsf@HIDDEN> <83lh229ywc.fsf@HIDDEN>
 <CA+OMD9h3oQLj6-p2vWEsvg0QA3_QFWMMQAVXPNrHmqxmLtZUkQ@HIDDEN>
 <83inx69xcx.fsf@HIDDEN>
 <CA+OMD9jEwHrM6gsyjzHi5hf2nUGWDPgvFm8Fewh8wmxwTL-RKA@HIDDEN>
 <0984ce22-cbcf-42a6-906e-a03b65f3c71c@default> <8360t5aolu.fsf@HIDDEN>
 <CA+OMD9gYwmYFpa3s_20N4-uLTvKMCkqBdQBOBDUQVbhpngbiaA@HIDDEN>
 <83vb158awq.fsf@HIDDEN>
 <CA+OMD9gB=y6Uo3Sh3HCJNEhJ2jx-8Y8pE35KCPR=7FbEX-SGCA@HIDDEN>
 <83oa6x87ky.fsf@HIDDEN>
 <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
 <83lh2186fh.fsf@HIDDEN>
From: Robert Weiner <rsw@HIDDEN>
Date: Sun, 19 Jun 2016 13:03:53 -0400
X-Gmail-Original-Message-ID: <CA+OMD9j3uJ1wC6n-ouDb7GgGyXfKfuV4JmLezUp=zi-JnugUoQ@HIDDEN>
Message-ID: <CA+OMD9j3uJ1wC6n-ouDb7GgGyXfKfuV4JmLezUp=zi-JnugUoQ@HIDDEN>
Subject: Re: Emacs bug #23794;
 sort-line behavior regressed from prior Emacs versions
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a1136e7da50777c0535a494d9
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN>,
 Drew Adams <drew.adams@HIDDEN>, emacs-devel <emacs-devel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

--001a1136e7da50777c0535a494d9
Content-Type: text/plain; charset=UTF-8

On Sun, Jun 19, 2016 at 12:55 PM, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Robert Weiner <rsw@HIDDEN>
> >
> > The problem with that approach is that each mode has to be aware of this
> and add a setting, really not much
> > different than each mode having its own sort function or way of calling
> a sort function. It is much more useful
> > to centralize the behavior within the sorting library, even if it adds
> some conditional complexity to the code.
>
> Not necessarily: if you set that up in outline-mode, all of its
> descendants will inherit the setting for free.
>

Ok.


>
> > Here is the suggested patch to do it this way. -- Bob
>

One other possibility that is fairly clean is to add sort-visible-*
functions to the sort library; then callers would just have to remember to
call the visible or the regular version of the function and there would be
no need for any new defcustoms.


> Thanks, I hope others will comment on this.
>

Yes.

--001a1136e7da50777c0535a494d9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
un, Jun 19, 2016 at 12:55 PM, Eli Zaretskii <span dir=3D"ltr">&lt;<a href=
=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex">&gt; From: Robert Weiner &lt;<a href=
=3D"mailto:rsw@HIDDEN">rsw@HIDDEN</a>&gt;<br><span class=3D"">&gt;<br>
&gt; The problem with that approach is that each mode has to be aware of th=
is and add a setting, really not much<br>
&gt; different than each mode having its own sort function or way of callin=
g a sort function. It is much more useful<br>
&gt; to centralize the behavior within the sorting library, even if it adds=
 some conditional complexity to the code.<br>
<br>
</span>Not necessarily: if you set that up in outline-mode, all of its<br>
descendants will inherit the setting for free.<br></blockquote><div><br></d=
iv><div>Ok.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class=3D""><br>
&gt; Here is the suggested patch to do it this way. -- Bob<br></span></bloc=
kquote><div><br></div><div>One other possibility that is fairly clean is to=
 add sort-visible-* functions to the sort library; then callers would just =
have to remember to call the visible or the regular version of the function=
 and there would be no need for any new defcustoms.</div><div>=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex">Thanks, I hope others will comment on this.<b=
r></blockquote><div><br></div><div>Yes.</div><div>=C2=A0</div></div><br></d=
iv></div>

--001a1136e7da50777c0535a494d9--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 19 Jun 2016 16:55:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 12:55:44 2016
Received: from localhost ([127.0.0.1]:46607 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEg0e-0004f2-JP
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:55:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37509)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bEg0d-0004em-5s
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:55:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bEg0U-0007Vr-QM
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:55:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55436)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bEg0U-0007Vk-Js; Sun, 19 Jun 2016 12:55:34 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2744
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bEg0K-0001zO-E5; Sun, 19 Jun 2016 12:55:25 -0400
Date: Sun, 19 Jun 2016 19:55:14 +0300
Message-Id: <83lh2186fh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: rswgnu@HIDDEN
In-reply-to: <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
 (message from Robert Weiner on Sun, 19 Jun 2016 12:51:08 -0400)
Subject: Re: Emacs bug #23794;
 sort-line behavior regressed from prior Emacs versions
References: <CA+OMD9g7rO1E=1k7BN6T3B6PUqEOF_PxzG4AAiiB_zMcN98oQQ@HIDDEN>
 <83shwa9zmr.fsf@HIDDEN> <83lh229ywc.fsf@HIDDEN>
 <CA+OMD9h3oQLj6-p2vWEsvg0QA3_QFWMMQAVXPNrHmqxmLtZUkQ@HIDDEN>
 <83inx69xcx.fsf@HIDDEN>
 <CA+OMD9jEwHrM6gsyjzHi5hf2nUGWDPgvFm8Fewh8wmxwTL-RKA@HIDDEN>
 <0984ce22-cbcf-42a6-906e-a03b65f3c71c@default> <8360t5aolu.fsf@HIDDEN>
 <CA+OMD9gYwmYFpa3s_20N4-uLTvKMCkqBdQBOBDUQVbhpngbiaA@HIDDEN>
 <83vb158awq.fsf@HIDDEN>
 <CA+OMD9gB=y6Uo3Sh3HCJNEhJ2jx-8Y8pE35KCPR=7FbEX-SGCA@HIDDEN>
 <83oa6x87ky.fsf@HIDDEN>
 <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org, rms@HIDDEN, drew.adams@HIDDEN,
 emacs-devel@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: Robert Weiner <rsw@HIDDEN>
> Date: Sun, 19 Jun 2016 12:51:08 -0400
> Cc: Drew Adams <drew.adams@HIDDEN>, Richard Stallman <rms@HIDDEN>, 
> 	emacs-devel <emacs-devel@HIDDEN>, 23794 <at> debbugs.gnu.org
> 
> On Sun, Jun 19, 2016 at 12:30 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
> 
>  Didn't think that far, but is it really clean for sort-lines to have
>  special code for some major mode? I thought a better way is to
>  override the default behavior by having sort-lines call functions
>  through funcall or somesuch, and then outline modes could set the
>  appropriate variable to the function of their liking?
> 
> The problem with that approach is that each mode has to be aware of this and add a setting, really not much
> different than each mode having its own sort function or way of calling a sort function. It is much more useful
> to centralize the behavior within the sorting library, even if it adds some conditional complexity to the code.

Not necessarily: if you set that up in outline-mode, all of its
descendants will inherit the setting for free.

> Here is the suggested patch to do it this way. -- Bob

Thanks, I hope others will comment on this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 19 Jun 2016 16:51:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 19 12:51:51 2016
Received: from localhost ([127.0.0.1]:46603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEfws-0004Ym-T0
	for submit <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:51:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:36790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1bEfwr-0004YY-V0
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:51:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1bEfwi-0006gf-T3
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:51:44 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55402)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEfwi-0006gR-Ow
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:51:40 -0400
Received: from mail-oi0-f54.google.com ([209.85.218.54]:32777)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <rsw@HIDDEN>) id 1bEfwh-0001Y6-1l
 for 23794 <at> debbugs.gnu.org; Sun, 19 Jun 2016 12:51:39 -0400
Received: by mail-oi0-f54.google.com with SMTP id u201so180854169oie.0
 for <23794 <at> debbugs.gnu.org>; Sun, 19 Jun 2016 09:51:38 -0700 (PDT)
X-Gm-Message-State: ALyK8tLQT8jAcJrRYRujv6zpeG+kAZaF63stNP2wIL1og5kMLtdrCkukhPTHgUGlZ2KW7XOLABVob68qp5ia3w==
X-Received: by 10.202.178.84 with SMTP id b81mr5562803oif.155.1466355098169;
 Sun, 19 Jun 2016 09:51:38 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.236.73 with HTTP; Sun, 19 Jun 2016 09:51:08 -0700 (PDT)
In-Reply-To: <83oa6x87ky.fsf@HIDDEN>
References: <CA+OMD9g7rO1E=1k7BN6T3B6PUqEOF_PxzG4AAiiB_zMcN98oQQ@HIDDEN>
 <83shwa9zmr.fsf@HIDDEN> <83lh229ywc.fsf@HIDDEN>
 <CA+OMD9h3oQLj6-p2vWEsvg0QA3_QFWMMQAVXPNrHmqxmLtZUkQ@HIDDEN>
 <83inx69xcx.fsf@HIDDEN>
 <CA+OMD9jEwHrM6gsyjzHi5hf2nUGWDPgvFm8Fewh8wmxwTL-RKA@HIDDEN>
 <0984ce22-cbcf-42a6-906e-a03b65f3c71c@default> <8360t5aolu.fsf@HIDDEN>
 <CA+OMD9gYwmYFpa3s_20N4-uLTvKMCkqBdQBOBDUQVbhpngbiaA@HIDDEN>
 <83vb158awq.fsf@HIDDEN>
 <CA+OMD9gB=y6Uo3Sh3HCJNEhJ2jx-8Y8pE35KCPR=7FbEX-SGCA@HIDDEN>
 <83oa6x87ky.fsf@HIDDEN>
From: Robert Weiner <rsw@HIDDEN>
Date: Sun, 19 Jun 2016 12:51:08 -0400
X-Gmail-Original-Message-ID: <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
Message-ID: <CA+OMD9jOBhas2Bt-7rc92UdLuPxWhJj2mEAc2KLgWAVdGFaOvw@HIDDEN>
Subject: Re: Emacs bug #23794;
 sort-line behavior regressed from prior Emacs versions
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113ce25abdb8590535a46662
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org, Richard Stallman <rms@HIDDEN>,
 Drew Adams <drew.adams@HIDDEN>, emacs-devel <emacs-devel@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

--001a113ce25abdb8590535a46662
Content-Type: text/plain; charset=UTF-8

On Sun, Jun 19, 2016 at 12:30 PM, Eli Zaretskii <eliz@HIDDEN> wrote:

> Didn't think that far, but is it really clean for sort-lines to have
> special code for some major mode?  I thought a better way is to
> override the default behavior by having sort-lines call functions
> through funcall or somesuch, and then outline modes could set the
> appropriate variable to the function of their liking?
>

The problem with that approach is that each mode has to be aware of this
and add a setting, really not much different than each mode having its own
sort function or way of calling a sort function.  It is much more useful to
centralize the behavior within the sorting library, even if it adds some
conditional complexity to the code.  Here is the suggested patch to do it
this way.  -- Bob

*** sort-orig.el.gz 2016-06-19 12:42:12.000000000 -0400
--- sort.el.gz 2016-06-19 12:42:12.000000000 -0400
***************
*** 39,44 ****
--- 39,50 ----
    :type 'boolean)
  ;;;###autoload(put 'sort-fold-case 'safe-local-variable 'booleanp)

+ (defcustom sort-invisible-lines nil
+   "Non-nil if the buffer `sort-line' function should treat invisible
lines like visible ones."
+   :group 'sort
+   :type 'boolean)
+ ;;;###autoload(put 'sort-invisible-lines 'safe-local-variable 'booleanp)
+
  ;;;###autoload
  (defun sort-subr (reverse nextrecfun endrecfun
   &optional startkeyfun endkeyfun predicate)
***************
*** 210,216 ****
        (goto-char (point-min))
        (let ;; To make `end-of-line' and etc. to ignore fields.
   ((inhibit-field-text-motion t))
! (sort-subr reverse 'forward-line 'end-of-line)))))

  ;;;###autoload
  (defun sort-paragraphs (reverse beg end)
--- 216,228 ----
        (goto-char (point-min))
        (let ;; To make `end-of-line' and etc. to ignore fields.
   ((inhibit-field-text-motion t))
! (if (and (not sort-invisible-lines)
! (or (derived-mode-p 'outline-mode)
!     (and (boundp 'outline-minor-mode) outline-minor-mode)))
!    ;; In in an outline mode with sort-invisible-lines nil, sort
!    ;; only visible lines.
!    (sort-subr reverse 'forward-visible-line 'end-of-visible-line)
!  (sort-subr reverse 'forward-line 'end-of-line))))))

  ;;;###autoload
  (defun sort-paragraphs (reverse beg end)

*** simple-orig.el.gz 2016-06-18 11:29:58.000000000 -0400
--- simple.el.gz 2016-06-18 11:29:58.000000000 -0400
***************
*** 4909,4918 ****
  (kill-region (point)
       (progn (forward-visible-line arg) (point))))))

! (defun forward-visible-line (arg)
!   "Move forward by ARG lines, ignoring currently invisible newlines only.
  If ARG is negative, move backward -ARG lines.
  If ARG is zero, move to the beginning of the current line."
    (condition-case nil
        (if (> arg 0)
   (progn
--- 4909,4919 ----
  (kill-region (point)
       (progn (forward-visible-line arg) (point))))))

! (defun forward-visible-line (&optional arg)
!   "Move forward by optional ARG lines (default = 1), ignoring currently
invisible newlines only.
  If ARG is negative, move backward -ARG lines.
  If ARG is zero, move to the beginning of the current line."
+   (if (null arg) (setq arg 1))
    (condition-case nil
        (if (> arg 0)
   (progn

--001a113ce25abdb8590535a46662
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
un, Jun 19, 2016 at 12:30 PM, Eli Zaretskii <span dir=3D"ltr">&lt;<a href=
=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt;</span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,=
204);padding-left:1ex"><div>Didn&#39;t think that far, but is it really cle=
an for sort-lines to have<br>
special code for some major mode?=C2=A0 I thought a better way is to<br>
override the default behavior by having sort-lines call functions<br>
through funcall or somesuch, and then outline modes could set the<br>
appropriate variable to the function of their liking?</div></blockquote><di=
v><br></div><div>The problem with that approach is that each mode has to be=
 aware of this and add a setting, really not much different than each mode =
having its own sort function or way of calling a sort function.=C2=A0 It is=
 much more useful to centralize the behavior within the sorting library, ev=
en if it adds some conditional complexity to the code.=C2=A0 Here is the su=
ggested patch to do it this way. =C2=A0-- Bob</div><div><br></div><div><div=
>*** sort-orig.el.gz<span style=3D"white-space:pre-wrap">	</span>2016-06-19=
 12:42:12.000000000 -0400</div><div>--- sort.el.gz<span style=3D"white-spac=
e:pre-wrap">		</span>2016-06-19 12:42:12.000000000 -0400</div><div>********=
*******</div><div>*** 39,44 ****</div><div>--- 39,50 ----</div><div>=C2=A0 =
=C2=A0 :type &#39;boolean)</div><div>=C2=A0 ;;;###autoload(put &#39;sort-fo=
ld-case &#39;safe-local-variable &#39;booleanp)</div><div>=C2=A0=C2=A0</div=
><div>+ (defcustom sort-invisible-lines nil</div><div>+ =C2=A0 &quot;Non-ni=
l if the buffer `sort-line&#39; function should treat invisible lines like =
visible ones.&quot;</div><div>+ =C2=A0 :group &#39;sort</div><div>+ =C2=A0 =
:type &#39;boolean)</div><div>+ ;;;###autoload(put &#39;sort-invisible-line=
s &#39;safe-local-variable &#39;booleanp)</div><div>+=C2=A0</div><div>=C2=
=A0 ;;;###autoload</div><div>=C2=A0 (defun sort-subr (reverse nextrecfun en=
drecfun</div><div>=C2=A0 <span style=3D"white-space:pre-wrap">			</span> =
=C2=A0&amp;optional startkeyfun endkeyfun predicate)</div><div>************=
***</div><div>*** 210,216 ****</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-=
char (point-min))</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ;; To make `en=
d-of-line&#39; and etc. to ignore fields.</div><div>=C2=A0 <span style=3D"w=
hite-space:pre-wrap">	</span> =C2=A0((inhibit-field-text-motion t))</div><d=
iv>! <span style=3D"white-space:pre-wrap">	</span>(sort-subr reverse &#39;f=
orward-line &#39;end-of-line)))))</div><div>=C2=A0=C2=A0</div><div>=C2=A0 ;=
;;###autoload</div><div>=C2=A0 (defun sort-paragraphs (reverse beg end)</di=
v><div>--- 216,228 ----</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (p=
oint-min))</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ;; To make `end-of-li=
ne&#39; and etc. to ignore fields.</div><div>=C2=A0 <span style=3D"white-sp=
ace:pre-wrap">	</span> =C2=A0((inhibit-field-text-motion t))</div><div>! <s=
pan style=3D"white-space:pre-wrap">	</span>(if (and (not sort-invisible-lin=
es)</div><div>! <span style=3D"white-space:pre-wrap">		</span> (or (derived=
-mode-p &#39;outline-mode)</div><div>! <span style=3D"white-space:pre-wrap"=
>		</span> =C2=A0 =C2=A0 (and (boundp &#39;outline-minor-mode) outline-mino=
r-mode)))</div><div>! <span style=3D"white-space:pre-wrap">	</span> =C2=A0 =
=C2=A0;; In in an outline mode with sort-invisible-lines nil, sort</div><di=
v>! <span style=3D"white-space:pre-wrap">	</span> =C2=A0 =C2=A0;; only visi=
ble lines.</div><div>! <span style=3D"white-space:pre-wrap">	</span> =C2=A0=
 =C2=A0(sort-subr reverse &#39;forward-visible-line &#39;end-of-visible-lin=
e)</div><div>! <span style=3D"white-space:pre-wrap">	</span> =C2=A0(sort-su=
br reverse &#39;forward-line &#39;end-of-line))))))</div><div>=C2=A0=C2=A0<=
/div><div>=C2=A0 ;;;###autoload</div><div>=C2=A0 (defun sort-paragraphs (re=
verse beg end)</div></div><div><br></div></div><span style=3D"font-size:12.=
8px">*** simple-orig.el.gz 2016-06-18 11:29:58.000000000 -0400</span><br st=
yle=3D"font-size:12.8px"><span style=3D"font-size:12.8px">--- simple.el.gz =
2016-06-18 11:29:58.000000000 -0400</span><br style=3D"font-size:12.8px"><s=
pan style=3D"font-size:12.8px">***************</span><br style=3D"font-size=
:12.8px"><span style=3D"font-size:12.8px">*** 4909,4918 ****</span><br styl=
e=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=C2=A0 (kill-region=
 (point)</span><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8=
px">=C2=A0 =C2=A0 =C2=A0 =C2=A0(progn (forward-visible-line arg) (point))))=
))</span><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=
=C2=A0=C2=A0</span><br style=3D"font-size:12.8px"><span style=3D"font-size:=
12.8px">! (defun forward-visible-line (arg)</span><br style=3D"font-size:12=
.8px"><span style=3D"font-size:12.8px">! =C2=A0 &quot;Move forward by ARG=
=C2=A0</span><span class=3D"" style=3D"font-size:12.8px;background-color:rg=
b(255,255,255)">lines</span><span style=3D"font-size:12.8px">, ignoring cur=
rently invisible newlines only.</span><br style=3D"font-size:12.8px"><span =
style=3D"font-size:12.8px">=C2=A0 If ARG is negative, move backward -ARG=C2=
=A0</span><span class=3D"" style=3D"font-size:12.8px;background-color:rgb(2=
55,255,255)">lines</span><span style=3D"font-size:12.8px">.</span><br style=
=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=C2=A0 If ARG is zer=
o, move to the beginning of the current line.&quot;</span><br style=3D"font=
-size:12.8px"><span style=3D"font-size:12.8px">=C2=A0 =C2=A0 (condition-cas=
e nil</span><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8px"=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (&gt; arg 0)</span><br style=3D"font-size:=
12.8px"><span style=3D"font-size:12.8px">=C2=A0 =C2=A0(progn</span><br styl=
e=3D"font-size:12.8px"><span style=3D"font-size:12.8px">--- 4909,4919 ----<=
/span><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=C2=
=A0 (kill-region (point)</span><br style=3D"font-size:12.8px"><span style=
=3D"font-size:12.8px">=C2=A0 =C2=A0 =C2=A0 =C2=A0(progn (forward-visible-li=
ne arg) (point))))))</span><br style=3D"font-size:12.8px"><span style=3D"fo=
nt-size:12.8px">=C2=A0=C2=A0</span><br style=3D"font-size:12.8px"><span sty=
le=3D"font-size:12.8px">! (defun forward-visible-line (&amp;optional arg)</=
span><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8px">! =C2=
=A0 &quot;Move forward by optional ARG=C2=A0</span><span class=3D"" style=
=3D"font-size:12.8px;background-color:rgb(255,255,255)">lines</span><span s=
tyle=3D"font-size:12.8px">=C2=A0(default =3D 1), ignoring currently invisib=
le newlines only.</span><br style=3D"font-size:12.8px"><span style=3D"font-=
size:12.8px">=C2=A0 If ARG is negative, move backward -ARG=C2=A0</span><spa=
n class=3D"" style=3D"font-size:12.8px;background-color:rgb(255,255,255)">l=
ines</span><span style=3D"font-size:12.8px">.</span><br style=3D"font-size:=
12.8px"><span style=3D"font-size:12.8px">=C2=A0 If ARG is zero, move to the=
 beginning of the current line.&quot;</span><br style=3D"font-size:12.8px">=
<span style=3D"font-size:12.8px">+ =C2=A0 (if (null arg) (setq arg 1))</spa=
n><br style=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=C2=A0 =
=C2=A0 (condition-case nil</span><br style=3D"font-size:12.8px"><span style=
=3D"font-size:12.8px">=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (&gt; arg 0)</span><b=
r style=3D"font-size:12.8px"><span style=3D"font-size:12.8px">=C2=A0 =C2=A0=
(progn</span></div><div class=3D"gmail_extra"><span style=3D"font-size:12.8=
px"><br></span><br></div></div>

--001a113ce25abdb8590535a46662--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 18:18:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 14:18:51 2016
Received: from localhost ([127.0.0.1]:45381 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEKpW-0002qm-Sp
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 14:18:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39241)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bEKpV-0002qX-8J
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 14:18:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bEKpM-00085o-PD
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 14:18:43 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37529)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bEKpM-00085f-M1; Sat, 18 Jun 2016 14:18:40 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1931
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bEKpK-0001kN-9w; Sat, 18 Jun 2016 14:18:39 -0400
Date: Sat, 18 Jun 2016 21:19:36 +0300
Message-Id: <83h9cq9x6v.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: rswgnu@HIDDEN
In-reply-to: <83k2hm9ylj.fsf@HIDDEN> (message from Eli Zaretskii on Sat, 18
 Jun 2016 20:49:12 +0300)
Subject: Re: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect visible
 lines (fairly urgent)
References: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 <83twgq9znu.fsf@HIDDEN>
 <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@HIDDEN>
 <83k2hm9ylj.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> Date: Sat, 18 Jun 2016 20:49:12 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 23794 <at> debbugs.gnu.org
> 
> > For clarity, the original behavior of sort-lines is what the patch restores. The backward-incompatibility to which
> > you refer is then just an implementation error that occurred when switching over to the overlay implementation
> > of outlines as there was never any documentation that I can see that suggested any behavior change. There
> > certainly could be better documentation as to whether a 'line' refers to a visible line, an invisible line or both
> > but many functions do not delineate this. A major reason for making lines invisible is so that they are not
> > treated as regular lines when functions are applied to buffer text. Thus, sort-lines should by default operate on
> > visible lines. It could be extended or another function could be written to operate on invisible lines as well, e.g.
> > sort-invisible-lines and an alias could be made to sort-lines to be called sort-visible-lines. All of this in the
> > future. The only thing I am suggesting for right now is to restore the original behavior. Note that if all lines are
> > visible, the patch codes works as well. The issue is that when lines are invisible the current code in Emacs
> > does not work in a very useful way.
> 
> I think I already responded to this argument in my previous message.

In case it wasn't clear, I would welcome a change that is specific to
outline modes, whereby sorting would produce the same effect as it did
in Emacs 21 in these modes.  But even in outline modes, I think there
should be a way of getting the old behavior back.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 17:48:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 13:48:33 2016
Received: from localhost ([127.0.0.1]:45376 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEKMD-00025T-DG
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:48:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59219)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bEKMA-00025F-1Q
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:48:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bEKLz-0000qo-Tw
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:48:24 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36848)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bEKLz-0000po-Qr; Sat, 18 Jun 2016 13:48:19 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1910
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bEKLx-0000Bp-Mr; Sat, 18 Jun 2016 13:48:18 -0400
Date: Sat, 18 Jun 2016 20:49:12 +0300
Message-Id: <83k2hm9ylj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: rswgnu@HIDDEN
In-reply-to: <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@HIDDEN>
 (message from Robert Weiner on Sat, 18 Jun 2016 13:42:01 -0400)
Subject: Re: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
References: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 <83twgq9znu.fsf@HIDDEN>
 <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: Robert Weiner <rsw@HIDDEN>
> Date: Sat, 18 Jun 2016 13:42:01 -0400
> Cc: 23794 <at> debbugs.gnu.org
> 
>  I don't think we can make such a backward-incompatible change without
>  (a) an entry in NEWS,
> 
> I am willing to write this.

Thanks.

>  (b) suitable changes in the manual(s), and
> 
> I looked at both the Emacs and the Elisp manuals and the only change necessary would be in the elisp
> manual where the full code for sort-lines is shown, so that would be a simple replace.

I think the fact that sorting ignores invisible text should be
prominently mentioned in both the user manual and the ELisp manual,
where the sort functions and commands are described.

>  (c) some way of getting back the old behavior (which could be by way
>  of having this new behavior as an optional one).
> 
> See below. 
> 
> For clarity, the original behavior of sort-lines is what the patch restores. The backward-incompatibility to which
> you refer is then just an implementation error that occurred when switching over to the overlay implementation
> of outlines as there was never any documentation that I can see that suggested any behavior change. There
> certainly could be better documentation as to whether a 'line' refers to a visible line, an invisible line or both
> but many functions do not delineate this. A major reason for making lines invisible is so that they are not
> treated as regular lines when functions are applied to buffer text. Thus, sort-lines should by default operate on
> visible lines. It could be extended or another function could be written to operate on invisible lines as well, e.g.
> sort-invisible-lines and an alias could be made to sort-lines to be called sort-visible-lines. All of this in the
> future. The only thing I am suggesting for right now is to restore the original behavior. Note that if all lines are
> visible, the patch codes works as well. The issue is that when lines are invisible the current code in Emacs
> does not work in a very useful way.

I think I already responded to this argument in my previous message.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 17:42:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 13:42:42 2016
Received: from localhost ([127.0.0.1]:45372 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEKGY-0001v6-LM
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:42:42 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58330)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1bEKGX-0001ui-BE
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:42:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1bEKGO-00088p-W6
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:42:36 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36803)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEKGO-00088g-ST
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:42:32 -0400
Received: from mail-oi0-f46.google.com ([209.85.218.46]:35947)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <rsw@HIDDEN>) id 1bEKGN-00084d-9q
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:42:31 -0400
Received: by mail-oi0-f46.google.com with SMTP id p204so159312514oih.3
 for <23794 <at> debbugs.gnu.org>; Sat, 18 Jun 2016 10:42:31 -0700 (PDT)
X-Gm-Message-State: ALyK8tJGPT5K6vtw2uROtID5EgKLfs2/4aknEhvWRDmy/67z4vETgfR2rmbzU8fbvrgHJBhazWYkyKQdomMHuA==
X-Received: by 10.157.14.174 with SMTP id 43mr4493447otj.83.1466271750549;
 Sat, 18 Jun 2016 10:42:30 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.236.73 with HTTP; Sat, 18 Jun 2016 10:42:01 -0700 (PDT)
In-Reply-To: <83twgq9znu.fsf@HIDDEN>
References: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 <83twgq9znu.fsf@HIDDEN>
From: Robert Weiner <rsw@HIDDEN>
Date: Sat, 18 Jun 2016 13:42:01 -0400
X-Gmail-Original-Message-ID: <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@HIDDEN>
Message-ID: <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@HIDDEN>
Subject: Re: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect
 visible lines (fairly urgent)
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=001a113db4bad5f7c1053590fed6
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

--001a113db4bad5f7c1053590fed6
Content-Type: text/plain; charset=UTF-8

On Sat, Jun 18, 2016 at 1:26 PM, Eli Zaretskii <eliz@HIDDEN> wrote:

> > From: Robert Weiner <rsw@HIDDEN>
> > Date: Sat, 18 Jun 2016 11:47:08 -0400
> >
> > sort-lines calls forward-line rather than forward-visible line, so if
> > you have emacs outline entries that are collapsed/hidden to single lines
> > each and you try to sort them, their bodies and subtrees are sorted
> > separately because forward-visible-line is not used.
>
> I don't think we can make such a backward-incompatible change without
> (a) an entry in NEWS,


I am willing to write this.


> (b) suitable changes in the manual(s), and
>

I looked at both the Emacs and the Elisp manuals and the only change
necessary would be in the elisp manual where the full code for sort-lines
is shown, so that would be a simple replace.

(c) some way of getting back the old behavior (which could be by way
> of having this new behavior as an optional one).
>

See below.

For clarity, the original behavior of sort-lines is what the patch
restores.  The backward-incompatibility to which you refer is then just an
implementation error that occurred when switching over to the overlay
implementation of outlines as there was never any documentation that I can
see that suggested any behavior change.  There certainly could be better
documentation as to whether a 'line' refers to a visible line, an invisible
line or both but many functions do not delineate this.  A major reason for
making lines invisible is so that they are not treated as regular lines
when functions are applied to buffer text.  Thus, sort-lines should by
default operate on visible lines.  It could be extended or another function
could be written to operate on invisible lines as well, e.g.
sort-invisible-lines and an alias could be made to sort-lines to be called
sort-visible-lines.  All of this in the future.  The only thing I am
suggesting for right now is to restore the original behavior.  Note that if
all lines are visible, the patch codes works as well.  The issue is that
when lines are invisible the current code in Emacs does not work in a very
useful way.

Bob

--001a113db4bad5f7c1053590fed6
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On S=
at, Jun 18, 2016 at 1:26 PM, Eli Zaretskii <span dir=3D"ltr">&lt;<a href=3D=
"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt;</span> wrote:<=
br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left=
:1px #ccc solid;padding-left:1ex">&gt; From: Robert Weiner &lt;<a href=3D"m=
ailto:rsw@HIDDEN">rsw@HIDDEN</a>&gt;<br>
&gt; Date: Sat, 18 Jun 2016 11:47:08 -0400<br>
&gt;<br>
&gt; sort-lines calls forward-line rather than forward-visible line, so if<=
br>
&gt; you have emacs outline entries that are collapsed/hidden to single lin=
es<br>
&gt; each and you try to sort them, their bodies and subtrees are sorted<br=
>
&gt; separately because forward-visible-line is not used.<br>
<br>
I don&#39;t think we can make such a backward-incompatible change without<b=
r>
(a) an entry in NEWS,</blockquote><div><br></div><div>I am willing to write=
 this.</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> (b) suitable c=
hanges in the manual(s), and<br></blockquote><div><br></div><div>I looked a=
t both the Emacs and the Elisp manuals and the only change necessary would =
be in the elisp manual where the full code for sort-lines is shown, so that=
 would be a simple replace.</div><div><br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex">
(c) some way of getting back the old behavior (which could be by way<br>
of having this new behavior as an optional one).<br></blockquote><div><br><=
/div><div>See below.=C2=A0</div><div><br></div><div>For clarity, the origin=
al behavior of sort-lines is what the patch restores.=C2=A0 The backward-in=
compatibility to which you refer is then just an implementation error that =
occurred when switching over to the overlay implementation of outlines as t=
here was never any documentation that I can see that suggested any behavior=
 change.=C2=A0 There certainly could be better documentation as to whether =
a &#39;line&#39; refers to a visible line, an invisible line or both but ma=
ny functions do not delineate this.=C2=A0 A major reason for making lines i=
nvisible is so that they are not treated as regular lines when functions ar=
e applied to buffer text.=C2=A0 Thus, sort-lines should by default operate =
on visible lines.=C2=A0 It could be extended or another function could be w=
ritten to operate on invisible lines as well, e.g. sort-invisible-lines and=
 an alias could be made to sort-lines to be called sort-visible-lines.=C2=
=A0 All of this in the future.=C2=A0 The only thing I am suggesting for rig=
ht now is to restore the original behavior.=C2=A0 Note that if all lines ar=
e visible, the patch codes works as well.=C2=A0 The issue is that when line=
s are invisible the current code in Emacs does not work in a very useful wa=
y.</div><div><br></div><div>Bob</div><div><br></div></div></div></div>

--001a113db4bad5f7c1053590fed6--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at 23794 <at> debbugs.gnu.org:


Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 17:25:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 13:25:21 2016
Received: from localhost ([127.0.0.1]:45350 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEJzl-0001RI-5M
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:25:21 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54378)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1bEJzj-0001R5-Jn
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:25:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1bEJza-0004W1-JT
 for 23794 <at> debbugs.gnu.org; Sat, 18 Jun 2016 13:25:14 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34570)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1bEJza-0004VQ-Gy; Sat, 18 Jun 2016 13:25:10 -0400
Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1885
 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1bEJzY-0000Oz-Is; Sat, 18 Jun 2016 13:25:09 -0400
Date: Sat, 18 Jun 2016 20:26:13 +0300
Message-Id: <83twgq9znu.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: rswgnu@HIDDEN
In-reply-to: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
 (message from Robert Weiner on Sat, 18 Jun 2016 11:47:08 -0400)
Subject: Re: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect visible
 lines (fairly urgent)
References: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 23794
Cc: 23794 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

> From: Robert Weiner <rsw@HIDDEN>
> Date: Sat, 18 Jun 2016 11:47:08 -0400
> 
> sort-lines calls forward-line rather than forward-visible line, so if
> you have emacs outline entries that are collapsed/hidden to single lines
> each and you try to sort them, their bodies and subtrees are sorted
> separately because forward-visible-line is not used.
> 
> This patch fixes this problem and also unifies the calling convention of
> forward-visible-line with that of forward-line (allowing it to take an
> optional argument) leading to a cleaner calling convention.
> 
> Please apply it as soon as you can as Hyperbole uses sort-lines to sort
> its contact manager records and right now this doesn't work.  Although,
> sort-subr could be called directly for this application, sort-lines
> should work properly with both visible and invisible text and the patch
> is quite simple.

I don't think we can make such a backward-incompatible change without
(a) an entry in NEWS, (b) suitable changes in the manual(s), and
(c) some way of getting back the old behavior (which could be by way
of having this new behavior as an optional one).

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 18 Jun 2016 15:47:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 18 11:47:56 2016
Received: from localhost ([127.0.0.1]:45289 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1bEITU-0005eQ-35
	for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 11:47:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37537)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rsw@HIDDEN>) id 1bEITS-0005e0-02
 for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 11:47:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1bEITL-0001nt-K4
 for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 11:47:48 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,HTML_MESSAGE,
 RP_MATCHES_RCVD autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:37987)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEITL-0001n5-Gx
 for submit <at> debbugs.gnu.org; Sat, 18 Jun 2016 11:47:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56738)
 by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEITI-0007S1-VX
 for bug-gnu-emacs@HIDDEN; Sat, 18 Jun 2016 11:47:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <rsw@HIDDEN>) id 1bEITE-0001mo-N1
 for bug-gnu-emacs@HIDDEN; Sat, 18 Jun 2016 11:47:43 -0400
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59627)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rsw@HIDDEN>)
 id 1bEITE-0001mR-K2
 for bug-gnu-emacs@HIDDEN; Sat, 18 Jun 2016 11:47:40 -0400
Received: from mail-oi0-f50.google.com ([209.85.218.50]:35654)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <rsw@HIDDEN>) id 1bEITD-00069v-3F
 for bug-gnu-emacs@HIDDEN; Sat, 18 Jun 2016 11:47:39 -0400
Received: by mail-oi0-f50.google.com with SMTP id a64so3588419oii.2
 for <bug-gnu-emacs@HIDDEN>; Sat, 18 Jun 2016 08:47:38 -0700 (PDT)
X-Gm-Message-State: ALyK8tLmayH2yRCPeh7jh9dvaq7t6VXIuYwemPwo3/vxO8XFwLUycdd3HPwyc69oxVGWpWE+m5lreNSQXIGIaA==
X-Received: by 10.202.218.65 with SMTP id r62mr3836293oig.32.1466264858124;
 Sat, 18 Jun 2016 08:47:38 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.236.73 with HTTP; Sat, 18 Jun 2016 08:47:08 -0700 (PDT)
From: Robert Weiner <rsw@HIDDEN>
Date: Sat, 18 Jun 2016 11:47:08 -0400
X-Gmail-Original-Message-ID: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
Message-ID: <CA+OMD9gF+7j37bCm-GtNXwzimWzYa1yVu2UbBhd2uTwBzvp13g@HIDDEN>
Subject: Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly
 urgent)
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary=001a113d48b203ea7605358f6459
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -3.9 (---)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: rswgnu@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

--001a113d48b203ea7605358f6459
Content-Type: text/plain; charset=UTF-8

sort-lines calls forward-line rather than forward-visible line, so if
you have emacs outline entries that are collapsed/hidden to single lines
each and you try to sort them, their bodies and subtrees are sorted
separately because forward-visible-line is not used.

This patch fixes this problem and also unifies the calling convention of
forward-visible-line with that of forward-line (allowing it to take an
optional argument) leading to a cleaner calling convention.

Please apply it as soon as you can as Hyperbole uses sort-lines to sort
its contact manager records and right now this doesn't work.  Although,
sort-subr could be called directly for this application, sort-lines
should work properly with both visible and invisible text and the patch
is quite simple.

Thanks,

Bob
--------

In GNU Emacs 25.0.94.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21
Version 10.9.5 (Build 13F1603))
 of 2016-05-17 built on builder10-9.local
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-ns '--enable-locallisppath=/Library/Application
 Support/Emacs/${version}/site-lisp:/Library/Application
 Support/Emacs/site-lisp''

Configured features:
NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

----------------

*** sort-orig.el.gz 2016-06-18 11:31:13.000000000 -0400
--- sort.el.gz 2016-06-18 11:31:13.000000000 -0400
***************
*** 210,216 ****
        (goto-char (point-min))
        (let ;; To make `end-of-line' and etc. to ignore fields.
   ((inhibit-field-text-motion t))
! (sort-subr reverse 'forward-line 'end-of-line)))))

  ;;;###autoload
  (defun sort-paragraphs (reverse beg end)
--- 210,216 ----
        (goto-char (point-min))
        (let ;; To make `end-of-line' and etc. to ignore fields.
   ((inhibit-field-text-motion t))
! (sort-subr reverse 'forward-visible-line 'end-of-visible-line)))))

  ;;;###autoload
  (defun sort-paragraphs (reverse beg end)


*** simple-orig.el.gz 2016-06-18 11:29:58.000000000 -0400
--- simple.el.gz 2016-06-18 11:29:58.000000000 -0400
***************
*** 4909,4918 ****
  (kill-region (point)
       (progn (forward-visible-line arg) (point))))))

! (defun forward-visible-line (arg)
!   "Move forward by ARG lines, ignoring currently invisible newlines only.
  If ARG is negative, move backward -ARG lines.
  If ARG is zero, move to the beginning of the current line."
    (condition-case nil
        (if (> arg 0)
   (progn
--- 4909,4919 ----
  (kill-region (point)
       (progn (forward-visible-line arg) (point))))))

! (defun forward-visible-line (&optional arg)
!   "Move forward by optional ARG lines (default = 1), ignoring currently
invisible newlines only.
  If ARG is negative, move backward -ARG lines.
  If ARG is zero, move to the beginning of the current line."
+   (if (null arg) (setq arg 1))
    (condition-case nil
        (if (> arg 0)
   (progn

--001a113d48b203ea7605358f6459
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">sort-lines calls forward-line rather than forward-visible =
line, so if<br>you have emacs outline entries that are collapsed/hidden to =
single lines<br>each and you try to sort them, their bodies and subtrees ar=
e sorted<br>separately because forward-visible-line is not used.<br><br>Thi=
s patch fixes this problem and also unifies the calling convention of<br>fo=
rward-visible-line with that of forward-line (allowing it to take an<br>opt=
ional argument) leading to a cleaner calling convention.<br><br>Please appl=
y it as soon as you can as Hyperbole uses sort-lines to sort<br>its contact=
 manager records and right now this doesn&#39;t work.=C2=A0 Although,<br>so=
rt-subr could be called directly for this application, sort-lines<br>should=
 work properly with both visible and invisible text and the patch<br>is qui=
te simple.<br><br>Thanks,<br><br>Bob<br>--------<br><br>In GNU Emacs 25.0.9=
4.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F=
1603))<br>=C2=A0of 2016-05-17 built on builder10-9.local<br>Windowing syste=
m distributor &#39;Apple&#39;, version 10.3.1404<br>Configured using:<br>=
=C2=A0&#39;configure --with-ns &#39;--enable-locallisppath=3D/Library/Appli=
cation<br>=C2=A0Support/Emacs/${version}/site-lisp:/Library/Application<br>=
=C2=A0Support/Emacs/site-lisp&#39;&#39;<br><br>Configured features:<br>NOTI=
FY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS<br><br>Important settings:<br>=
=C2=A0 value of $LANG: en_US.UTF-8<br>=C2=A0 locale-coding-system: utf-8-un=
ix<br><br>----------------<br><br>*** sort-orig.el.gz 2016-06-18 11:31:13.0=
00000000 -0400<br>--- sort.el.gz 2016-06-18 11:31:13.000000000 -0400<br>***=
************<br>*** 210,216 ****<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char =
(point-min))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ;; To make `end-of-line&#3=
9; and etc. to ignore fields.<br>=C2=A0 =C2=A0((inhibit-field-text-motion t=
))<br>! (sort-subr reverse &#39;forward-line &#39;end-of-line)))))<br>=C2=
=A0 <br>=C2=A0 ;;;###autoload<br>=C2=A0 (defun sort-paragraphs (reverse beg=
 end)<br>--- 210,216 ----<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (goto-char (point-=
min))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ;; To make `end-of-line&#39; and =
etc. to ignore fields.<br>=C2=A0 =C2=A0((inhibit-field-text-motion t))<br>!=
 (sort-subr reverse &#39;forward-visible-line &#39;end-of-visible-line)))))=
<br>=C2=A0 <br>=C2=A0 ;;;###autoload<br>=C2=A0 (defun sort-paragraphs (reve=
rse beg end)<br><br><br>*** simple-orig.el.gz 2016-06-18 11:29:58.000000000=
 -0400<br>--- simple.el.gz 2016-06-18 11:29:58.000000000 -0400<br>*********=
******<br>*** 4909,4918 ****<br>=C2=A0 (kill-region (point)<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0(progn (forward-visible-line arg) (point))))))<br>=C2=A0 <=
br>! (defun forward-visible-line (arg)<br>! =C2=A0 &quot;Move forward by AR=
G lines, ignoring currently invisible newlines only.<br>=C2=A0 If ARG is ne=
gative, move backward -ARG lines.<br>=C2=A0 If ARG is zero, move to the beg=
inning of the current line.&quot;<br>=C2=A0 =C2=A0 (condition-case nil<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (&gt; arg 0)<br>=C2=A0 =C2=A0(progn<br>--- =
4909,4919 ----<br>=C2=A0 (kill-region (point)<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0(progn (forward-visible-line arg) (point))))))<br>=C2=A0 <br>! (defun fo=
rward-visible-line (&amp;optional arg)<br>! =C2=A0 &quot;Move forward by op=
tional ARG lines (default =3D 1), ignoring currently invisible newlines onl=
y.<br>=C2=A0 If ARG is negative, move backward -ARG lines.<br>=C2=A0 If ARG=
 is zero, move to the beginning of the current line.&quot;<br>+ =C2=A0 (if =
(null arg) (setq arg 1))<br>=C2=A0 =C2=A0 (condition-case nil<br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 (if (&gt; arg 0)<br>=C2=A0 =C2=A0(progn</div>

--001a113d48b203ea7605358f6459--




Acknowledgement sent to rswgnu@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#23794; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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