emacs-devel
[Top][All Lists]
Advanced

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

Re: The unwarranted scrolling assumption


From: Lennart Borgman
Subject: Re: The unwarranted scrolling assumption
Date: Sat, 19 Jun 2010 16:45:15 +0200

On Sat, Jun 19, 2010 at 10:36 AM, Eli Zaretskii <address@hidden> wrote:
>> From: Lennart Borgman <address@hidden>
>> Date: Fri, 18 Jun 2010 23:25:21 +0200
>> Cc: address@hidden
>>
>> On Fri, Jun 18, 2010 at 9:00 PM, Eli Zaretskii <address@hidden> wrote:
>> >> From: Lennart Borgman <address@hidden>
>> >> Date: Fri, 18 Jun 2010 19:31:30 +0200
>> >> Cc: address@hidden
>> >>
>> >> +  if ((w->current_matrix->begv != b->begv) || (w->current_matrix->zv != 
>> >> b->zv))
>> >> +    b->clip_changed = 1;
>> >
>> > You cannot safely use w->current_matrix if w->window_end_valid is nil.
>>
>>
>> So you say that w->current_matrix->begv is not valid unless
>> window_end_valid is non-nil.
>
> I'm saying that _none_ of the members of w->current_matrix is safe to
> use when the window_end_valid flag is nil.


I am glad that you pointed me to the variables, but what you are
saying here looks maybe more like an assumption you make. It not then
please explain exactly why you think the begv/zv members and not valid
at the point where I use them. (See below first.)


> This flag being nil means
> that the current matrix is not yet up to date, so its various members
> are not completely computed and do not reflect what's on the screen.
>
>> Are you saying that w->current_matrix->begv/zv is set before the
>> redisplay is finished?
>
> The definition of ``redisplay is finished'' for each window is
> precisely that this flag is set.  Obviously, the other members of the
> current_matrix struct are computed before that, and not in a single
> place.  So yes, the begv/zv members are computed before redisplay is
> finished.


No. begv/zv members are set when redisplay is finished and nowhere
else. This is also in accordance with what the documentation for them
says:

  /* Values of BEGV and ZV as of last redisplay.  Set in
     mark_window_display_accurate_1.  */
  int begv, zv;


> Yes, because it makes sure the window_end_valid flag is non-nil.  Then
> the information is valid and can be used.


Since they those begv/zv members are only set in
mark_window_display_accurate_1 and reconsider_clip_changes is always
called (or at least should have been called) before any redisplay
activity the information in w->current_matrix->begv/zv is precisely
what is needed to set clip_changed to 1. (Note that it would have been
different if I instead wanted to clip_changed to 0. For that case I
guess that the check of window_end_valid is correct, but it is a
completely different situation.)

However there is one (important) assumption I make here: Clip changes
can not occur during redisplay, i.e. between after
reconsider_clip_changes and mark_window_display_accurate_1.

Is this assumption valid?


If not then the patch needed to coordinate narrow_to_region etc with
redisplay is quite a bit more complicated. (I will explain why if
needed and there is a good reason to believe that the assumption above
is not valid.)



reply via email to

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