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 20:49:12 +0300 Message-ID: <83k2hm9ylj.fsf@gnu.org> References: <83twgq9znu.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1466272168 8906 80.91.229.3 (18 Jun 2016 17:49:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jun 2016 17:49:28 +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 19:49:17 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 1bEKMt-0006Jn-4c for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 19:49:15 +0200 Original-Received: from localhost ([::1]:35883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKMs-0003OT-0p for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 13:49:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKMm-0003NJ-JY for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:49:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEKMg-00016o-Jh for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:49:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKMg-00016k-Ft for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bEKMg-00026E-9g for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:49:02 -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 17:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23794 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23794-submit@debbugs.gnu.org id=B23794.14662721138031 (code B ref 23794); Sat, 18 Jun 2016 17:49:02 +0000 Original-Received: (at 23794) by debbugs.gnu.org; 18 Jun 2016 17:48:33 +0000 Original-Received: from localhost ([127.0.0.1]:45376 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEKMD-00025T-DG for submit@debbugs.gnu.org; Sat, 18 Jun 2016 13:48:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEKMA-00025F-1Q for 23794@debbugs.gnu.org; Sat, 18 Jun 2016 13:48:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEKLz-0000qo-Tw for 23794@debbugs.gnu.org; Sat, 18 Jun 2016 13:48:24 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEKLz-0000po-Qr; Sat, 18 Jun 2016 13:48:19 -0400 Original-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 ) id 1bEKLx-0000Bp-Mr; Sat, 18 Jun 2016 13:48:18 -0400 In-reply-to: (message from Robert Weiner on Sat, 18 Jun 2016 13:42:01 -0400) 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:119747 Archived-At: > From: Robert Weiner > Date: Sat, 18 Jun 2016 13:42:01 -0400 > Cc: 23794@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.