Mercurial > emacs
comparison src/window.c @ 34747:b17790c2efbf
(make_window): Initialize window's min_hscroll.
(Fset_window_hscroll): Set window's hscroll and min_hscroll.
(set_window_buffer, temp_output_buffer_show): Set min_hscroll
to zero.
(struct saved_window): New member min_hscroll.
(SAVED_WINDOW_VECTOR_SIZE): Set to 17.
(Fset_window_configuration): Set window's min_hscroll.
(save_window_save): Save window's min_hscroll.
(compare_window_configurations): Compare min_hscroll values.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 20 Dec 2000 15:36:29 +0000 |
parents | 2d590f9a5d31 |
children | a9b2c624a8a2 |
comparison
equal
deleted
inserted
replaced
34746:10539ef3d8e8 | 34747:b17790c2efbf |
---|---|
242 XSETFASTINT (p->left, 0); | 242 XSETFASTINT (p->left, 0); |
243 XSETFASTINT (p->top, 0); | 243 XSETFASTINT (p->top, 0); |
244 XSETFASTINT (p->height, 0); | 244 XSETFASTINT (p->height, 0); |
245 XSETFASTINT (p->width, 0); | 245 XSETFASTINT (p->width, 0); |
246 XSETFASTINT (p->hscroll, 0); | 246 XSETFASTINT (p->hscroll, 0); |
247 XSETFASTINT (p->min_hscroll, 0); | |
247 p->orig_top = p->orig_height = Qnil; | 248 p->orig_top = p->orig_height = Qnil; |
248 p->start = Fmake_marker (); | 249 p->start = Fmake_marker (); |
249 p->pointm = Fmake_marker (); | 250 p->pointm = Fmake_marker (); |
250 XSETFASTINT (p->use_time, 0); | 251 XSETFASTINT (p->use_time, 0); |
251 p->frame = Qnil; | 252 p->frame = Qnil; |
415 | 416 |
416 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, | 417 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, |
417 "Set number of columns WINDOW is scrolled from left margin to NCOL.\n\ | 418 "Set number of columns WINDOW is scrolled from left margin to NCOL.\n\ |
418 NCOL should be zero or positive.") | 419 NCOL should be zero or positive.") |
419 (window, ncol) | 420 (window, ncol) |
420 register Lisp_Object window, ncol; | 421 Lisp_Object window, ncol; |
421 { | 422 { |
422 register struct window *w; | 423 struct window *w = decode_window (window); |
424 int hscroll; | |
423 | 425 |
424 CHECK_NUMBER (ncol, 1); | 426 CHECK_NUMBER (ncol, 1); |
425 if (XINT (ncol) < 0) XSETFASTINT (ncol, 0); | 427 hscroll = max (0, XINT (ncol)); |
426 w = decode_window (window); | 428 |
427 if (XINT (w->hscroll) != XINT (ncol)) | 429 /* Prevent redisplay shortcuts when changing the hscroll. */ |
428 /* Prevent redisplay shortcuts */ | 430 if (XINT (w->hscroll) != hscroll) |
429 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; | 431 XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; |
430 w->hscroll = ncol; | 432 |
433 w->hscroll = w->min_hscroll = make_number (hscroll); | |
431 return ncol; | 434 return ncol; |
432 } | 435 } |
433 | 436 |
434 DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, | 437 DEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, |
435 Swindow_redisplay_end_trigger, 0, 1, 0, | 438 Swindow_redisplay_end_trigger, 0, 1, 0, |
2606 XSETFASTINT (w->window_end_pos, 0); | 2609 XSETFASTINT (w->window_end_pos, 0); |
2607 XSETFASTINT (w->window_end_vpos, 0); | 2610 XSETFASTINT (w->window_end_vpos, 0); |
2608 bzero (&w->last_cursor, sizeof w->last_cursor); | 2611 bzero (&w->last_cursor, sizeof w->last_cursor); |
2609 w->window_end_valid = Qnil; | 2612 w->window_end_valid = Qnil; |
2610 XSETFASTINT (w->hscroll, 0); | 2613 XSETFASTINT (w->hscroll, 0); |
2614 XSETFASTINT (w->min_hscroll, 0); | |
2611 set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); | 2615 set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); |
2612 set_marker_restricted (w->start, | 2616 set_marker_restricted (w->start, |
2613 make_number (b->last_window_start), | 2617 make_number (b->last_window_start), |
2614 buffer); | 2618 buffer); |
2615 w->start_at_line_beg = Qnil; | 2619 w->start_at_line_beg = Qnil; |
3085 if (!EQ (XWINDOW (window)->frame, selected_frame)) | 3089 if (!EQ (XWINDOW (window)->frame, selected_frame)) |
3086 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); | 3090 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (window))); |
3087 Vminibuf_scroll_window = window; | 3091 Vminibuf_scroll_window = window; |
3088 w = XWINDOW (window); | 3092 w = XWINDOW (window); |
3089 XSETFASTINT (w->hscroll, 0); | 3093 XSETFASTINT (w->hscroll, 0); |
3094 XSETFASTINT (w->min_hscroll, 0); | |
3090 set_marker_restricted_both (w->start, buf, 1, 1); | 3095 set_marker_restricted_both (w->start, buf, 1, 1); |
3091 set_marker_restricted_both (w->pointm, buf, 1, 1); | 3096 set_marker_restricted_both (w->pointm, buf, 1, 1); |
3092 | 3097 |
3093 /* Run temp-buffer-show-hook, with the chosen window selected | 3098 /* Run temp-buffer-show-hook, with the chosen window selected |
3094 and it sbuffer current. */ | 3099 and it sbuffer current. */ |
4618 Lisp_Object saved_windows; | 4623 Lisp_Object saved_windows; |
4619 }; | 4624 }; |
4620 | 4625 |
4621 /* This is saved as a Lisp_Vector */ | 4626 /* This is saved as a Lisp_Vector */ |
4622 struct saved_window | 4627 struct saved_window |
4623 { | 4628 { |
4624 /* these first two must agree with struct Lisp_Vector in lisp.h */ | 4629 /* these first two must agree with struct Lisp_Vector in lisp.h */ |
4625 EMACS_INT size_from_Lisp_Vector_struct; | 4630 EMACS_INT size_from_Lisp_Vector_struct; |
4626 struct Lisp_Vector *next_from_Lisp_Vector_struct; | 4631 struct Lisp_Vector *next_from_Lisp_Vector_struct; |
4627 | 4632 |
4628 Lisp_Object window; | 4633 Lisp_Object window; |
4629 Lisp_Object buffer, start, pointm, mark; | 4634 Lisp_Object buffer, start, pointm, mark; |
4630 Lisp_Object left, top, width, height, hscroll; | 4635 Lisp_Object left, top, width, height, hscroll, min_hscroll; |
4631 Lisp_Object parent, prev; | 4636 Lisp_Object parent, prev; |
4632 Lisp_Object start_at_line_beg; | 4637 Lisp_Object start_at_line_beg; |
4633 Lisp_Object display_table; | 4638 Lisp_Object display_table; |
4634 Lisp_Object orig_top, orig_height; | 4639 Lisp_Object orig_top, orig_height; |
4635 }; | 4640 }; |
4636 #define SAVED_WINDOW_VECTOR_SIZE 16 /* Arg to Fmake_vector */ | 4641 |
4642 #define SAVED_WINDOW_VECTOR_SIZE 17 /* Arg to Fmake_vector */ | |
4637 | 4643 |
4638 #define SAVED_WINDOW_N(swv,n) \ | 4644 #define SAVED_WINDOW_N(swv,n) \ |
4639 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) | 4645 ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) |
4640 | 4646 |
4641 DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, | 4647 DEFUN ("window-configuration-p", Fwindow_configuration_p, Swindow_configuration_p, 1, 1, 0, |
4823 w->left = p->left; | 4829 w->left = p->left; |
4824 w->top = p->top; | 4830 w->top = p->top; |
4825 w->width = p->width; | 4831 w->width = p->width; |
4826 w->height = p->height; | 4832 w->height = p->height; |
4827 w->hscroll = p->hscroll; | 4833 w->hscroll = p->hscroll; |
4834 w->min_hscroll = p->min_hscroll; | |
4828 w->display_table = p->display_table; | 4835 w->display_table = p->display_table; |
4829 w->orig_top = p->orig_top; | 4836 w->orig_top = p->orig_top; |
4830 w->orig_height = p->orig_height; | 4837 w->orig_height = p->orig_height; |
4831 XSETFASTINT (w->last_modified, 0); | 4838 XSETFASTINT (w->last_modified, 0); |
4832 XSETFASTINT (w->last_overlay_modified, 0); | 4839 XSETFASTINT (w->last_overlay_modified, 0); |
5090 p->left = w->left; | 5097 p->left = w->left; |
5091 p->top = w->top; | 5098 p->top = w->top; |
5092 p->width = w->width; | 5099 p->width = w->width; |
5093 p->height = w->height; | 5100 p->height = w->height; |
5094 p->hscroll = w->hscroll; | 5101 p->hscroll = w->hscroll; |
5102 p->min_hscroll = w->min_hscroll; | |
5095 p->display_table = w->display_table; | 5103 p->display_table = w->display_table; |
5096 p->orig_top = w->orig_top; | 5104 p->orig_top = w->orig_top; |
5097 p->orig_height = w->orig_height; | 5105 p->orig_height = w->orig_height; |
5098 if (!NILP (w->buffer)) | 5106 if (!NILP (w->buffer)) |
5099 { | 5107 { |
5517 if (! EQ (p1->prev, p2->prev)) | 5525 if (! EQ (p1->prev, p2->prev)) |
5518 return 0; | 5526 return 0; |
5519 if (! ignore_positions) | 5527 if (! ignore_positions) |
5520 { | 5528 { |
5521 if (! EQ (p1->hscroll, p2->hscroll)) | 5529 if (! EQ (p1->hscroll, p2->hscroll)) |
5530 return 0; | |
5531 if (!EQ (p1->min_hscroll, p2->min_hscroll)) | |
5522 return 0; | 5532 return 0; |
5523 if (! EQ (p1->start_at_line_beg, p2->start_at_line_beg)) | 5533 if (! EQ (p1->start_at_line_beg, p2->start_at_line_beg)) |
5524 return 0; | 5534 return 0; |
5525 if (NILP (Fequal (p1->start, p2->start))) | 5535 if (NILP (Fequal (p1->start, p2->start))) |
5526 return 0; | 5536 return 0; |