emacs-devel
[Top][All Lists]
Advanced

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

Re: 'struct window' cleanup #3


From: Eli Zaretskii
Subject: Re: 'struct window' cleanup #3
Date: Wed, 27 Jun 2012 20:24:00 +0300

> Date: Wed, 27 Jun 2012 11:10:34 +0400
> From: Dmitry Antipov <address@hidden>
> CC: address@hidden
> 
> 1. IIUC, `window_initialized' is redundant and obsolete.

Does it still work to run "./temacs -Q", after this change:

> -  if (window_initialized)
> +  if (initialized)

The reason I ask is because window_initialized was set non-zero in
init_window_once, which was called from emacs.c when 'initialized' is
zero.  So the above 'if' would trigger when 'initialized' was zero,
but after your change it will only trigger when 'initialized' is
non-zero.  Am I missing something?  'initialized' is zero when running
un-dumped Emacs, e.g. 'temacs'.


> 3. The check:
> 
>     && INTEGERP (w->window_end_vpos)
>     && XFASTINT (w->window_end_vpos) < w->current_matrix->nrows
> 
>     is transformed to:
> 
>     && w->window_end_vpos > 0
>     && w->window_end_vpos < w->current_matrix->nrows

I don't think this is right.  window_end_vpos is the number of the
last glyph row of a glyph matrix, so it can legitimately be zero, when
w->current_matrix->nrows is 1.  We need to initialize this member with
some invalid value, like -1, if we want to distinguish between values
we can and cannot trust.  Or maybe test window_end_valid here (to put
our money where our mouth -- i.e. the commentary -- is ;-).

>     I never get w->window_end_vpos >= w->current_matrix->nrows

Try something that enlarges and then shrinks the minibuffer window.
Or maybe split a window on a TTY.  Anyway, this does happen.

>     but run into w->window_end_vpos == 0 several times.

See above: it's a legitimate value.

>     At this moment, I have no ideas whether Gerd was correct about
>     fixing window.c, so this needs more detailed investigations.

My gray hair taught me that Gerd is usually right.



reply via email to

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