emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: moving point over invisible and intangible text


From: Richard Stallman
Subject: Re: moving point over invisible and intangible text
Date: Wed, 22 Oct 2003 05:25:12 -0400

    I don't strictly follow the principle of not allowing point on both
    sides of the invisible text.

That's the entire purpose of the invisible-intangible feature.  There
should only be one place point can appear to the user, for any one
place on the screen.  If your feature doesn't do this, it doesn't
really replace the invisible-intangible feature.

      An example might be
    when a line has some invisible text at its end and I do C-e: I want
    to skip to the end of the invisible text,

Why after and not before?  I am not convinced.

                                              but I don't want to skip past
    the \n that follows it.

The right place to put point would seem to be before the invisible text,
in this case.  That's the point value that corresponds to the position
on the screen at the end of the text on the line.  There should not be
more than one.

What this proves is that forward motion should sometiems move point
back before the invisible text, not past the following visible
character.  In fact, it seems to me that that is ALWAYS what it should
do.  Regardless of whether point moved forward or backward, redisplay
should canonicalize it to the position before the invisible text.

The problem is, that will give the wrong results for many editing
commands.  For instance, if you do M-f, it is likely to move to
somewhere in the middle of the invisible text.  Then the code that
moves point out of the invisible region can't possibly give
intelligible results.  Point might not move at all, or it might move
after the newline, but neither of those could be considered
legitimate.

So I am starting to conclude that what we want is something different.
Something that treats the positions before and after the invisible
text as somehow equivalent alternatives.  If the command is going to
move forward, it should start from the end of the invisible text.  If
it is going to move backward, it should start from the beginning of
the invisible text.  This way, the invisible text will mostly act
as if it were not there.

The hard part about this is that a Lisp program does not say anything
about which way it is "going to move".  Not now.  But we could
add a primitive `skip-invisible'.  If you're going to do forward
motion, you could do (skip-invisible) first thing to put point
at the end of the invisible text.

What do people think of this idea?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]