[Top][All Lists]

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

'struct window' cleanup #3

From: Dmitry Antipov
Subject: 'struct window' cleanup #3
Date: Wed, 27 Jun 2012 11:10:34 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

This patch changes the following slots of `struct window'
from Lisp_Object to:

  use_time -> int
  sequence_number -> int
  last_modified -> EMACS_INT
  last_overlay_modified -> EMACS_INT
  last_point -> ptrdiff_t
  window_end_pos -> ptrdiff_t
  window_end_vpos -> ptrdiff_t


1. IIUC, `window_initialized' is redundant and obsolete.

2. Fields hscroll and min_hscroll are good candidates for conversion
   too, but this requires some redesign of `struct saved_window', most
   probably to yet another pseudovector.

Special notes about hard stuff in xdisp.c:

1. Field window_end_valid is used in a tricky way which isn't quite
   clear for me :-), so I would like to not touch it at this time
   (hopefully I will get back to it later).

2. Since last_point is an integer, this check is no longer valid:

   /* Right after splitting windows, last_point may be nil.  */
   && INTEGERP (w->last_point);

   My tests never shows zero here, so I'm installing assertion instead.

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 never get w->window_end_vpos >= w->current_matrix->nrows, but
   run into w->window_end_vpos == 0 several times. At this moment, I have
   no ideas whether Gerd was correct about fixing window.c, so this
   needs more detailed investigations.


Attachment: window_cleanup.patch
Description: Text document

reply via email to

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