From 45942c7dd05bac26a06674e3d903a3b5d5d8e577 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Thu, 28 Jun 2012 15:11:48 +0400 Subject: [PATCH] * window.h (struct window): Change type of 'use_time' and 'sequence_number' from Lisp_Object to int. * frame.c (make_frame): Adjust users accordingly. * print.c (print_object): Likewise. * window.c (select_window, Fwindow_use_time, make_parent_window) (make_window): Likewise. --- src/ChangeLog | 9 +++++++++ src/frame.c | 3 +-- src/print.c | 3 +-- src/window.c | 12 ++++-------- src/window.h | 12 ++++++------ 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index fd1f17b8cde..7ebcd7b82d4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-06-28 Dmitry Antipov + + * window.h (struct window): Change type of 'use_time' and + 'sequence_number' from Lisp_Object to int. + * frame.c (make_frame): Adjust users accordingly. + * print.c (print_object): Likewise. + * window.c (select_window, Fwindow_use_time, make_parent_window) + (make_window): Likewise. + 2012-06-28 Dmitry Antipov * dispextern.h (GLYPH_DEBUG): Now defined in config.h if diff --git a/src/frame.c b/src/frame.c index b048327abfb..f9a557f4424 100644 --- a/src/frame.c +++ b/src/frame.c @@ -356,8 +356,7 @@ make_frame (int mini_p) f->selected_window = root_window; /* Make sure this window seems more recently used than a newly-created, never-selected window. */ - ++window_select_count; - XSETFASTINT (XWINDOW (f->selected_window)->use_time, window_select_count); + XWINDOW (f->selected_window)->use_time = ++window_select_count; return f; } diff --git a/src/print.c b/src/print.c index 68b9c30c564..e12313688f5 100644 --- a/src/print.c +++ b/src/print.c @@ -1774,8 +1774,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag { int len; strout ("#sequence_number)); + len = sprintf (buf, "%d", XWINDOW (obj)->sequence_number); strout (buf, len, len, printcharfun); if (!NILP (XWINDOW (obj)->buffer)) { diff --git a/src/window.c b/src/window.c index f640a54b283..55d6ac7a6ee 100644 --- a/src/window.c +++ b/src/window.c @@ -331,8 +331,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) if (NILP (norecord)) { - ++window_select_count; - XSETFASTINT (w->use_time, window_select_count); + w->use_time = ++window_select_count; record_buffer (w->buffer); } @@ -499,7 +498,7 @@ one. The window with the lowest use time is the least recently selected one. */) (Lisp_Object window) { - return decode_window (window)->use_time; + return make_number (decode_window (window)->use_time); } DEFUN ("window-total-height", Fwindow_total_height, Swindow_total_height, 0, 1, 0, @@ -3250,8 +3249,7 @@ make_parent_window (Lisp_Object window, int horflag) sizeof (Lisp_Object) * VECSIZE (struct window)); XSETWINDOW (parent, p); - ++sequence_number; - XSETFASTINT (p->sequence_number, sequence_number); + p->sequence_number = ++sequence_number; replace_window (window, parent, 1); @@ -3290,9 +3288,6 @@ make_window (void) w->pointm = Fmake_marker (); XSETFASTINT (w->hscroll, 0); XSETFASTINT (w->min_hscroll, 0); - XSETFASTINT (w->use_time, 0); - ++sequence_number; - XSETFASTINT (w->sequence_number, sequence_number); XSETFASTINT (w->last_point, 0); w->vertical_scroll_bar_type = Qt; XSETFASTINT (w->window_end_pos, 0); @@ -3303,6 +3298,7 @@ make_window (void) w->nrows_scale_factor = w->ncols_scale_factor = 1; w->phys_cursor_type = -1; w->phys_cursor_width = -1; + w->sequence_number = ++sequence_number; /* Reset window_list. */ Vwindow_list = Qnil; diff --git a/src/window.h b/src/window.h index 0d3910c8cb0..996c966b053 100644 --- a/src/window.h +++ b/src/window.h @@ -147,12 +147,6 @@ struct window the user has set, by set-window-hscroll for example. */ Lisp_Object min_hscroll; - /* Number saying how recently window was selected. */ - Lisp_Object use_time; - - /* Unique number of window assigned when it was created. */ - Lisp_Object sequence_number; - /* No permanent meaning; used by save-window-excursion's bookkeeping. */ Lisp_Object temslot; @@ -254,6 +248,12 @@ struct window struct glyph_matrix *current_matrix; struct glyph_matrix *desired_matrix; + /* Number saying how recently window was selected. */ + int use_time; + + /* Unique number of window assigned when it was created. */ + int sequence_number; + /* Scaling factor for the glyph_matrix size calculation in this window. Used if window contains many small images or uses proportional fonts, as the normal may yield a matrix which is too small. */ -- 2.39.2