all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: 'struct window' cleanup #3
Date: Thu, 28 Jun 2012 16:51:21 +0400	[thread overview]
Message-ID: <4FEC5349.9050105@yandex.ru> (raw)
In-Reply-To: <83ehp08y8f.fsf@gnu.org>

On 06/27/2012 09:24 PM, Eli Zaretskii wrote:

>> 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.

I need more time to think on it. Nevertheless, I believe that other fields of
struct window (which aren't used in such a tricky way) may be converted
without a risk to break redisplay, and I did that in 108788 and 108790.

Dmitry



  parent reply	other threads:[~2012-06-28 12:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25  8:56 'struct window' cleanup #2 Dmitry Antipov
2012-06-25 14:22 ` John Wiegley
2012-06-25 14:42   ` Dmitry Antipov
2012-06-25 14:27 ` Paul Eggert
2012-06-25 14:53 ` Stefan Monnier
2012-06-25 16:30   ` Dmitry Antipov
2012-06-25 16:35   ` martin rudalics
2012-06-25 16:49     ` Dmitry Antipov
2012-06-26  7:26       ` martin rudalics
2012-06-26  9:06         ` Dmitry Antipov
2012-06-26 15:37           ` Eli Zaretskii
2012-06-26 15:32         ` Eli Zaretskii
2012-06-26 16:49           ` Dmitry Antipov
2012-06-26 17:12             ` Eli Zaretskii
2012-06-27  0:42           ` Stefan Monnier
2012-06-27  3:03             ` Eli Zaretskii
2012-06-27  7:10               ` 'struct window' cleanup #3 Dmitry Antipov
2012-06-27 13:32                 ` Stefan Monnier
2012-06-27 17:37                   ` Eli Zaretskii
2012-06-27 17:24                 ` Eli Zaretskii
2012-06-27 17:59                   ` Dmitry Antipov
2012-06-27 19:36                     ` Eli Zaretskii
2012-07-01 15:05                       ` Dmitry Antipov
2012-07-01 15:42                         ` Andreas Schwab
2012-06-28 12:51                   ` Dmitry Antipov [this message]
2012-06-27  7:06           ` 'struct window' cleanup #2 martin rudalics
2012-06-27 16:59             ` Eli Zaretskii
2012-06-25 16:39 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FEC5349.9050105@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.