From: Gerd Moellmann Date: Wed, 20 Dec 2000 15:36:29 +0000 (+0000) Subject: (make_window): Initialize window's min_hscroll. X-Git-Tag: emacs-pretest-21.0.95~377 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ea68264b3a95bb010cbfb6a5724d797caef07b48;p=emacs.git (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. --- 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 () XSETFASTINT (p->height, 0); XSETFASTINT (p->width, 0); XSETFASTINT (p->hscroll, 0); + XSETFASTINT (p->min_hscroll, 0); p->orig_top = p->orig_height = Qnil; p->start = Fmake_marker (); p->pointm = Fmake_marker (); @@ -417,17 +418,19 @@ DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0, "Set number of columns WINDOW is scrolled from left margin to NCOL.\n\ NCOL should be zero or positive.") (window, ncol) - register Lisp_Object window, ncol; + Lisp_Object window, ncol; { - register struct window *w; + struct window *w = decode_window (window); + int hscroll; CHECK_NUMBER (ncol, 1); - if (XINT (ncol) < 0) XSETFASTINT (ncol, 0); - w = decode_window (window); - if (XINT (w->hscroll) != XINT (ncol)) - /* Prevent redisplay shortcuts */ + hscroll = max (0, XINT (ncol)); + + /* Prevent redisplay shortcuts when changing the hscroll. */ + if (XINT (w->hscroll) != hscroll) XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; - w->hscroll = ncol; + + w->hscroll = w->min_hscroll = make_number (hscroll); return ncol; } @@ -2608,6 +2611,7 @@ set_window_buffer (window, buffer, run_hooks_p) bzero (&w->last_cursor, sizeof w->last_cursor); w->window_end_valid = Qnil; XSETFASTINT (w->hscroll, 0); + XSETFASTINT (w->min_hscroll, 0); set_marker_both (w->pointm, buffer, BUF_PT (b), BUF_PT_BYTE (b)); set_marker_restricted (w->start, make_number (b->last_window_start), @@ -3087,6 +3091,7 @@ temp_output_buffer_show (buf) Vminibuf_scroll_window = window; w = XWINDOW (window); XSETFASTINT (w->hscroll, 0); + XSETFASTINT (w->min_hscroll, 0); set_marker_restricted_both (w->start, buf, 1, 1); set_marker_restricted_both (w->pointm, buf, 1, 1); @@ -4620,20 +4625,21 @@ struct save_window_data /* This is saved as a Lisp_Vector */ struct saved_window - { - /* these first two must agree with struct Lisp_Vector in lisp.h */ - EMACS_INT size_from_Lisp_Vector_struct; - struct Lisp_Vector *next_from_Lisp_Vector_struct; +{ + /* these first two must agree with struct Lisp_Vector in lisp.h */ + EMACS_INT size_from_Lisp_Vector_struct; + struct Lisp_Vector *next_from_Lisp_Vector_struct; - Lisp_Object window; - Lisp_Object buffer, start, pointm, mark; - Lisp_Object left, top, width, height, hscroll; - Lisp_Object parent, prev; - Lisp_Object start_at_line_beg; - Lisp_Object display_table; - Lisp_Object orig_top, orig_height; - }; -#define SAVED_WINDOW_VECTOR_SIZE 16 /* Arg to Fmake_vector */ + Lisp_Object window; + Lisp_Object buffer, start, pointm, mark; + Lisp_Object left, top, width, height, hscroll, min_hscroll; + Lisp_Object parent, prev; + Lisp_Object start_at_line_beg; + Lisp_Object display_table; + Lisp_Object orig_top, orig_height; +}; + +#define SAVED_WINDOW_VECTOR_SIZE 17 /* Arg to Fmake_vector */ #define SAVED_WINDOW_N(swv,n) \ ((struct saved_window *) (XVECTOR ((swv)->contents[(n)]))) @@ -4825,6 +4831,7 @@ the return value is nil. Otherwise the value is t.") w->width = p->width; w->height = p->height; w->hscroll = p->hscroll; + w->min_hscroll = p->min_hscroll; w->display_table = p->display_table; w->orig_top = p->orig_top; w->orig_height = p->orig_height; @@ -5092,6 +5099,7 @@ save_window_save (window, vector, i) p->width = w->width; p->height = w->height; p->hscroll = w->hscroll; + p->min_hscroll = w->min_hscroll; p->display_table = w->display_table; p->orig_top = w->orig_top; p->orig_height = w->orig_height; @@ -5520,6 +5528,8 @@ compare_window_configurations (c1, c2, ignore_positions) { if (! EQ (p1->hscroll, p2->hscroll)) return 0; + if (!EQ (p1->min_hscroll, p2->min_hscroll)) + return 0; if (! EQ (p1->start_at_line_beg, p2->start_at_line_beg)) return 0; if (NILP (Fequal (p1->start, p2->start)))