aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-06-01 07:41:03 +0400
committerDmitry Antipov2012-06-01 07:41:03 +0400
commitc98ff5dd439c0018b34a5e84f2a3ccc00ee444ef (patch)
treea8f1d45b19ca87d91dddfd67f1d3e29958d1766b /src/window.c
parentb691b884eeef2ecb8772ac121ab23136b9d9d0d2 (diff)
downloademacs-c98ff5dd439c0018b34a5e84f2a3ccc00ee444ef.tar.gz
emacs-c98ff5dd439c0018b34a5e84f2a3ccc00ee444ef.zip
For a 'struct window', replace some Lisp_Object fields to
bitfields where appropriate, remove unused fields. * window.h (struct window): Remove unused 'last_mark_x' and 'last_mark_y' fields. Rename 'mini_p' field to 'mini', change it's type from Lisp_Object to bitfield. Change type of 'force_start', 'optional_new_start', 'last_had_star', 'update_mode_line' and 'start_at_line_beg' fields from Lisp_Object to bitfield. Adjust users accordingly.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/src/window.c b/src/window.c
index 37bcf64181a..54ad0af4c3f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1393,10 +1393,10 @@ overriding motion of point in order to display at this exact start. */)
1393 CHECK_NUMBER_COERCE_MARKER (pos); 1393 CHECK_NUMBER_COERCE_MARKER (pos);
1394 set_marker_restricted (w->start, pos, w->buffer); 1394 set_marker_restricted (w->start, pos, w->buffer);
1395 /* this is not right, but much easier than doing what is right. */ 1395 /* this is not right, but much easier than doing what is right. */
1396 w->start_at_line_beg = Qnil; 1396 w->start_at_line_beg = 0;
1397 if (NILP (noforce)) 1397 if (NILP (noforce))
1398 w->force_start = Qt; 1398 w->force_start = 1;
1399 w->update_mode_line = Qt; 1399 w->update_mode_line = 1;
1400 XSETFASTINT (w->last_modified, 0); 1400 XSETFASTINT (w->last_modified, 0);
1401 XSETFASTINT (w->last_overlay_modified, 0); 1401 XSETFASTINT (w->last_overlay_modified, 0);
1402 if (!EQ (window, selected_window)) 1402 if (!EQ (window, selected_window))
@@ -2472,7 +2472,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame
2472 if (EQ (w->buffer, obj)) 2472 if (EQ (w->buffer, obj))
2473 { 2473 {
2474 mark_window_display_accurate (window, 0); 2474 mark_window_display_accurate (window, 0);
2475 w->update_mode_line = Qt; 2475 w->update_mode_line = 1;
2476 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; 2476 XBUFFER (obj)->prevent_redisplay_optimizations_p = 1;
2477 ++update_mode_lines; 2477 ++update_mode_lines;
2478 best_window = window; 2478 best_window = window;
@@ -2771,12 +2771,11 @@ window-start value is reasonable when this function is called. */)
2771 2771
2772 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); 2772 set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos);
2773 w->window_end_valid = Qnil; 2773 w->window_end_valid = Qnil;
2774 w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE 2774 w->start_at_line_beg = (pos.bytepos == BEGV_BYTE
2775 || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt 2775 || FETCH_BYTE (pos.bytepos - 1) == '\n');
2776 : Qnil);
2777 /* We need to do this, so that the window-scroll-functions 2776 /* We need to do this, so that the window-scroll-functions
2778 get called. */ 2777 get called. */
2779 w->optional_new_start = Qt; 2778 w->optional_new_start = 1;
2780 2779
2781 set_buffer_internal (obuf); 2780 set_buffer_internal (obuf);
2782 } 2781 }
@@ -3006,8 +3005,8 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int
3006 set_marker_restricted (w->start, 3005 set_marker_restricted (w->start,
3007 make_number (b->last_window_start), 3006 make_number (b->last_window_start),
3008 buffer); 3007 buffer);
3009 w->start_at_line_beg = Qnil; 3008 w->start_at_line_beg = 0;
3010 w->force_start = Qnil; 3009 w->force_start = 0;
3011 XSETFASTINT (w->last_modified, 0); 3010 XSETFASTINT (w->last_modified, 0);
3012 XSETFASTINT (w->last_overlay_modified, 0); 3011 XSETFASTINT (w->last_overlay_modified, 0);
3013 } 3012 }
@@ -3143,7 +3142,7 @@ displaying that buffer. */)
3143 { 3142 {
3144 struct window *w = XWINDOW (object); 3143 struct window *w = XWINDOW (object);
3145 mark_window_display_accurate (object, 0); 3144 mark_window_display_accurate (object, 0);
3146 w->update_mode_line = Qt; 3145 w->update_mode_line = 1;
3147 if (BUFFERP (w->buffer)) 3146 if (BUFFERP (w->buffer))
3148 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; 3147 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1;
3149 ++update_mode_lines; 3148 ++update_mode_lines;
@@ -3275,7 +3274,8 @@ make_window (void)
3275 3274
3276 w = allocate_window (); 3275 w = allocate_window ();
3277 /* Initialize all Lisp data. */ 3276 /* Initialize all Lisp data. */
3278 w->frame = w->mini_p = Qnil; 3277 w->frame = Qnil;
3278 w->mini = 0;
3279 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil; 3279 w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil;
3280 XSETFASTINT (w->left_col, 0); 3280 XSETFASTINT (w->left_col, 0);
3281 XSETFASTINT (w->top_line, 0); 3281 XSETFASTINT (w->top_line, 0);
@@ -3288,7 +3288,7 @@ make_window (void)
3288 w->buffer = Qnil; 3288 w->buffer = Qnil;
3289 w->start = Fmake_marker (); 3289 w->start = Fmake_marker ();
3290 w->pointm = Fmake_marker (); 3290 w->pointm = Fmake_marker ();
3291 w->force_start = w->optional_new_start = Qnil; 3291 w->force_start = w->optional_new_start = 0;
3292 XSETFASTINT (w->hscroll, 0); 3292 XSETFASTINT (w->hscroll, 0);
3293 XSETFASTINT (w->min_hscroll, 0); 3293 XSETFASTINT (w->min_hscroll, 0);
3294 XSETFASTINT (w->use_time, 0); 3294 XSETFASTINT (w->use_time, 0);
@@ -3296,17 +3296,18 @@ make_window (void)
3296 XSETFASTINT (w->sequence_number, sequence_number); 3296 XSETFASTINT (w->sequence_number, sequence_number);
3297 w->temslot = w->last_modified = w->last_overlay_modified = Qnil; 3297 w->temslot = w->last_modified = w->last_overlay_modified = Qnil;
3298 XSETFASTINT (w->last_point, 0); 3298 XSETFASTINT (w->last_point, 0);
3299 w->last_had_star = w->vertical_scroll_bar = Qnil; 3299 w->last_had_star = 0;
3300 w->vertical_scroll_bar = Qnil;
3300 w->left_margin_cols = w->right_margin_cols = Qnil; 3301 w->left_margin_cols = w->right_margin_cols = Qnil;
3301 w->left_fringe_width = w->right_fringe_width = Qnil; 3302 w->left_fringe_width = w->right_fringe_width = Qnil;
3302 w->fringes_outside_margins = Qnil; 3303 w->fringes_outside_margins = Qnil;
3303 w->scroll_bar_width = Qnil; 3304 w->scroll_bar_width = Qnil;
3304 w->vertical_scroll_bar_type = Qt; 3305 w->vertical_scroll_bar_type = Qt;
3305 w->last_mark_x = w->last_mark_y = Qnil;
3306 XSETFASTINT (w->window_end_pos, 0); 3306 XSETFASTINT (w->window_end_pos, 0);
3307 XSETFASTINT (w->window_end_vpos, 0); 3307 XSETFASTINT (w->window_end_vpos, 0);
3308 w->window_end_valid = w->update_mode_line = Qnil; 3308 w->window_end_valid = w->display_table = Qnil;
3309 w->start_at_line_beg = w->display_table = w->dedicated = Qnil; 3309 w->update_mode_line = w->start_at_line_beg = 0;
3310 w->dedicated = Qnil;
3310 w->base_line_number = w->base_line_pos = w->region_showing = Qnil; 3311 w->base_line_number = w->base_line_pos = w->region_showing = Qnil;
3311 w->column_number_displayed = w->redisplay_end_trigger = Qnil; 3312 w->column_number_displayed = w->redisplay_end_trigger = Qnil;
3312 w->combination_limit = w->window_parameters = Qnil; 3313 w->combination_limit = w->window_parameters = Qnil;
@@ -4305,13 +4306,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4305 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); 4306 spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV);
4306 set_marker_restricted (w->start, make_number (spos), 4307 set_marker_restricted (w->start, make_number (spos),
4307 w->buffer); 4308 w->buffer);
4308 w->start_at_line_beg = Qt; 4309 w->start_at_line_beg = 1;
4309 w->update_mode_line = Qt; 4310 w->update_mode_line = 1;
4310 XSETFASTINT (w->last_modified, 0); 4311 XSETFASTINT (w->last_modified, 0);
4311 XSETFASTINT (w->last_overlay_modified, 0); 4312 XSETFASTINT (w->last_overlay_modified, 0);
4312 /* Set force_start so that redisplay_window will run the 4313 /* Set force_start so that redisplay_window will run the
4313 window-scroll-functions. */ 4314 window-scroll-functions. */
4314 w->force_start = Qt; 4315 w->force_start = 1;
4315 return; 4316 return;
4316 } 4317 }
4317 } 4318 }
@@ -4451,14 +4452,13 @@ window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror)
4451 set_marker_restricted (w->start, make_number (pos), 4452 set_marker_restricted (w->start, make_number (pos),
4452 w->buffer); 4453 w->buffer);
4453 bytepos = XMARKER (w->start)->bytepos; 4454 bytepos = XMARKER (w->start)->bytepos;
4454 w->start_at_line_beg = ((pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n') 4455 w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n');
4455 ? Qt : Qnil); 4456 w->update_mode_line = 1;
4456 w->update_mode_line = Qt;
4457 XSETFASTINT (w->last_modified, 0); 4457 XSETFASTINT (w->last_modified, 0);
4458 XSETFASTINT (w->last_overlay_modified, 0); 4458 XSETFASTINT (w->last_overlay_modified, 0);
4459 /* Set force_start so that redisplay_window will run the 4459 /* Set force_start so that redisplay_window will run the
4460 window-scroll-functions. */ 4460 window-scroll-functions. */
4461 w->force_start = Qt; 4461 w->force_start = 1;
4462 } 4462 }
4463 4463
4464 /* The rest of this function uses current_y in a nonstandard way, 4464 /* The rest of this function uses current_y in a nonstandard way,
@@ -4651,13 +4651,13 @@ window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror)
4651 max (0, min (scroll_margin, XINT (w->total_lines) / 4)); 4651 max (0, min (scroll_margin, XINT (w->total_lines) / 4));
4652 4652
4653 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); 4653 set_marker_restricted_both (w->start, w->buffer, pos, pos_byte);
4654 w->start_at_line_beg = bolp; 4654 w->start_at_line_beg = !NILP (bolp);
4655 w->update_mode_line = Qt; 4655 w->update_mode_line = 1;
4656 XSETFASTINT (w->last_modified, 0); 4656 XSETFASTINT (w->last_modified, 0);
4657 XSETFASTINT (w->last_overlay_modified, 0); 4657 XSETFASTINT (w->last_overlay_modified, 0);
4658 /* Set force_start so that redisplay_window will run 4658 /* Set force_start so that redisplay_window will run
4659 the window-scroll-functions. */ 4659 the window-scroll-functions. */
4660 w->force_start = Qt; 4660 w->force_start = 1;
4661 4661
4662 if (!NILP (Vscroll_preserve_screen_position) 4662 if (!NILP (Vscroll_preserve_screen_position)
4663 && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) 4663 && (whole || !EQ (Vscroll_preserve_screen_position, Qt)))
@@ -5201,12 +5201,10 @@ and redisplay normally--don't erase and redraw the frame. */)
5201 set_marker_both (w->start, w->buffer, charpos, bytepos); 5201 set_marker_both (w->start, w->buffer, charpos, bytepos);
5202 w->window_end_valid = Qnil; 5202 w->window_end_valid = Qnil;
5203 5203
5204 w->optional_new_start = Qt; 5204 w->optional_new_start = 1;
5205 5205
5206 if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n') 5206 w->start_at_line_beg = (bytepos == BEGV_BYTE ||
5207 w->start_at_line_beg = Qt; 5207 FETCH_BYTE (bytepos - 1) == '\n');
5208 else
5209 w->start_at_line_beg = Qnil;
5210 5208
5211 set_buffer_internal (obuf); 5209 set_buffer_internal (obuf);
5212 return Qnil; 5210 return Qnil;
@@ -5257,8 +5255,8 @@ zero means top of window, negative means relative to bottom of window. */)
5257 int height = window_internal_height (w); 5255 int height = window_internal_height (w);
5258 Fvertical_motion (make_number (- (height / 2)), window); 5256 Fvertical_motion (make_number (- (height / 2)), window);
5259 set_marker_both (w->start, w->buffer, PT, PT_BYTE); 5257 set_marker_both (w->start, w->buffer, PT, PT_BYTE);
5260 w->start_at_line_beg = Fbolp (); 5258 w->start_at_line_beg = !NILP (Fbolp ());
5261 w->force_start = Qt; 5259 w->force_start = 1;
5262 } 5260 }
5263 else 5261 else
5264 Fgoto_char (w->start); 5262 Fgoto_char (w->start);
@@ -5607,7 +5605,7 @@ the return value is nil. Otherwise the value is t. */)
5607 /* If saved buffer is alive, install it. */ 5605 /* If saved buffer is alive, install it. */
5608 { 5606 {
5609 w->buffer = p->buffer; 5607 w->buffer = p->buffer;
5610 w->start_at_line_beg = p->start_at_line_beg; 5608 w->start_at_line_beg = !NILP (p->start_at_line_beg);
5611 set_marker_restricted (w->start, p->start, w->buffer); 5609 set_marker_restricted (w->start, p->start, w->buffer);
5612 set_marker_restricted (w->pointm, p->pointm, w->buffer); 5610 set_marker_restricted (w->pointm, p->pointm, w->buffer);
5613 Fset_marker (BVAR (XBUFFER (w->buffer), mark), 5611 Fset_marker (BVAR (XBUFFER (w->buffer), mark),
@@ -5632,7 +5630,7 @@ the return value is nil. Otherwise the value is t. */)
5632 set_marker_restricted_both (w->pointm, w->buffer, 5630 set_marker_restricted_both (w->pointm, w->buffer,
5633 BUF_PT (XBUFFER (w->buffer)), 5631 BUF_PT (XBUFFER (w->buffer)),
5634 BUF_PT_BYTE (XBUFFER (w->buffer))); 5632 BUF_PT_BYTE (XBUFFER (w->buffer)));
5635 w->start_at_line_beg = Qt; 5633 w->start_at_line_beg = 1;
5636 } 5634 }
5637 else if (STRINGP (auto_buffer_name = 5635 else if (STRINGP (auto_buffer_name =
5638 Fwindow_parameter (window, Qauto_buffer_name)) 5636 Fwindow_parameter (window, Qauto_buffer_name))
@@ -5641,7 +5639,7 @@ the return value is nil. Otherwise the value is t. */)
5641 { 5639 {
5642 set_marker_restricted (w->start, make_number (0), w->buffer); 5640 set_marker_restricted (w->start, make_number (0), w->buffer);
5643 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5641 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5644 w->start_at_line_beg = Qt; 5642 w->start_at_line_beg = 1;
5645 } 5643 }
5646 else 5644 else
5647 /* Window has no live buffer, get one. */ 5645 /* Window has no live buffer, get one. */
@@ -5655,7 +5653,7 @@ the return value is nil. Otherwise the value is t. */)
5655 range. */ 5653 range. */
5656 set_marker_restricted (w->start, make_number (0), w->buffer); 5654 set_marker_restricted (w->start, make_number (0), w->buffer);
5657 set_marker_restricted (w->pointm, make_number (0), w->buffer); 5655 set_marker_restricted (w->pointm, make_number (0), w->buffer);
5658 w->start_at_line_beg = Qt; 5656 w->start_at_line_beg = 1;
5659 if (!NILP (w->dedicated)) 5657 if (!NILP (w->dedicated))
5660 /* Record this window as dead. */ 5658 /* Record this window as dead. */
5661 dead_windows = Fcons (window, dead_windows); 5659 dead_windows = Fcons (window, dead_windows);
@@ -5956,7 +5954,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i)
5956 = !NILP (Vwindow_point_insertion_type); 5954 = !NILP (Vwindow_point_insertion_type);
5957 5955
5958 p->start = Fcopy_marker (w->start, Qnil); 5956 p->start = Fcopy_marker (w->start, Qnil);
5959 p->start_at_line_beg = w->start_at_line_beg; 5957 p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil;
5960 5958
5961 tem = BVAR (XBUFFER (w->buffer), mark); 5959 tem = BVAR (XBUFFER (w->buffer), mark);
5962 p->mark = Fcopy_marker (tem, Qnil); 5960 p->mark = Fcopy_marker (tem, Qnil);