From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly urgent) Date: Sat, 18 Jun 2016 21:19:36 +0300 Message-ID: <83h9cq9x6v.fsf@gnu.org> References: <83twgq9znu.fsf@gnu.org> <83k2hm9ylj.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1466273971 1943 80.91.229.3 (18 Jun 2016 18:19:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jun 2016 18:19:31 +0000 (UTC) Cc: 23794@debbugs.gnu.org To: rswgnu@gmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 18 20:19:20 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bEKpv-0000TH-Vh for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 20:19:16 +0200 Original-Received: from localhost ([::1]:35961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKpr-0006yx-Qy for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 14:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKpl-0006yg-FA for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 14:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEKpi-00088H-5y for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 14:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKpi-00088D-30 for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 14:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bEKph-0002rD-VK for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 14:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Jun 2016 18:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23794-submit@debbugs.gnu.org id=B23794.146627393110964 (code B ref 23794); Sat, 18 Jun 2016 18:19:01 +0000 Original-Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 18:18:51 +0000 Original-Received: from localhost ([127.0.0.1]:45381 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEKpW-0002qm-Sp for submit@debbugs.gnu.org; Sat, 18 Jun 2016 14:18:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEKpV-0002qX-8J for 23794@debbugs.gnu.org; Sat, 18 Jun 2016 14:18:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEKpM-00085o-PD for 23794@debbugs.gnu.org; Sat, 18 Jun 2016 14:18:43 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37529) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKpM-00085f-M1; Sat, 18 Jun 2016 14:18:40 -0400 Original-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 ) id 1bEKpK-0001kN-9w; Sat, 18 Jun 2016 14:18:39 -0400 In-reply-to: <83k2hm9ylj.fsf@gnu.org> (message from Eli Zaretskii on Sat, 18 Jun 2016 20:49:12 +0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119748 Archived-At: > Date: Sat, 18 Jun 2016 20:49:12 +0300 > From: Eli Zaretskii > Cc: 23794@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.