X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fwindow.c;h=bdf77646582db63cc0b2529cd56ff1891b6d4490;hb=de379e10065c9231f9e5461dbcec457a1db1d5d6;hp=a3ad1b1d3780e0eda87e98c65687c1094ff9cc6a;hpb=3198ed8319f99e19a14447745f4f93e4b4522961;p=chise%2Fxemacs-chise.git diff --git a/src/window.c b/src/window.c index a3ad1b1..bdf7764 100644 --- a/src/window.c +++ b/src/window.c @@ -111,18 +111,20 @@ Lisp_Object Vtemp_buffer_show_function; Lisp_Object Vtemp_buffer_show_hook; /* If a window gets smaller than either of these, it is removed. */ -int window_min_height; -int window_min_width; +Fixnum window_min_height; +Fixnum window_min_width; /* Hook run at end of temp_output_buffer_show. */ Lisp_Object Qtemp_buffer_show_hook; /* Number of lines of continuity in scrolling by screenfuls. */ -int next_screen_context_lines; +Fixnum next_screen_context_lines; /* List of freed window configurations with 1 - 10 windows. */ static Lisp_Object Vwindow_configuration_free_list[10]; +Lisp_Object Qtruncate_partial_width_windows; + #define SET_LAST_MODIFIED(w, cache_too) \ do { \ (w)->last_modified[CURRENT_DISP] = Qzero; \ @@ -724,7 +726,8 @@ window_truncation_on (struct window *w) /* If truncate_partial_width_windows is true and the window is not the full width of the frame it is truncated. */ - if (truncate_partial_width_windows + if (!NILP (symbol_value_in_buffer (Qtruncate_partial_width_windows, + w->buffer)) && !(window_is_leftmost (w) && window_is_rightmost (w))) return 1; @@ -2534,6 +2537,7 @@ enum window_loop GET_LRU_WINDOW, /* Arg is t for full-width windows only */ DELETE_OTHER_WINDOWS, /* Arg is window not to delete */ DELETE_BUFFER_WINDOWS, /* Arg is buffer */ + UNDEDICATE_BUFFER, /* Arg is buffer */ GET_LARGEST_WINDOW, GET_BUFFER_WINDOW_COUNT, /* Arg is buffer */ GET_BUFFER_MRU_WINDOW /* Arg is buffer */ @@ -2613,7 +2617,7 @@ window_loop (enum window_loop type, We can't just wait until we hit the first window again, because it might be deleted. */ - last_window = Fprevious_window (w, mini ? Qt : Qnil, frame_arg, Qt); + last_window = Fprevious_window (w, mini ? Qt : Qnil, frame_arg, device); best_window = Qnil; for (;;) @@ -2628,7 +2632,17 @@ window_loop (enum window_loop type, /* Given the outstanding quality of the rest of this code, I feel no shame about putting this piece of shit in. */ if (++lose_lose >= 500) - return Qnil; + { + /* Call to abort() added by Darryl Okahata (16 Nov. 2001), + at Ben's request, to catch any remaining bugs. + + If you find that XEmacs is aborting here, and you + need to be up and running ASAP, it should be safe to + comment out the following abort(), as long as you + leave the "break;" alone. */ + abort(); + break; /* <--- KEEP THIS HERE! Do not delete! */ + } /* Note that we do not pay attention here to whether the frame is visible, since Fnext_window skips non-visible frames @@ -2686,6 +2700,13 @@ window_loop (enum window_loop type, break; } + case UNDEDICATE_BUFFER: + { + if ((XBUFFER (p->buffer) == XBUFFER (obj))) + p->dedicated = Qnil; + break; + } + case DELETE_OTHER_WINDOWS: { /* Don't delete the last window on a frame; this can @@ -2812,6 +2833,12 @@ buffer_window_mru (struct window *w) #endif +void +undedicate_windows (Lisp_Object buffer, Lisp_Object frame) +{ + window_loop (UNDEDICATE_BUFFER, buffer, 0, frame, 1, Qnil); +} + DEFUN ("get-lru-window", Fget_lru_window, 0, 2, 0, /* Return the window least recently selected or used for display. @@ -3627,8 +3654,9 @@ make_dummy_parent (Lisp_Object window) DEFUN ("split-window", Fsplit_window, 0, 3, "", /* Split WINDOW, putting SIZE lines in the first of the pair. WINDOW defaults to the selected one and SIZE to half its size. -If optional third arg HORFLAG is non-nil, split side by side -and put SIZE columns in the first of the pair. +If optional third arg HORFLAG is non-nil, split side by side and put +SIZE columns in the first of the pair. The newly created window is +returned. */ (window, size, horflag)) { @@ -3652,7 +3680,7 @@ and put SIZE columns in the first of the pair. /* In the new scheme, we are symmetric with respect to separators so there is no need to do weird things here. */ { - psize = WINDOW_WIDTH (o) >> 1; + psize = (WINDOW_WIDTH (o) + window_divider_width (o)) >> 1; csize = window_pixel_width_to_char_width (o, psize, 0); } else @@ -4331,7 +4359,7 @@ window_scroll (Lisp_Object window, Lisp_Object count, int direction, && Dynarr_length (dla) >= (1 + modeline) && - (dl->ascent - dl->top_clip) - fheight * value > 0) + (dl->ascent - dl->top_clip) > fheight * value) { WINDOW_TEXT_TOP_CLIP (w) += value * fheight; MARK_WINDOWS_CHANGED (w); @@ -4513,6 +4541,11 @@ When calling from a program, supply an integer as argument or nil. On attempt to scroll past end of buffer, `end-of-buffer' is signaled. On attempt to scroll past beginning of buffer, `beginning-of-buffer' is signaled. + +The characters that are moved over may be added to the current selection +\(i.e. active region) if the Shift key is held down, a motion key is used +to invoke this command, and `shifted-motion-keys-select-region' is t; see +the documentation for this variable for more details. */ (count)) { @@ -4528,6 +4561,11 @@ When calling from a program, supply a number as argument or nil. On attempt to scroll past end of buffer, `end-of-buffer' is signaled. On attempt to scroll past beginning of buffer, `beginning-of-buffer' is signaled. + +The characters that are moved over may be added to the current selection +\(i.e. active region) if the Shift key is held down, a motion key is used +to invoke this command, and `shifted-motion-keys-select-region' is t; see +the documentation for this variable for more details. */ (count)) { @@ -4600,6 +4638,11 @@ showing that buffer, popping the buffer up if necessary. DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /* Scroll selected window display COUNT columns left. Default for COUNT is window width minus 2. + +The characters that are moved over may be added to the current selection +\(i.e. active region) if the Shift key is held down, a motion key is used +to invoke this command, and `shifted-motion-keys-select-region' is t; see +the documentation for this variable for more details. */ (count)) { @@ -4615,6 +4658,11 @@ Default for COUNT is window width minus 2. DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* Scroll selected window display COUNT columns right. Default for COUNT is window width minus 2. + +The characters that are moved over may be added to the current selection +\(i.e. active region) if the Shift key is held down, a motion key is used +to invoke this command, and `shifted-motion-keys-select-region' is t; see +the documentation for this variable for more details. */ (count)) { @@ -6063,6 +6111,8 @@ syms_of_window (void) /* Qother in general.c */ #endif + DEFSYMBOL (Qtruncate_partial_width_windows); + DEFSUBR (Fselected_window); DEFSUBR (Flast_nonminibuf_window); DEFSUBR (Fminibuffer_window); @@ -6311,6 +6361,9 @@ This is a specifier; use `set-specifier' to change it. #ifdef HAVE_TTY fb = Fcons (Fcons (list1 (Qtty), make_int (1)), fb); #endif +#ifdef HAVE_GTK + fb = Fcons (Fcons (list1 (Qgtk), make_int (3)), fb); +#endif #ifdef HAVE_X_WINDOWS fb = Fcons (Fcons (list1 (Qx), make_int (3)), fb); #endif @@ -6345,6 +6398,9 @@ This is a specifier; use `set-specifier' to change it. Should not the same value be the fallback under X? - kkm */ fb = Fcons (Fcons (list1 (Qx), make_int (2)), fb); #endif +#ifdef HAVE_GTK + fb = Fcons (Fcons (list1 (Qgtk), Qzero), fb); +#endif #ifdef HAVE_MS_WINDOWS fb = Fcons (Fcons (list1 (Qmswindows), Qzero), fb); #endif