emacs-devel
[Top][All Lists]
Advanced

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

Re: invisible


From: martin rudalics
Subject: Re: invisible
Date: Fri, 23 Nov 2007 15:25:19 +0100
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> With (forward-line -1) there is also no line skipping,
> but this is also the case without setting the rear-nonsticky property to
> t, i.e., I see no difference, in contrast to C-p.  The value of
> track-eol is nil (the default).  So I am not sure what problems you
> mean.

Assigning the rear-sticky property affects where `point' is set by
scan_newline which does the line-end serching in `forward-line'.  Not
setting the rear-nonsticky property skips the line ends with the
invisible property, at least on my system.  Since `previous-line' and
`next-line' both rely on `forward-line' to skip lines, I can't imagine
how you do not see the problem with the latter.  Please try again.

> I don't recall this discussion, but in any case Emacs normally does
> update the line number display when the cursor moves to another line,
> which does not involve buffer modification, so I don't see why
> invisibility should make a difference here.

My memory was bad, have a look at the thread starting here:

http://lists.gnu.org/archive/html/emacs-devel/2006-02/msg00338.html

>>In current development Emacs, the cursor stays put, i.e., C-p is a no-op
>>>here; the same goes for every position in line 3, except the beginning
>>>of the line: here C-p goes to the beginning of line 1 (the parenthetical
>>>comment doesn't make sense, unless it is a typo for line 1, or maybe he
>>>means the mode line should display L2 instead of L3, even though the
>>>cursor stays put).
>>
>>This seems like a bug in `line-move-finish', please try the attached
>>patch (untested).
>
>
> With your patch typing C-p, with the cursor at any position in line 3
> but the beginning of the line, moves the cursor to the beginning of line
> 3, i.e., does the same thing as C-a.  I think I would have expected it
> to put the cursor on line 1.  (At the beginning of line 3 the behavior
> is as before, C-p goes to the beginning of line 1.)

Did you assign the rear-nonsticky property?  It won't work without that
property due to the behavior of the point setting mechanism.

> Summarizing, it appears that rear-nonsticky should be set to t when a
> position is given the invisible property.  In particular,
> facemenu-set-invisible should be changed accordingly, otherwise the menu
> choice Edit->Text Properties->Special Properties->Invisible admits the
> observed motion misbehavior.  (But I don't know if there are other cases
> where facemenu-set-invisible should leave the invisible position
> rear-sticky.)  This still does not fix the problem with C-p at positions
> other than the beginning of the line after an invisible line, but your
> patch for that also results in unexpected behavior.

Setting rear-nonsticky is _not_ sufficient, you have to do something as
in my patch in order to handle `line-move-ignore-invisible' correctly.
Please try again (1) with the property set, (2) with and without my
patch applied, and (3) with both values for `line-move-ignore-invisible'
and `track-eol'.





reply via email to

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