unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John J Foerch <jjfoerch@earthlink.net>
To: emacs-devel@gnu.org
Subject: Re: Outline mode
Date: Mon, 03 Sep 2007 22:26:40 -0400	[thread overview]
Message-ID: <87vear6u8v.fsf@earthlink.net> (raw)
In-Reply-To: jwvtzqb79p9.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> Your code is really a big hack and the problems I mentioned are just one
> of many.  You can cover those up by adding more hacks, which will just leave
> other holes, etc...
>
> This said, my assessment of the problem as being a redisplay problem isn't
> right either.  It seems this redisplay problem was fixed a while ago, so
> really I don't see what problem you're talking about.  Maybe the problem
> you're referring to is that C-e doesn't go to the end of the heading (when
> folded) but to the end of the entry (which is why point ends up after the
> ellipsis).  This is a feature implemented in move-end-of-line.  Maybe you'd
> want to rebind C-e to end-of-line rather than move-end-of-line.
>
> Or maybe move-end-of-line should be changed so as not to jump to the end of
> the entry in this case (i.e. to stop before a hidden text if that text is
> covered by an ellipsis and is followed by a newline).  I'd tend to agree
> with such a change.
>
>
>         Stefan

Okay, now that I know that outline-mode's behavior is not a bug (only
a peave), I agree that my side-stepping the invisibility-spec ellipsis
is a hack.  Yet I don't like this idea of changing the movement
commands to make it more difficult to move point to certain
characters, either.

The basic thing that I want to implement is to make outline mode
collapse in a way that fits with how I naturally think about
outlines--the header is one complete line that can be edited as
normally as you would edit any line in any text file, and the entry
consists of all the lines below it, until the next header.  The
ellipsis code related to invisibility-spec does not accomodate this
well, because it would place the ellipsis on the line after the
header--clearly not a nice looking format.  That is what led me to
implement separate ellipsis handling in outline-mode--a clear mistake.

So is the following an agreeable solution?  Modify the
invisibility-spec code to allow the ellipsis to be placed one
character before the invisible text, via a third parameter in
invisibility-spec.  This would allow the entries to be collapsed in
the way I described, while still allowing the ellipsis to appear on
the same line as the header, and without the hack work-arounds.

This still has the problem of compatibility with derived modes, some
of which (like org-mode if I recall) explicitly depend on the header's
newline being invisible, and the entry's newline being visible.  For
this problem, I suggest writing whatever abstractions are necessary in
outline-mode, so the point-arithmetic in the derived modes can be
replaced by function calls, and thus accomodate both ways of hiding
entries.

--John

  reply	other threads:[~2007-09-04  2:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-31 16:30 Outline mode John J Foerch
2007-08-31 20:22 ` Stefan Monnier
2007-08-31 23:44   ` John J Foerch
2007-09-01  2:02     ` Stefan Monnier
2007-09-01 17:31       ` John J Foerch
2007-09-03 21:03         ` Stefan Monnier
2007-09-04  2:26           ` John J Foerch [this message]
2007-09-04 14:27             ` Stefan Monnier
2007-09-04 15:58               ` John J Foerch
2007-09-04 19:45                 ` Stefan Monnier
2007-09-04 21:45                   ` John J Foerch
2007-09-04 22:52           ` Davis Herring
2007-09-05  0:09             ` John J Foerch
2007-09-05  1:11               ` Davis Herring
2007-09-05 19:41                 ` John J Foerch
2007-09-05 19:56                   ` Davis Herring
2007-09-10 15:06                     ` John J Foerch
2007-09-02 15:50 ` Richard Stallman

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=87vear6u8v.fsf@earthlink.net \
    --to=jjfoerch@earthlink.net \
    --cc=emacs-devel@gnu.org \
    /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).