unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 23794@debbugs.gnu.org
Subject: bug#23794: Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly urgent)
Date: Sat, 18 Jun 2016 13:42:01 -0400	[thread overview]
Message-ID: <CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@mail.gmail.com> (raw)
In-Reply-To: <83twgq9znu.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]

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

> > From: Robert Weiner <rsw@gnu.org>
> > 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

[-- Attachment #2: Type: text/html, Size: 2896 bytes --]

  reply	other threads:[~2016-06-18 17:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87mvmji9jv.fsf@163.com>
2016-06-18 15:47 ` bug#23794: Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly urgent) Robert Weiner
2016-06-18 17:26   ` Eli Zaretskii
2016-06-18 17:42     ` Robert Weiner [this message]
2016-06-18 17:49       ` Eli Zaretskii
2016-06-18 18:19         ` Eli Zaretskii
     [not found]   ` <CA+OMD9i=3i5Z3xsnmjUvi8Jfs68x++kkZentoRM8yu9o2srE=Q@mail.gmail.com>
     [not found]     ` <E1bEgMo-0005Ld-M3@fencepost.gnu.org>
     [not found]       ` <CA+OMD9i8eQFeKV840uP+ecbrtKYjHcKz4e5HsnQaXbSivRdnAQ@mail.gmail.com>
     [not found]         ` <E1bF8FJ-00035J-Vn@fencepost.gnu.org>
     [not found]           ` <CA+OMD9gMn6cOOa4=Mj+oWs9zg41+PEFtRN6ryeDoZUTq3iY1QA@mail.gmail.com>
     [not found]             ` <E1bFbjx-0002sy-LM@fencepost.gnu.org>
2017-08-28  4:00               ` bug#23794: Fwd: Fwd: bug#23789: " Robert Weiner
2017-12-24  2:21                 ` bug#23794: " Robert Weiner
2019-06-25 13:08   ` bug#23794: " Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+OMD9hALyTj+7zoAyUHJc6FUJE4g8QMd4xJmMiZi_fpry_g1w@mail.gmail.com \
    --to=rsw@gnu.org \
    --cc=23794@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).