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: Miles Bader
Subject: Re: moving point over invisible and intangible text
Date: 16 Oct 2003 11:36:07 +0900

Luc Teirlinck <address@hidden> writes:
> Go back to the concrete example:
> 
> line1
> line2
> line3
> line4
> 
> We make line2, including trailing newline, invisible.  We put point at
> the end of line3 and do (line-move-to-column 0).  We follow your
> procedure, delete line2, newline and all, and move point to the
> beginning of the resulting line.  Then we put the invisible text back.
> If we put it back before point, point winds up at the beginning of line3,
> which is the actual behavior if the invisible text is not intangible.
> If we put it back after point, point winds up at the beginning of
> line2, the actual behavior if the invisible text is intangible.
> Maybe there is some reason why this dependence on intangibility is
> somehow "obvious", but I can not immediately see it.

I didn't say the `dependence on intangibility' was obvious I said the
meaning of the docstring seems obvious; the way intangibility may very
well be broken and cause problems.

`move-to-column' is nominally a function that moves point within a
single line.  There are two different sorts of line we have to worry
about here, primarily display lines (to which invisibility applies), but
also logical lines in the buffer (to which it doesn't); move-to-column
should probably it should _try_ to behave consistently with respect to
_both_ sorts of lines, but if that's impossible, prefer display lines.

For instance in your example, since the beginning of line3 is column 0
of the same line both on the display, and in the buffer, it seems that
(...move-to-column 0) should move there.  If line2's invisibility
included some more characters at the beginning of line3, then I think
(...m-t-c 0) should move to the first _visible_ character on line3.  If
line2's invisibility _also_ includes the _preceding_ newline, causing
line1 and line3 be displayed as if they were one line, then (...m-t-c 0)
should probably move to the beginning of line1.

-Miles
-- 
Fast, small, soon; pick any 2.




reply via email to

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