unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: 23794@debbugs.gnu.org
Cc: Richard Stallman <rms@gnu.org>
Subject: bug#23794: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines respect visible lines (fairly urgent)
Date: Sat, 23 Dec 2017 21:21:02 -0500	[thread overview]
Message-ID: <CA+OMD9gn8ZGghYwhCrMSELm1xdiiiCHA2v7HgTFWvvs5CrBNhQ@mail.gmail.com> (raw)
In-Reply-To: <CA+OMD9i306uPuixf5G3tQP7zDoaRtacedYg53FJfo8aquFqtUg@mail.gmail.com>

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

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

> ---------- Forwarded message ----------
> From: Richard Stallman <rms@gnu.org>
> Date: Wed, Jun 22, 2016 at 2:34 AM
> Subject: Re: Fwd: bug#23789: Emacs 25.0.94: Patch to make sort-lines
> respect visible lines (fairly urgent)
> To: rswgnu@gmail.com
>
>   > > 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.
>

​I agree.
​

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

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

​​
> I have a feeling that sort-lines doesn't really make
> ​​
> sense for an
> ​
> ​​
> o
> ​​
> u
> ​​
> t
> ​​
> l
> ​​
> i
> ​​
> n
> ​​
> e
> ​​
>
​​
​Personally, I have often found it useful.
​

> ​​
> , and other operations are needed for sortin
> ​​
> g in outlines.
>
​​
​Yes, we could write other commands or we could apply something like the
simple patch I provided and make this do something ​useful before Emacs 26
is released.
We all agree that the current behavior of sort-lines is not useful in
outlines as it stands.

​​
> But I am not sure of that.
> ​​
>
​​
​I have contributed what I can on this and I hope someone is willing 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
​

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

  reply	other threads:[~2017-12-24  2:21 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
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                 ` Robert Weiner [this message]
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+OMD9gn8ZGghYwhCrMSELm1xdiiiCHA2v7HgTFWvvs5CrBNhQ@mail.gmail.com \
    --to=rsw@gnu.org \
    --cc=23794@debbugs.gnu.org \
    --cc=rms@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).