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: Luc Teirlinck
Subject: Re: moving point over invisible and intangible text
Date: Wed, 15 Oct 2003 17:57:46 -0500 (CDT)

Richard Stallman wrote:

   Unfortunately I can't see what better alternative there is.  I don't
   see any general principles that say what line-move ought to do.

It is also very unclear what several related functions are supposed to
do, making debugging this kind of stuff (while worrying about not
breaking other things) close to hopeless.  I actually looked at the
original reported bug and ran into the following exotic behavior of
`line-move-to-column':

line1
line2
line3
line4

Put point at the end of line3.

with line2 (including trailing newline) being either invisible or
intangible, but _not both_, (line-move-to-column 0) takes point to the
beginning of line3, but with line2 being _both_ invisible and
intangible (line-move-to-column 0) takes point to the beginning of
line2.  (Use C-x = if line2 is invisible.)  This seems to explain the
behavior described by Klaus, given the call to `line-move-to-column'
in `line-move-finish'.  However, is this behavior of
`line-move-to-column' to be expected or a bug?
 
Let us search for the answer in the doc string:

(line-move-to-column COL)

Try to find column COL, considering invisibility.
This function works only in certain cases,
because what we really need is for `move-to-column'
and `current-column' to be able to ignore invisible text.

Personal comment:

I am not completely sure what "find column COL, considering
invisibility" concretely means and intangibility is not even
mentioned.  It clearly admits: "This function works only in certain
cases," but `line-move-finish' calls it without any apparent
restriction to the particular cases in which `line-move-to-column' is
supposed to actually work (whatever these cases are), and line-move
calls `line-move-finish', again without any apparent restriction of
such a type.

Sincerely,

Luc.





reply via email to

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