diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/window.c b/src/window.c index 24c316e4395..4a4cc701fcf 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -244,6 +244,7 @@ make_window () | |||
| 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 (); |
| @@ -417,17 +418,19 @@ 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 | ||
| @@ -2608,6 +2611,7 @@ set_window_buffer (window, buffer, run_hooks_p) | |||
| 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), |
| @@ -3087,6 +3091,7 @@ temp_output_buffer_show (buf) | |||
| 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 | ||
| @@ -4620,20 +4625,21 @@ struct save_window_data | |||
| 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)]))) |
| @@ -4825,6 +4831,7 @@ the return value is nil. Otherwise the value is t.") | |||
| 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; |
| @@ -5092,6 +5099,7 @@ save_window_save (window, vector, i) | |||
| 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; |
| @@ -5520,6 +5528,8 @@ compare_window_configurations (c1, c2, ignore_positions) | |||
| 5520 | { | 5528 | { |
| 5521 | if (! EQ (p1->hscroll, p2->hscroll)) | 5529 | if (! EQ (p1->hscroll, p2->hscroll)) |
| 5522 | return 0; | 5530 | return 0; |
| 5531 | if (!EQ (p1->min_hscroll, p2->min_hscroll)) | ||
| 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))) |