comparison src/redisplay.c @ 276:6330739388db r21-0b36

Import from CVS: tag r21-0b36
author cvs
date Mon, 13 Aug 2007 10:30:37 +0200
parents ca9a9ec9c1c1
children 7df0dd720c89
comparison
equal deleted inserted replaced
275:a68ae4439f57 276:6330739388db
5477 { 5477 {
5478 struct window *w = XWINDOW (window); 5478 struct window *w = XWINDOW (window);
5479 struct frame *f = XFRAME (w->frame); 5479 struct frame *f = XFRAME (w->frame);
5480 struct device *d = XDEVICE (f->device); 5480 struct device *d = XDEVICE (f->device);
5481 Lisp_Object old_buffer = w->buffer; 5481 Lisp_Object old_buffer = w->buffer;
5482 Lisp_Object the_buffer = w->buffer;
5482 struct buffer *b; 5483 struct buffer *b;
5483 int echo_active = 0; 5484 int echo_active = 0;
5484 int startp = 1; 5485 int startp = 1;
5485 int pointm; 5486 int pointm;
5487 int old_startp = 1;
5488 int old_pointm = 1;
5486 int selected_in_its_frame; 5489 int selected_in_its_frame;
5487 int selected_globally; 5490 int selected_globally;
5488 int skip_output = 0; 5491 int skip_output = 0;
5489 int truncation_changed; 5492 int truncation_changed;
5490 int inactive_minibuffer = 5493 int inactive_minibuffer =
5524 if (NILP (w->buffer)) 5527 if (NILP (w->buffer))
5525 return; 5528 return;
5526 5529
5527 if (MINI_WINDOW_P (w) && echo_area_active (f)) 5530 if (MINI_WINDOW_P (w) && echo_area_active (f))
5528 { 5531 {
5529 w->buffer = Vecho_area_buffer; 5532 w->buffer = the_buffer = Vecho_area_buffer;
5530 echo_active = 1; 5533 echo_active = 1;
5531 } 5534 }
5532 5535
5533 b = XBUFFER (w->buffer); 5536 b = XBUFFER (w->buffer);
5534 5537
5535 if (echo_active) 5538 if (echo_active)
5536 pointm = 1; 5539 {
5540 old_pointm = selected_globally
5541 ? BUF_PT (b)
5542 : marker_position (w->pointm[CURRENT_DISP]);
5543 pointm = 1;
5544 }
5537 else 5545 else
5538 { 5546 {
5539 if (selected_globally) 5547 if (selected_globally)
5540 { 5548 {
5541 pointm = BUF_PT (b); 5549 pointm = BUF_PT (b);
5548 pointm = BUF_BEGV (b); 5556 pointm = BUF_BEGV (b);
5549 else if (pointm > BUF_ZV (b)) 5557 else if (pointm > BUF_ZV (b))
5550 pointm = BUF_ZV (b); 5558 pointm = BUF_ZV (b);
5551 } 5559 }
5552 } 5560 }
5553 Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), old_buffer); 5561 Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), the_buffer);
5554 5562
5555 /* If the buffer has changed we have to invalid all of our face 5563 /* If the buffer has changed we have to invalid all of our face
5556 cache elements. */ 5564 cache elements. */
5557 if ((!echo_active && b != window_display_buffer (w)) 5565 if ((!echo_active && b != window_display_buffer (w))
5558 || !Dynarr_length (w->face_cachels) 5566 || !Dynarr_length (w->face_cachels)
5578 5586
5579 goto regeneration_done; 5587 goto regeneration_done;
5580 } 5588 }
5581 5589
5582 if (echo_active) 5590 if (echo_active)
5583 startp = 1; 5591 {
5592 old_startp = marker_position (w->start[CURRENT_DISP]);
5593 startp = 1;
5594 }
5584 else 5595 else
5585 { 5596 {
5586 startp = marker_position (w->start[CURRENT_DISP]); 5597 startp = marker_position (w->start[CURRENT_DISP]);
5587 if (startp < BUF_BEGV (b)) 5598 if (startp < BUF_BEGV (b))
5588 startp = BUF_BEGV (b); 5599 startp = BUF_BEGV (b);
5589 else if (startp > BUF_ZV (b)) 5600 else if (startp > BUF_ZV (b))
5590 startp = BUF_ZV (b); 5601 startp = BUF_ZV (b);
5591 } 5602 }
5592 Fset_marker (w->start[DESIRED_DISP], make_int (startp), old_buffer); 5603 Fset_marker (w->start[DESIRED_DISP], make_int (startp), the_buffer);
5593 5604
5594 truncation_changed = (find_window_mirror (w)->truncate_win != 5605 truncation_changed = (find_window_mirror (w)->truncate_win !=
5595 window_truncation_on (w)); 5606 window_truncation_on (w));
5596 5607
5597 /* If w->force_start is set, then some function set w->start and we 5608 /* If w->force_start is set, then some function set w->start and we
5611 5622
5612 if (selected_globally) 5623 if (selected_globally)
5613 BUF_SET_PT (b, pointm); 5624 BUF_SET_PT (b, pointm);
5614 5625
5615 Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm), 5626 Fset_marker (w->pointm[DESIRED_DISP], make_int (pointm),
5616 old_buffer); 5627 the_buffer);
5617 5628
5618 /* #### BUFU amounts of overkil just to get the cursor 5629 /* #### BUFU amounts of overkil just to get the cursor
5619 location marked properly. FIX ME FIX ME FIX ME */ 5630 location marked properly. FIX ME FIX ME FIX ME */
5620 regenerate_window (w, startp, pointm, DESIRED_DISP); 5631 regenerate_window (w, startp, pointm, DESIRED_DISP);
5621 } 5632 }
5777 Dynarr_reset (cla); 5788 Dynarr_reset (cla);
5778 } 5789 }
5779 5790
5780 /* Must do this before calling redisplay_output_window because it 5791 /* Must do this before calling redisplay_output_window because it
5781 sets some markers on the window. */ 5792 sets some markers on the window. */
5782 if (MINI_WINDOW_P (w) && echo_area_active (f)) 5793 if (echo_active)
5783 w->buffer = old_buffer; 5794 {
5795 w->buffer = old_buffer;
5796 Fset_marker (w->pointm[DESIRED_DISP], make_int (old_pointm), old_buffer);
5797 Fset_marker (w->start[DESIRED_DISP], make_int (old_startp), old_buffer);
5798 }
5784 5799
5785 /* These also have to be set before calling redisplay_output_window 5800 /* These also have to be set before calling redisplay_output_window
5786 since it sets the CURRENT_DISP values based on them. */ 5801 since it sets the CURRENT_DISP values based on them. */
5787 w->last_modified[DESIRED_DISP] = make_int (BUF_MODIFF (b)); 5802 w->last_modified[DESIRED_DISP] = make_int (BUF_MODIFF (b));
5788 w->last_facechange[DESIRED_DISP] = make_int (BUF_FACECHANGE (b)); 5803 w->last_facechange[DESIRED_DISP] = make_int (BUF_FACECHANGE (b));
6264 : marker_position (w->pointm[type])); 6279 : marker_position (w->pointm[type]));
6265 EMACS_INT line; 6280 EMACS_INT line;
6266 6281
6267 line = buffer_line_number (b, pos, 1); 6282 line = buffer_line_number (b, pos, 1);
6268 6283
6269 sprintf (window_line_number_buf, "%ld", (long)(line + 1)); 6284 long_to_string (window_line_number_buf, line + 1);
6270 6285
6271 return window_line_number_buf; 6286 return window_line_number_buf;
6272 } 6287 }
6273 6288
6274 6289
6314 temp /= 10; 6329 temp /= 10;
6315 size++; 6330 size++;
6316 } 6331 }
6317 6332
6318 buf = alloca_array (char, size); 6333 buf = alloca_array (char, size);
6319 sprintf (buf, "%d", col); 6334 long_to_string (buf, col);
6320 6335
6321 Dynarr_add_many (mode_spec_bufbyte_string, 6336 Dynarr_add_many (mode_spec_bufbyte_string,
6322 (CONST Bufbyte *) buf, strlen (buf)); 6337 (CONST Bufbyte *) buf, strlen (buf));
6323 6338
6324 goto decode_mode_spec_done; 6339 goto decode_mode_spec_done;