diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 240 |
1 files changed, 66 insertions, 174 deletions
diff --git a/src/window.c b/src/window.c index 950b9936497..f3c63935347 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -220,7 +220,7 @@ DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | |||
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | Lisp_Object | 222 | Lisp_Object |
| 223 | make_window () | 223 | make_window (void) |
| 224 | { | 224 | { |
| 225 | Lisp_Object val; | 225 | Lisp_Object val; |
| 226 | register struct window *p; | 226 | register struct window *p; |
| @@ -483,8 +483,7 @@ Return nil if window display is not up-to-date. In that case, use | |||
| 483 | 483 | ||
| 484 | 484 | ||
| 485 | static struct window * | 485 | static struct window * |
| 486 | decode_window (window) | 486 | decode_window (register Lisp_Object window) |
| 487 | register Lisp_Object window; | ||
| 488 | { | 487 | { |
| 489 | if (NILP (window)) | 488 | if (NILP (window)) |
| 490 | return XWINDOW (selected_window); | 489 | return XWINDOW (selected_window); |
| @@ -494,8 +493,7 @@ decode_window (window) | |||
| 494 | } | 493 | } |
| 495 | 494 | ||
| 496 | static struct window * | 495 | static struct window * |
| 497 | decode_any_window (window) | 496 | decode_any_window (register Lisp_Object window) |
| 498 | register Lisp_Object window; | ||
| 499 | { | 497 | { |
| 500 | if (NILP (window)) | 498 | if (NILP (window)) |
| 501 | return XWINDOW (selected_window); | 499 | return XWINDOW (selected_window); |
| @@ -799,9 +797,7 @@ display margins, fringes, header line, and/or mode line. */) | |||
| 799 | X and Y are frame relative pixel coordinates. */ | 797 | X and Y are frame relative pixel coordinates. */ |
| 800 | 798 | ||
| 801 | static enum window_part | 799 | static enum window_part |
| 802 | coordinates_in_window (w, x, y) | 800 | coordinates_in_window (register struct window *w, register int *x, register int *y) |
| 803 | register struct window *w; | ||
| 804 | register int *x, *y; | ||
| 805 | { | 801 | { |
| 806 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 802 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 807 | int left_x, right_x, top_y, bottom_y; | 803 | int left_x, right_x, top_y, bottom_y; |
| @@ -1084,9 +1080,7 @@ struct check_window_data | |||
| 1084 | }; | 1080 | }; |
| 1085 | 1081 | ||
| 1086 | static int | 1082 | static int |
| 1087 | check_window_containing (w, user_data) | 1083 | check_window_containing (struct window *w, void *user_data) |
| 1088 | struct window *w; | ||
| 1089 | void *user_data; | ||
| 1090 | { | 1084 | { |
| 1091 | struct check_window_data *cw = (struct check_window_data *) user_data; | 1085 | struct check_window_data *cw = (struct check_window_data *) user_data; |
| 1092 | enum window_part found; | 1086 | enum window_part found; |
| @@ -1124,12 +1118,7 @@ check_window_containing (w, user_data) | |||
| 1124 | case. */ | 1118 | case. */ |
| 1125 | 1119 | ||
| 1126 | Lisp_Object | 1120 | Lisp_Object |
| 1127 | window_from_coordinates (f, x, y, part, wx, wy, tool_bar_p) | 1121 | window_from_coordinates (struct frame *f, int x, int y, enum window_part *part, int *wx, int *wy, int tool_bar_p) |
| 1128 | struct frame *f; | ||
| 1129 | int x, y; | ||
| 1130 | enum window_part *part; | ||
| 1131 | int *wx, *wy; | ||
| 1132 | int tool_bar_p; | ||
| 1133 | { | 1122 | { |
| 1134 | Lisp_Object window; | 1123 | Lisp_Object window; |
| 1135 | struct check_window_data cw; | 1124 | struct check_window_data cw; |
| @@ -1469,8 +1458,7 @@ WINDOW defaults to the selected window. */) | |||
| 1469 | return 0. */ | 1458 | return 0. */ |
| 1470 | 1459 | ||
| 1471 | struct Lisp_Char_Table * | 1460 | struct Lisp_Char_Table * |
| 1472 | window_display_table (w) | 1461 | window_display_table (struct window *w) |
| 1473 | struct window *w; | ||
| 1474 | { | 1462 | { |
| 1475 | struct Lisp_Char_Table *dp = NULL; | 1463 | struct Lisp_Char_Table *dp = NULL; |
| 1476 | 1464 | ||
| @@ -1504,8 +1492,7 @@ DEFUN ("set-window-display-table", Fset_window_display_table, Sset_window_displa | |||
| 1504 | /* Record info on buffer window w is displaying | 1492 | /* Record info on buffer window w is displaying |
| 1505 | when it is about to cease to display that buffer. */ | 1493 | when it is about to cease to display that buffer. */ |
| 1506 | static void | 1494 | static void |
| 1507 | unshow_buffer (w) | 1495 | unshow_buffer (register struct window *w) |
| 1508 | register struct window *w; | ||
| 1509 | { | 1496 | { |
| 1510 | Lisp_Object buf; | 1497 | Lisp_Object buf; |
| 1511 | struct buffer *b; | 1498 | struct buffer *b; |
| @@ -1553,8 +1540,7 @@ unshow_buffer (w) | |||
| 1553 | 1540 | ||
| 1554 | /* Put replacement into the window structure in place of old. */ | 1541 | /* Put replacement into the window structure in place of old. */ |
| 1555 | static void | 1542 | static void |
| 1556 | replace_window (old, replacement) | 1543 | replace_window (Lisp_Object old, Lisp_Object replacement) |
| 1557 | Lisp_Object old, replacement; | ||
| 1558 | { | 1544 | { |
| 1559 | register Lisp_Object tem; | 1545 | register Lisp_Object tem; |
| 1560 | register struct window *o = XWINDOW (old), *p = XWINDOW (replacement); | 1546 | register struct window *o = XWINDOW (old), *p = XWINDOW (replacement); |
| @@ -1628,8 +1614,7 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 1628 | } | 1614 | } |
| 1629 | 1615 | ||
| 1630 | void | 1616 | void |
| 1631 | delete_window (window) | 1617 | delete_window (register Lisp_Object window) |
| 1632 | register Lisp_Object window; | ||
| 1633 | { | 1618 | { |
| 1634 | register Lisp_Object tem, parent, sib; | 1619 | register Lisp_Object tem, parent, sib; |
| 1635 | register struct window *p; | 1620 | register struct window *p; |
| @@ -1843,9 +1828,7 @@ delete_window (window) | |||
| 1843 | function window_list. */ | 1828 | function window_list. */ |
| 1844 | 1829 | ||
| 1845 | static int | 1830 | static int |
| 1846 | add_window_to_list (w, user_data) | 1831 | add_window_to_list (struct window *w, void *user_data) |
| 1847 | struct window *w; | ||
| 1848 | void *user_data; | ||
| 1849 | { | 1832 | { |
| 1850 | Lisp_Object *list = (Lisp_Object *) user_data; | 1833 | Lisp_Object *list = (Lisp_Object *) user_data; |
| 1851 | Lisp_Object window; | 1834 | Lisp_Object window; |
| @@ -1860,7 +1843,7 @@ add_window_to_list (w, user_data) | |||
| 1860 | list, cache it in Vwindow_list, and return that. */ | 1843 | list, cache it in Vwindow_list, and return that. */ |
| 1861 | 1844 | ||
| 1862 | static Lisp_Object | 1845 | static Lisp_Object |
| 1863 | window_list () | 1846 | window_list (void) |
| 1864 | { | 1847 | { |
| 1865 | if (!CONSP (Vwindow_list)) | 1848 | if (!CONSP (Vwindow_list)) |
| 1866 | { | 1849 | { |
| @@ -1901,8 +1884,7 @@ window_list () | |||
| 1901 | a frame means consider windows on that frame, only. */ | 1884 | a frame means consider windows on that frame, only. */ |
| 1902 | 1885 | ||
| 1903 | static int | 1886 | static int |
| 1904 | candidate_window_p (window, owindow, minibuf, all_frames) | 1887 | candidate_window_p (Lisp_Object window, Lisp_Object owindow, Lisp_Object minibuf, Lisp_Object all_frames) |
| 1905 | Lisp_Object window, owindow, minibuf, all_frames; | ||
| 1906 | { | 1888 | { |
| 1907 | struct window *w = XWINDOW (window); | 1889 | struct window *w = XWINDOW (window); |
| 1908 | struct frame *f = XFRAME (w->frame); | 1890 | struct frame *f = XFRAME (w->frame); |
| @@ -1967,8 +1949,7 @@ candidate_window_p (window, owindow, minibuf, all_frames) | |||
| 1967 | ALL_FRAMES. */ | 1949 | ALL_FRAMES. */ |
| 1968 | 1950 | ||
| 1969 | static void | 1951 | static void |
| 1970 | decode_next_window_args (window, minibuf, all_frames) | 1952 | decode_next_window_args (Lisp_Object *window, Lisp_Object *minibuf, Lisp_Object *all_frames) |
| 1971 | Lisp_Object *window, *minibuf, *all_frames; | ||
| 1972 | { | 1953 | { |
| 1973 | if (NILP (*window)) | 1954 | if (NILP (*window)) |
| 1974 | *window = selected_window; | 1955 | *window = selected_window; |
| @@ -2014,9 +1995,7 @@ decode_next_window_args (window, minibuf, all_frames) | |||
| 2014 | ALL_FRAMES. */ | 1995 | ALL_FRAMES. */ |
| 2015 | 1996 | ||
| 2016 | static Lisp_Object | 1997 | static Lisp_Object |
| 2017 | next_window (window, minibuf, all_frames, next_p) | 1998 | next_window (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames, int next_p) |
| 2018 | Lisp_Object window, minibuf, all_frames; | ||
| 2019 | int next_p; | ||
| 2020 | { | 1999 | { |
| 2021 | decode_next_window_args (&window, &minibuf, &all_frames); | 2000 | decode_next_window_args (&window, &minibuf, &all_frames); |
| 2022 | 2001 | ||
| @@ -2200,8 +2179,7 @@ MINIBUF neither nil nor t means never include the minibuffer window. */) | |||
| 2200 | for `next-window'. */ | 2179 | for `next-window'. */ |
| 2201 | 2180 | ||
| 2202 | static Lisp_Object | 2181 | static Lisp_Object |
| 2203 | window_list_1 (window, minibuf, all_frames) | 2182 | window_list_1 (Lisp_Object window, Lisp_Object minibuf, Lisp_Object all_frames) |
| 2204 | Lisp_Object window, minibuf, all_frames; | ||
| 2205 | { | 2183 | { |
| 2206 | Lisp_Object tail, list, rest; | 2184 | Lisp_Object tail, list, rest; |
| 2207 | 2185 | ||
| @@ -2249,10 +2227,7 @@ enum window_loop | |||
| 2249 | }; | 2227 | }; |
| 2250 | 2228 | ||
| 2251 | static Lisp_Object | 2229 | static Lisp_Object |
| 2252 | window_loop (type, obj, mini, frames) | 2230 | window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frames) |
| 2253 | enum window_loop type; | ||
| 2254 | Lisp_Object obj, frames; | ||
| 2255 | int mini; | ||
| 2256 | { | 2231 | { |
| 2257 | Lisp_Object window, windows, best_window, frame_arg; | 2232 | Lisp_Object window, windows, best_window, frame_arg; |
| 2258 | struct frame *f; | 2233 | struct frame *f; |
| @@ -2479,7 +2454,7 @@ window_loop (type, obj, mini, frames) | |||
| 2479 | /* Used for debugging. Abort if any window has a dead buffer. */ | 2454 | /* Used for debugging. Abort if any window has a dead buffer. */ |
| 2480 | 2455 | ||
| 2481 | void | 2456 | void |
| 2482 | check_all_windows () | 2457 | check_all_windows (void) |
| 2483 | { | 2458 | { |
| 2484 | window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); | 2459 | window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); |
| 2485 | } | 2460 | } |
| @@ -2690,8 +2665,7 @@ frames left, some other buffer is displayed in that window. */) | |||
| 2690 | of all frames, even those on other keyboards. */ | 2665 | of all frames, even those on other keyboards. */ |
| 2691 | 2666 | ||
| 2692 | void | 2667 | void |
| 2693 | replace_buffer_in_all_windows (buffer) | 2668 | replace_buffer_in_all_windows (Lisp_Object buffer) |
| 2694 | Lisp_Object buffer; | ||
| 2695 | { | 2669 | { |
| 2696 | Lisp_Object tail, frame; | 2670 | Lisp_Object tail, frame; |
| 2697 | 2671 | ||
| @@ -2720,9 +2694,7 @@ replace_buffer_in_all_windows (buffer) | |||
| 2720 | minimum allowable size. */ | 2694 | minimum allowable size. */ |
| 2721 | 2695 | ||
| 2722 | void | 2696 | void |
| 2723 | check_frame_size (frame, rows, cols) | 2697 | check_frame_size (FRAME_PTR frame, int *rows, int *cols) |
| 2724 | FRAME_PTR frame; | ||
| 2725 | int *rows, *cols; | ||
| 2726 | { | 2698 | { |
| 2727 | /* For height, we have to see: | 2699 | /* For height, we have to see: |
| 2728 | how many windows the frame has at minimum (one or two), | 2700 | how many windows the frame has at minimum (one or two), |
| @@ -2748,9 +2720,7 @@ check_frame_size (frame, rows, cols) | |||
| 2748 | either. */ | 2720 | either. */ |
| 2749 | 2721 | ||
| 2750 | static int | 2722 | static int |
| 2751 | window_fixed_size_p (w, width_p, check_siblings_p) | 2723 | window_fixed_size_p (struct window *w, int width_p, int check_siblings_p) |
| 2752 | struct window *w; | ||
| 2753 | int width_p, check_siblings_p; | ||
| 2754 | { | 2724 | { |
| 2755 | int fixed_p; | 2725 | int fixed_p; |
| 2756 | struct window *c; | 2726 | struct window *c; |
| @@ -2850,9 +2820,7 @@ window_fixed_size_p (w, width_p, check_siblings_p) | |||
| 2850 | minibuffer window, always return 1. */ | 2820 | minibuffer window, always return 1. */ |
| 2851 | 2821 | ||
| 2852 | static int | 2822 | static int |
| 2853 | window_min_size_2 (w, width_p, safe_p) | 2823 | window_min_size_2 (struct window *w, int width_p, int safe_p) |
| 2854 | struct window *w; | ||
| 2855 | int width_p, safe_p; | ||
| 2856 | { | 2824 | { |
| 2857 | /* We should consider buffer-local values of window_min_height and | 2825 | /* We should consider buffer-local values of window_min_height and |
| 2858 | window_min_width here. */ | 2826 | window_min_width here. */ |
| @@ -2886,9 +2854,7 @@ window_min_size_2 (w, width_p, safe_p) | |||
| 2886 | sizes of W's children. */ | 2854 | sizes of W's children. */ |
| 2887 | 2855 | ||
| 2888 | static int | 2856 | static int |
| 2889 | window_min_size_1 (w, width_p, safe_p) | 2857 | window_min_size_1 (struct window *w, int width_p, int safe_p) |
| 2890 | struct window *w; | ||
| 2891 | int width_p, safe_p; | ||
| 2892 | { | 2858 | { |
| 2893 | struct window *c; | 2859 | struct window *c; |
| 2894 | int size; | 2860 | int size; |
| @@ -2963,9 +2929,7 @@ window_min_size_1 (w, width_p, safe_p) | |||
| 2963 | to 1 if W is fixed-size unless FIXED is null. */ | 2929 | to 1 if W is fixed-size unless FIXED is null. */ |
| 2964 | 2930 | ||
| 2965 | static int | 2931 | static int |
| 2966 | window_min_size (w, width_p, safe_p, ignore_fixed_p, fixed) | 2932 | window_min_size (struct window *w, int width_p, int safe_p, int ignore_fixed_p, int *fixed) |
| 2967 | struct window *w; | ||
| 2968 | int width_p, safe_p, ignore_fixed_p, *fixed; | ||
| 2969 | { | 2933 | { |
| 2970 | int size, fixed_p; | 2934 | int size, fixed_p; |
| 2971 | 2935 | ||
| @@ -2991,8 +2955,7 @@ window_min_size (w, width_p, safe_p, ignore_fixed_p, fixed) | |||
| 2991 | is still too narrow. */ | 2955 | is still too narrow. */ |
| 2992 | 2956 | ||
| 2993 | static int | 2957 | static int |
| 2994 | adjust_window_margins (w) | 2958 | adjust_window_margins (struct window *w) |
| 2995 | struct window *w; | ||
| 2996 | { | 2959 | { |
| 2997 | int box_cols = (WINDOW_TOTAL_COLS (w) | 2960 | int box_cols = (WINDOW_TOTAL_COLS (w) |
| 2998 | - WINDOW_FRINGE_COLS (w) | 2961 | - WINDOW_FRINGE_COLS (w) |
| @@ -3190,10 +3153,7 @@ shrink_windows (total, size, nchildren, shrinkable, resize_fixed_p, | |||
| 3190 | This should give better behavior when resizing frames. */ | 3153 | This should give better behavior when resizing frames. */ |
| 3191 | 3154 | ||
| 3192 | static void | 3155 | static void |
| 3193 | size_window (window, size, width_p, nodelete_p, first_only, last_only) | 3156 | size_window (Lisp_Object window, int size, int width_p, int nodelete_p, int first_only, int last_only) |
| 3194 | Lisp_Object window; | ||
| 3195 | int size, width_p, nodelete_p; | ||
| 3196 | int first_only, last_only; | ||
| 3197 | { | 3157 | { |
| 3198 | struct window *w = XWINDOW (window); | 3158 | struct window *w = XWINDOW (window); |
| 3199 | struct window *c; | 3159 | struct window *c; |
| @@ -3384,10 +3344,7 @@ size_window (window, size, width_p, nodelete_p, first_only, last_only) | |||
| 3384 | displayed correctly. */ | 3344 | displayed correctly. */ |
| 3385 | 3345 | ||
| 3386 | void | 3346 | void |
| 3387 | set_window_height (window, height, nodelete) | 3347 | set_window_height (Lisp_Object window, int height, int nodelete) |
| 3388 | Lisp_Object window; | ||
| 3389 | int height; | ||
| 3390 | int nodelete; | ||
| 3391 | { | 3348 | { |
| 3392 | size_window (window, height, 0, nodelete, 0, 0); | 3349 | size_window (window, height, 0, nodelete, 0, 0); |
| 3393 | } | 3350 | } |
| @@ -3401,10 +3358,7 @@ set_window_height (window, height, nodelete) | |||
| 3401 | displayed correctly. */ | 3358 | displayed correctly. */ |
| 3402 | 3359 | ||
| 3403 | void | 3360 | void |
| 3404 | set_window_width (window, width, nodelete) | 3361 | set_window_width (Lisp_Object window, int width, int nodelete) |
| 3405 | Lisp_Object window; | ||
| 3406 | int width; | ||
| 3407 | int nodelete; | ||
| 3408 | { | 3362 | { |
| 3409 | size_window (window, width, 1, nodelete, 0, 0); | 3363 | size_window (window, width, 1, nodelete, 0, 0); |
| 3410 | } | 3364 | } |
| @@ -3412,9 +3366,7 @@ set_window_width (window, width, nodelete) | |||
| 3412 | /* Change window heights in windows rooted in WINDOW by N lines. */ | 3366 | /* Change window heights in windows rooted in WINDOW by N lines. */ |
| 3413 | 3367 | ||
| 3414 | void | 3368 | void |
| 3415 | change_window_heights (window, n) | 3369 | change_window_heights (Lisp_Object window, int n) |
| 3416 | Lisp_Object window; | ||
| 3417 | int n; | ||
| 3418 | { | 3370 | { |
| 3419 | struct window *w = XWINDOW (window); | 3371 | struct window *w = XWINDOW (window); |
| 3420 | 3372 | ||
| @@ -3510,9 +3462,7 @@ run_window_configuration_change_hook (struct frame *f) | |||
| 3510 | reset from the buffer's local settings. */ | 3462 | reset from the buffer's local settings. */ |
| 3511 | 3463 | ||
| 3512 | void | 3464 | void |
| 3513 | set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) | 3465 | set_window_buffer (Lisp_Object window, Lisp_Object buffer, int run_hooks_p, int keep_margins_p) |
| 3514 | Lisp_Object window, buffer; | ||
| 3515 | int run_hooks_p, keep_margins_p; | ||
| 3516 | { | 3466 | { |
| 3517 | struct window *w = XWINDOW (window); | 3467 | struct window *w = XWINDOW (window); |
| 3518 | struct buffer *b = XBUFFER (buffer); | 3468 | struct buffer *b = XBUFFER (buffer); |
| @@ -3743,24 +3693,21 @@ selected window before each command. */) | |||
| 3743 | } | 3693 | } |
| 3744 | 3694 | ||
| 3745 | static Lisp_Object | 3695 | static Lisp_Object |
| 3746 | select_window_norecord (window) | 3696 | select_window_norecord (Lisp_Object window) |
| 3747 | Lisp_Object window; | ||
| 3748 | { | 3697 | { |
| 3749 | return WINDOW_LIVE_P (window) | 3698 | return WINDOW_LIVE_P (window) |
| 3750 | ? Fselect_window (window, Qt) : selected_window; | 3699 | ? Fselect_window (window, Qt) : selected_window; |
| 3751 | } | 3700 | } |
| 3752 | 3701 | ||
| 3753 | static Lisp_Object | 3702 | static Lisp_Object |
| 3754 | select_frame_norecord (frame) | 3703 | select_frame_norecord (Lisp_Object frame) |
| 3755 | Lisp_Object frame; | ||
| 3756 | { | 3704 | { |
| 3757 | return FRAME_LIVE_P (XFRAME (frame)) | 3705 | return FRAME_LIVE_P (XFRAME (frame)) |
| 3758 | ? Fselect_frame (frame, Qt) : selected_frame; | 3706 | ? Fselect_frame (frame, Qt) : selected_frame; |
| 3759 | } | 3707 | } |
| 3760 | 3708 | ||
| 3761 | Lisp_Object | 3709 | Lisp_Object |
| 3762 | display_buffer (buffer, not_this_window_p, override_frame) | 3710 | display_buffer (Lisp_Object buffer, Lisp_Object not_this_window_p, Lisp_Object override_frame) |
| 3763 | Lisp_Object buffer, not_this_window_p, override_frame; | ||
| 3764 | { | 3711 | { |
| 3765 | return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); | 3712 | return call3 (Qdisplay_buffer, buffer, not_this_window_p, override_frame); |
| 3766 | } | 3713 | } |
| @@ -3811,8 +3758,7 @@ displaying that buffer. */) | |||
| 3811 | 3758 | ||
| 3812 | 3759 | ||
| 3813 | void | 3760 | void |
| 3814 | temp_output_buffer_show (buf) | 3761 | temp_output_buffer_show (register Lisp_Object buf) |
| 3815 | register Lisp_Object buf; | ||
| 3816 | { | 3762 | { |
| 3817 | register struct buffer *old = current_buffer; | 3763 | register struct buffer *old = current_buffer; |
| 3818 | register Lisp_Object window; | 3764 | register Lisp_Object window; |
| @@ -3872,8 +3818,7 @@ temp_output_buffer_show (buf) | |||
| 3872 | } | 3818 | } |
| 3873 | 3819 | ||
| 3874 | static void | 3820 | static void |
| 3875 | make_dummy_parent (window) | 3821 | make_dummy_parent (Lisp_Object window) |
| 3876 | Lisp_Object window; | ||
| 3877 | { | 3822 | { |
| 3878 | Lisp_Object new; | 3823 | Lisp_Object new; |
| 3879 | register struct window *o, *p; | 3824 | register struct window *o, *p; |
| @@ -4087,16 +4032,14 @@ fixed size windows is not altered by this function. */) | |||
| 4087 | } | 4032 | } |
| 4088 | 4033 | ||
| 4089 | int | 4034 | int |
| 4090 | window_height (window) | 4035 | window_height (Lisp_Object window) |
| 4091 | Lisp_Object window; | ||
| 4092 | { | 4036 | { |
| 4093 | register struct window *p = XWINDOW (window); | 4037 | register struct window *p = XWINDOW (window); |
| 4094 | return WINDOW_TOTAL_LINES (p); | 4038 | return WINDOW_TOTAL_LINES (p); |
| 4095 | } | 4039 | } |
| 4096 | 4040 | ||
| 4097 | int | 4041 | int |
| 4098 | window_width (window) | 4042 | window_width (Lisp_Object window) |
| 4099 | Lisp_Object window; | ||
| 4100 | { | 4043 | { |
| 4101 | register struct window *p = XWINDOW (window); | 4044 | register struct window *p = XWINDOW (window); |
| 4102 | return WINDOW_TOTAL_COLS (p); | 4045 | return WINDOW_TOTAL_COLS (p); |
| @@ -4118,9 +4061,7 @@ window_width (window) | |||
| 4118 | deleted. */ | 4061 | deleted. */ |
| 4119 | 4062 | ||
| 4120 | static void | 4063 | static void |
| 4121 | enlarge_window (window, delta, horiz_flag) | 4064 | enlarge_window (Lisp_Object window, int delta, int horiz_flag) |
| 4122 | Lisp_Object window; | ||
| 4123 | int delta, horiz_flag; | ||
| 4124 | { | 4065 | { |
| 4125 | Lisp_Object parent, next, prev; | 4066 | Lisp_Object parent, next, prev; |
| 4126 | struct window *p; | 4067 | struct window *p; |
| @@ -4396,9 +4337,7 @@ enlarge_window (window, delta, horiz_flag) | |||
| 4396 | are not deleted; instead, we signal an error. */ | 4337 | are not deleted; instead, we signal an error. */ |
| 4397 | 4338 | ||
| 4398 | static void | 4339 | static void |
| 4399 | adjust_window_trailing_edge (window, delta, horiz_flag) | 4340 | adjust_window_trailing_edge (Lisp_Object window, int delta, int horiz_flag) |
| 4400 | Lisp_Object window; | ||
| 4401 | int delta, horiz_flag; | ||
| 4402 | { | 4341 | { |
| 4403 | Lisp_Object parent, child; | 4342 | Lisp_Object parent, child; |
| 4404 | struct window *p; | 4343 | struct window *p; |
| @@ -4570,9 +4509,7 @@ static int save_restore_orig_size (struct window *, | |||
| 4570 | from lowest windows first. */ | 4509 | from lowest windows first. */ |
| 4571 | 4510 | ||
| 4572 | static void | 4511 | static void |
| 4573 | shrink_window_lowest_first (w, height) | 4512 | shrink_window_lowest_first (struct window *w, int height) |
| 4574 | struct window *w; | ||
| 4575 | int height; | ||
| 4576 | { | 4513 | { |
| 4577 | struct window *c; | 4514 | struct window *c; |
| 4578 | Lisp_Object child; | 4515 | Lisp_Object child; |
| @@ -4654,9 +4591,7 @@ shrink_window_lowest_first (w, height) | |||
| 4654 | stored in orig_top_line and orig_total_lines for all windows. */ | 4591 | stored in orig_top_line and orig_total_lines for all windows. */ |
| 4655 | 4592 | ||
| 4656 | static int | 4593 | static int |
| 4657 | save_restore_orig_size (w, action) | 4594 | save_restore_orig_size (struct window *w, enum save_restore_action action) |
| 4658 | struct window *w; | ||
| 4659 | enum save_restore_action action; | ||
| 4660 | { | 4595 | { |
| 4661 | int success_p = 1; | 4596 | int success_p = 1; |
| 4662 | 4597 | ||
| @@ -4711,9 +4646,7 @@ save_restore_orig_size (w, action) | |||
| 4711 | without deleting other windows. */ | 4646 | without deleting other windows. */ |
| 4712 | 4647 | ||
| 4713 | void | 4648 | void |
| 4714 | grow_mini_window (w, delta) | 4649 | grow_mini_window (struct window *w, int delta) |
| 4715 | struct window *w; | ||
| 4716 | int delta; | ||
| 4717 | { | 4650 | { |
| 4718 | struct frame *f = XFRAME (w->frame); | 4651 | struct frame *f = XFRAME (w->frame); |
| 4719 | struct window *root; | 4652 | struct window *root; |
| @@ -4762,8 +4695,7 @@ grow_mini_window (w, delta) | |||
| 4762 | line. */ | 4695 | line. */ |
| 4763 | 4696 | ||
| 4764 | void | 4697 | void |
| 4765 | shrink_mini_window (w) | 4698 | shrink_mini_window (struct window *w) |
| 4766 | struct window *w; | ||
| 4767 | { | 4699 | { |
| 4768 | struct frame *f = XFRAME (w->frame); | 4700 | struct frame *f = XFRAME (w->frame); |
| 4769 | struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); | 4701 | struct window *root = XWINDOW (FRAME_ROOT_WINDOW (f)); |
| @@ -4793,8 +4725,7 @@ shrink_mini_window (w) | |||
| 4793 | the frame are cleared. */ | 4725 | the frame are cleared. */ |
| 4794 | 4726 | ||
| 4795 | void | 4727 | void |
| 4796 | mark_window_cursors_off (w) | 4728 | mark_window_cursors_off (struct window *w) |
| 4797 | struct window *w; | ||
| 4798 | { | 4729 | { |
| 4799 | while (w) | 4730 | while (w) |
| 4800 | { | 4731 | { |
| @@ -4813,8 +4744,7 @@ mark_window_cursors_off (w) | |||
| 4813 | /* Return number of lines of text (not counting mode lines) in W. */ | 4744 | /* Return number of lines of text (not counting mode lines) in W. */ |
| 4814 | 4745 | ||
| 4815 | int | 4746 | int |
| 4816 | window_internal_height (w) | 4747 | window_internal_height (struct window *w) |
| 4817 | struct window *w; | ||
| 4818 | { | 4748 | { |
| 4819 | int ht = XFASTINT (w->total_lines); | 4749 | int ht = XFASTINT (w->total_lines); |
| 4820 | 4750 | ||
| @@ -4841,8 +4771,7 @@ window_internal_height (w) | |||
| 4841 | separating W from the sibling to its right. */ | 4771 | separating W from the sibling to its right. */ |
| 4842 | 4772 | ||
| 4843 | int | 4773 | int |
| 4844 | window_box_text_cols (w) | 4774 | window_box_text_cols (struct window *w) |
| 4845 | struct window *w; | ||
| 4846 | { | 4775 | { |
| 4847 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 4776 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 4848 | int width = XINT (w->total_cols); | 4777 | int width = XINT (w->total_cols); |
| @@ -4879,11 +4808,7 @@ window_box_text_cols (w) | |||
| 4879 | respectively. */ | 4808 | respectively. */ |
| 4880 | 4809 | ||
| 4881 | static void | 4810 | static void |
| 4882 | window_scroll (window, n, whole, noerror) | 4811 | window_scroll (Lisp_Object window, int n, int whole, int noerror) |
| 4883 | Lisp_Object window; | ||
| 4884 | int n; | ||
| 4885 | int whole; | ||
| 4886 | int noerror; | ||
| 4887 | { | 4812 | { |
| 4888 | immediate_quit = 1; | 4813 | immediate_quit = 1; |
| 4889 | 4814 | ||
| @@ -4903,11 +4828,7 @@ window_scroll (window, n, whole, noerror) | |||
| 4903 | descriptions. */ | 4828 | descriptions. */ |
| 4904 | 4829 | ||
| 4905 | static void | 4830 | static void |
| 4906 | window_scroll_pixel_based (window, n, whole, noerror) | 4831 | window_scroll_pixel_based (Lisp_Object window, int n, int whole, int noerror) |
| 4907 | Lisp_Object window; | ||
| 4908 | int n; | ||
| 4909 | int whole; | ||
| 4910 | int noerror; | ||
| 4911 | { | 4832 | { |
| 4912 | struct it it; | 4833 | struct it it; |
| 4913 | struct window *w = XWINDOW (window); | 4834 | struct window *w = XWINDOW (window); |
| @@ -5253,11 +5174,7 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 5253 | See the comment of window_scroll for parameter descriptions. */ | 5174 | See the comment of window_scroll for parameter descriptions. */ |
| 5254 | 5175 | ||
| 5255 | static void | 5176 | static void |
| 5256 | window_scroll_line_based (window, n, whole, noerror) | 5177 | window_scroll_line_based (Lisp_Object window, int n, int whole, int noerror) |
| 5257 | Lisp_Object window; | ||
| 5258 | int n; | ||
| 5259 | int whole; | ||
| 5260 | int noerror; | ||
| 5261 | { | 5178 | { |
| 5262 | register struct window *w = XWINDOW (window); | 5179 | register struct window *w = XWINDOW (window); |
| 5263 | register int opoint = PT, opoint_byte = PT_BYTE; | 5180 | register int opoint = PT, opoint_byte = PT_BYTE; |
| @@ -5415,9 +5332,7 @@ window_scroll_line_based (window, n, whole, noerror) | |||
| 5415 | up. This is the guts of Fscroll_up and Fscroll_down. */ | 5332 | up. This is the guts of Fscroll_up and Fscroll_down. */ |
| 5416 | 5333 | ||
| 5417 | static void | 5334 | static void |
| 5418 | scroll_command (n, direction) | 5335 | scroll_command (Lisp_Object n, int direction) |
| 5419 | Lisp_Object n; | ||
| 5420 | int direction; | ||
| 5421 | { | 5336 | { |
| 5422 | int count = SPECPDL_INDEX (); | 5337 | int count = SPECPDL_INDEX (); |
| 5423 | 5338 | ||
| @@ -5644,8 +5559,7 @@ Returns nil, if selected window is not a minibuffer window. */) | |||
| 5644 | as opposed to its height. */ | 5559 | as opposed to its height. */ |
| 5645 | 5560 | ||
| 5646 | static int | 5561 | static int |
| 5647 | displayed_window_lines (w) | 5562 | displayed_window_lines (struct window *w) |
| 5648 | struct window *w; | ||
| 5649 | { | 5563 | { |
| 5650 | struct it it; | 5564 | struct it it; |
| 5651 | struct text_pos start; | 5565 | struct text_pos start; |
| @@ -6390,8 +6304,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 6390 | by setting their buffers to nil. */ | 6304 | by setting their buffers to nil. */ |
| 6391 | 6305 | ||
| 6392 | void | 6306 | void |
| 6393 | delete_all_subwindows (w) | 6307 | delete_all_subwindows (register struct window *w) |
| 6394 | register struct window *w; | ||
| 6395 | { | 6308 | { |
| 6396 | if (!NILP (w->next)) | 6309 | if (!NILP (w->next)) |
| 6397 | delete_all_subwindows (XWINDOW (w->next)); | 6310 | delete_all_subwindows (XWINDOW (w->next)); |
| @@ -6417,8 +6330,7 @@ delete_all_subwindows (w) | |||
| 6417 | } | 6330 | } |
| 6418 | 6331 | ||
| 6419 | static int | 6332 | static int |
| 6420 | count_windows (window) | 6333 | count_windows (register struct window *window) |
| 6421 | register struct window *window; | ||
| 6422 | { | 6334 | { |
| 6423 | register int count = 1; | 6335 | register int count = 1; |
| 6424 | if (!NILP (window->next)) | 6336 | if (!NILP (window->next)) |
| @@ -6435,10 +6347,7 @@ count_windows (window) | |||
| 6435 | Value is last index + 1. */ | 6347 | Value is last index + 1. */ |
| 6436 | 6348 | ||
| 6437 | static int | 6349 | static int |
| 6438 | get_leaf_windows (w, flat, i) | 6350 | get_leaf_windows (struct window *w, struct window **flat, int i) |
| 6439 | struct window *w; | ||
| 6440 | struct window **flat; | ||
| 6441 | int i; | ||
| 6442 | { | 6351 | { |
| 6443 | while (w) | 6352 | while (w) |
| 6444 | { | 6353 | { |
| @@ -6461,8 +6370,7 @@ get_leaf_windows (w, flat, i) | |||
| 6461 | can be returned. */ | 6370 | can be returned. */ |
| 6462 | 6371 | ||
| 6463 | struct glyph * | 6372 | struct glyph * |
| 6464 | get_phys_cursor_glyph (w) | 6373 | get_phys_cursor_glyph (struct window *w) |
| 6465 | struct window *w; | ||
| 6466 | { | 6374 | { |
| 6467 | struct glyph_row *row; | 6375 | struct glyph_row *row; |
| 6468 | struct glyph *glyph; | 6376 | struct glyph *glyph; |
| @@ -6481,10 +6389,7 @@ get_phys_cursor_glyph (w) | |||
| 6481 | 6389 | ||
| 6482 | 6390 | ||
| 6483 | static int | 6391 | static int |
| 6484 | save_window_save (window, vector, i) | 6392 | save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) |
| 6485 | Lisp_Object window; | ||
| 6486 | struct Lisp_Vector *vector; | ||
| 6487 | int i; | ||
| 6488 | { | 6393 | { |
| 6489 | register struct saved_window *p; | 6394 | register struct saved_window *p; |
| 6490 | register struct window *w; | 6395 | register struct window *w; |
| @@ -6642,8 +6547,7 @@ usage: (save-window-excursion BODY...) */) | |||
| 6642 | ***********************************************************************/ | 6547 | ***********************************************************************/ |
| 6643 | 6548 | ||
| 6644 | static Lisp_Object | 6549 | static Lisp_Object |
| 6645 | window_tree (w) | 6550 | window_tree (struct window *w) |
| 6646 | struct window *w; | ||
| 6647 | { | 6551 | { |
| 6648 | Lisp_Object tail = Qnil; | 6552 | Lisp_Object tail = Qnil; |
| 6649 | Lisp_Object result = Qnil; | 6553 | Lisp_Object result = Qnil; |
| @@ -7010,10 +6914,7 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */) | |||
| 7010 | additional argument USER_DATA. Stops when FN returns 0. */ | 6914 | additional argument USER_DATA. Stops when FN returns 0. */ |
| 7011 | 6915 | ||
| 7012 | void | 6916 | void |
| 7013 | foreach_window (f, fn, user_data) | 6917 | foreach_window (struct frame *f, int (*fn) (struct window *, void *), void *user_data) |
| 7014 | struct frame *f; | ||
| 7015 | int (* fn) (struct window *, void *); | ||
| 7016 | void *user_data; | ||
| 7017 | { | 6918 | { |
| 7018 | /* delete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */ | 6919 | /* delete_frame may set FRAME_ROOT_WINDOW (f) to Qnil. */ |
| 7019 | if (WINDOWP (FRAME_ROOT_WINDOW (f))) | 6920 | if (WINDOWP (FRAME_ROOT_WINDOW (f))) |
| @@ -7027,10 +6928,7 @@ foreach_window (f, fn, user_data) | |||
| 7027 | Stop when FN returns 0. Value is 0 if stopped by FN. */ | 6928 | Stop when FN returns 0. Value is 0 if stopped by FN. */ |
| 7028 | 6929 | ||
| 7029 | static int | 6930 | static int |
| 7030 | foreach_window_1 (w, fn, user_data) | 6931 | foreach_window_1 (struct window *w, int (*fn) (struct window *, void *), void *user_data) |
| 7031 | struct window *w; | ||
| 7032 | int (* fn) (struct window *, void *); | ||
| 7033 | void *user_data; | ||
| 7034 | { | 6932 | { |
| 7035 | int cont; | 6933 | int cont; |
| 7036 | 6934 | ||
| @@ -7055,9 +6953,7 @@ foreach_window_1 (w, fn, user_data) | |||
| 7055 | the window start. */ | 6953 | the window start. */ |
| 7056 | 6954 | ||
| 7057 | static int | 6955 | static int |
| 7058 | freeze_window_start (w, freeze_p) | 6956 | freeze_window_start (struct window *w, void *freeze_p) |
| 7059 | struct window *w; | ||
| 7060 | void *freeze_p; | ||
| 7061 | { | 6957 | { |
| 7062 | if (MINI_WINDOW_P (w) | 6958 | if (MINI_WINDOW_P (w) |
| 7063 | || (WINDOWP (selected_window) /* Can be nil in corner cases. */ | 6959 | || (WINDOWP (selected_window) /* Can be nil in corner cases. */ |
| @@ -7077,9 +6973,7 @@ freeze_window_start (w, freeze_p) | |||
| 7077 | means freeze the window start. */ | 6973 | means freeze the window start. */ |
| 7078 | 6974 | ||
| 7079 | void | 6975 | void |
| 7080 | freeze_window_starts (f, freeze_p) | 6976 | freeze_window_starts (struct frame *f, int freeze_p) |
| 7081 | struct frame *f; | ||
| 7082 | int freeze_p; | ||
| 7083 | { | 6977 | { |
| 7084 | foreach_window (f, freeze_window_start, (void *) (freeze_p ? f : 0)); | 6978 | foreach_window (f, freeze_window_start, (void *) (freeze_p ? f : 0)); |
| 7085 | } | 6979 | } |
| @@ -7093,9 +6987,7 @@ freeze_window_starts (f, freeze_p) | |||
| 7093 | describe the same state of affairs. This is used by Fequal. */ | 6987 | describe the same state of affairs. This is used by Fequal. */ |
| 7094 | 6988 | ||
| 7095 | int | 6989 | int |
| 7096 | compare_window_configurations (c1, c2, ignore_positions) | 6990 | compare_window_configurations (Lisp_Object c1, Lisp_Object c2, int ignore_positions) |
| 7097 | Lisp_Object c1, c2; | ||
| 7098 | int ignore_positions; | ||
| 7099 | { | 6991 | { |
| 7100 | register struct save_window_data *d1, *d2; | 6992 | register struct save_window_data *d1, *d2; |
| 7101 | struct Lisp_Vector *sw1, *sw2; | 6993 | struct Lisp_Vector *sw1, *sw2; |
| @@ -7221,7 +7113,7 @@ and scrolling positions. */) | |||
| 7221 | } | 7113 | } |
| 7222 | 7114 | ||
| 7223 | void | 7115 | void |
| 7224 | init_window_once () | 7116 | init_window_once (void) |
| 7225 | { | 7117 | { |
| 7226 | struct frame *f = make_initial_frame (); | 7118 | struct frame *f = make_initial_frame (); |
| 7227 | XSETFRAME (selected_frame, f); | 7119 | XSETFRAME (selected_frame, f); |
| @@ -7234,13 +7126,13 @@ init_window_once () | |||
| 7234 | } | 7126 | } |
| 7235 | 7127 | ||
| 7236 | void | 7128 | void |
| 7237 | init_window () | 7129 | init_window (void) |
| 7238 | { | 7130 | { |
| 7239 | Vwindow_list = Qnil; | 7131 | Vwindow_list = Qnil; |
| 7240 | } | 7132 | } |
| 7241 | 7133 | ||
| 7242 | void | 7134 | void |
| 7243 | syms_of_window () | 7135 | syms_of_window (void) |
| 7244 | { | 7136 | { |
| 7245 | Qscroll_up = intern_c_string ("scroll-up"); | 7137 | Qscroll_up = intern_c_string ("scroll-up"); |
| 7246 | staticpro (&Qscroll_up); | 7138 | staticpro (&Qscroll_up); |
| @@ -7449,7 +7341,7 @@ frame to be redrawn only if it is a tty frame. */); | |||
| 7449 | } | 7341 | } |
| 7450 | 7342 | ||
| 7451 | void | 7343 | void |
| 7452 | keys_of_window () | 7344 | keys_of_window (void) |
| 7453 | { | 7345 | { |
| 7454 | initial_define_key (control_x_map, '1', "delete-other-windows"); | 7346 | initial_define_key (control_x_map, '1', "delete-other-windows"); |
| 7455 | initial_define_key (control_x_map, '2', "split-window"); | 7347 | initial_define_key (control_x_map, '2', "split-window"); |