diff options
| author | Richard M. Stallman | 2005-11-03 21:13:57 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2005-11-03 21:13:57 +0000 |
| commit | 5afc696a3736882d9a1812626542cac16efa651e (patch) | |
| tree | 824cc6a849c70a727c1d62c33569184b2523b6ae /src | |
| parent | acebbab35057b74ddfbd63f241d3efa204fbc643 (diff) | |
| download | emacs-5afc696a3736882d9a1812626542cac16efa651e.tar.gz emacs-5afc696a3736882d9a1812626542cac16efa651e.zip | |
(Fenlarge_window): Rename SIDE to HORIZONTAL.
(enlarge_window): Rename WIDTHFLAG to HORIZ_FLAG.
(CURBEG, CURSIZE): Use HORIZ_FLAG instead of WIDTHFLAG.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/src/window.c b/src/window.c index c49493f37ca..afa852c3b0f 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3872,15 +3872,16 @@ DEFUN ("enlarge-window", Fenlarge_window, Senlarge_window, 1, 3, "p", | |||
| 3872 | doc: /* Make current window ARG lines bigger. | 3872 | doc: /* Make current window ARG lines bigger. |
| 3873 | From program, optional second arg non-nil means grow sideways ARG columns. | 3873 | From program, optional second arg non-nil means grow sideways ARG columns. |
| 3874 | Interactively, if an argument is not given, make the window one line bigger. | 3874 | Interactively, if an argument is not given, make the window one line bigger. |
| 3875 | If HORIZONTAL is non-nil, enlarge horizontally instead of vertically. | ||
| 3875 | 3876 | ||
| 3876 | Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size | 3877 | Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size |
| 3877 | of the siblings above or to the left of the selected window. Only | 3878 | of the siblings above or to the left of the selected window. Only |
| 3878 | siblings to the right or below are changed. */) | 3879 | siblings to the right or below are changed. */) |
| 3879 | (arg, side, preserve_before) | 3880 | (arg, horizontal, preserve_before) |
| 3880 | register Lisp_Object arg, side, preserve_before; | 3881 | register Lisp_Object arg, horizontal, preserve_before; |
| 3881 | { | 3882 | { |
| 3882 | CHECK_NUMBER (arg); | 3883 | CHECK_NUMBER (arg); |
| 3883 | enlarge_window (selected_window, XINT (arg), !NILP (side), | 3884 | enlarge_window (selected_window, XINT (arg), !NILP (horizontal), |
| 3884 | !NILP (preserve_before)); | 3885 | !NILP (preserve_before)); |
| 3885 | 3886 | ||
| 3886 | if (! NILP (Vwindow_configuration_change_hook)) | 3887 | if (! NILP (Vwindow_configuration_change_hook)) |
| @@ -3928,40 +3929,43 @@ window_width (window) | |||
| 3928 | 3929 | ||
| 3929 | 3930 | ||
| 3930 | #define CURBEG(w) \ | 3931 | #define CURBEG(w) \ |
| 3931 | *(widthflag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line)) | 3932 | *(horiz_flag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line)) |
| 3932 | 3933 | ||
| 3933 | #define CURSIZE(w) \ | 3934 | #define CURSIZE(w) \ |
| 3934 | *(widthflag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines)) | 3935 | *(horiz_flag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines)) |
| 3936 | |||
| 3935 | 3937 | ||
| 3938 | /* Enlarge WINDOW by DELTA. | ||
| 3939 | HORIZ_FLAG nonzero means enlarge it horizontally; | ||
| 3940 | zero means do it vertically. | ||
| 3936 | 3941 | ||
| 3937 | /* Enlarge WINDOW by DELTA. WIDTHFLAG non-zero means | 3942 | Siblings of the selected window are resized to fulfill the size |
| 3938 | increase its width. Siblings of the selected window are resized to | 3943 | request. If they become too small in the process, they will be |
| 3939 | fulfill the size request. If they become too small in the process, | 3944 | deleted. |
| 3940 | they will be deleted. | ||
| 3941 | 3945 | ||
| 3942 | If PRESERVE_BEFORE is nonzero, that means don't alter | 3946 | If PRESERVE_BEFORE is nonzero, that means don't alter |
| 3943 | the siblings to the left or above WINDOW. */ | 3947 | the siblings to the left or above WINDOW. */ |
| 3944 | 3948 | ||
| 3945 | static void | 3949 | static void |
| 3946 | enlarge_window (window, delta, widthflag, preserve_before) | 3950 | enlarge_window (window, delta, horiz_flag, preserve_before) |
| 3947 | Lisp_Object window; | 3951 | Lisp_Object window; |
| 3948 | int delta, widthflag, preserve_before; | 3952 | int delta, horiz_flag, preserve_before; |
| 3949 | { | 3953 | { |
| 3950 | Lisp_Object parent, next, prev; | 3954 | Lisp_Object parent, next, prev; |
| 3951 | struct window *p; | 3955 | struct window *p; |
| 3952 | Lisp_Object *sizep; | 3956 | Lisp_Object *sizep; |
| 3953 | int maximum; | 3957 | int maximum; |
| 3954 | int (*sizefun) P_ ((Lisp_Object)) | 3958 | int (*sizefun) P_ ((Lisp_Object)) |
| 3955 | = widthflag ? window_width : window_height; | 3959 | = horiz_flag ? window_width : window_height; |
| 3956 | void (*setsizefun) P_ ((Lisp_Object, int, int)) | 3960 | void (*setsizefun) P_ ((Lisp_Object, int, int)) |
| 3957 | = (widthflag ? set_window_width : set_window_height); | 3961 | = (horiz_flag ? set_window_width : set_window_height); |
| 3958 | 3962 | ||
| 3959 | /* Check values of window_min_width and window_min_height for | 3963 | /* Check values of window_min_width and window_min_height for |
| 3960 | validity. */ | 3964 | validity. */ |
| 3961 | check_min_window_sizes (); | 3965 | check_min_window_sizes (); |
| 3962 | 3966 | ||
| 3963 | /* Give up if this window cannot be resized. */ | 3967 | /* Give up if this window cannot be resized. */ |
| 3964 | if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) | 3968 | if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1)) |
| 3965 | error ("Window is not resizable"); | 3969 | error ("Window is not resizable"); |
| 3966 | 3970 | ||
| 3967 | /* Find the parent of the selected window. */ | 3971 | /* Find the parent of the selected window. */ |
| @@ -3972,12 +3976,12 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 3972 | 3976 | ||
| 3973 | if (NILP (parent)) | 3977 | if (NILP (parent)) |
| 3974 | { | 3978 | { |
| 3975 | if (widthflag) | 3979 | if (horiz_flag) |
| 3976 | error ("No other window to side of this one"); | 3980 | error ("No other window to side of this one"); |
| 3977 | break; | 3981 | break; |
| 3978 | } | 3982 | } |
| 3979 | 3983 | ||
| 3980 | if (widthflag | 3984 | if (horiz_flag |
| 3981 | ? !NILP (XWINDOW (parent)->hchild) | 3985 | ? !NILP (XWINDOW (parent)->hchild) |
| 3982 | : !NILP (XWINDOW (parent)->vchild)) | 3986 | : !NILP (XWINDOW (parent)->vchild)) |
| 3983 | break; | 3987 | break; |
| @@ -4003,7 +4007,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4003 | else | 4007 | else |
| 4004 | maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next) | 4008 | maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next) |
| 4005 | - window_min_size (XWINDOW (p->next), | 4009 | - window_min_size (XWINDOW (p->next), |
| 4006 | widthflag, 0, 0)) | 4010 | horiz_flag, 0, 0)) |
| 4007 | : (delta = 0)); | 4011 | : (delta = 0)); |
| 4008 | } | 4012 | } |
| 4009 | else | 4013 | else |
| @@ -4011,11 +4015,11 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4011 | /* This is a main window followed by a minibuffer. */ | 4015 | /* This is a main window followed by a minibuffer. */ |
| 4012 | : !NILP (p->next) ? ((*sizefun) (p->next) | 4016 | : !NILP (p->next) ? ((*sizefun) (p->next) |
| 4013 | - window_min_size (XWINDOW (p->next), | 4017 | - window_min_size (XWINDOW (p->next), |
| 4014 | widthflag, 0, 0)) | 4018 | horiz_flag, 0, 0)) |
| 4015 | /* This is a minibuffer following a main window. */ | 4019 | /* This is a minibuffer following a main window. */ |
| 4016 | : !NILP (p->prev) ? ((*sizefun) (p->prev) | 4020 | : !NILP (p->prev) ? ((*sizefun) (p->prev) |
| 4017 | - window_min_size (XWINDOW (p->prev), | 4021 | - window_min_size (XWINDOW (p->prev), |
| 4018 | widthflag, 0, 0)) | 4022 | horiz_flag, 0, 0)) |
| 4019 | /* This is a frame with only one window, a minibuffer-only | 4023 | /* This is a frame with only one window, a minibuffer-only |
| 4020 | or a minibufferless frame. */ | 4024 | or a minibufferless frame. */ |
| 4021 | : (delta = 0)); | 4025 | : (delta = 0)); |
| @@ -4027,7 +4031,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4027 | delta = maxdelta; | 4031 | delta = maxdelta; |
| 4028 | } | 4032 | } |
| 4029 | 4033 | ||
| 4030 | if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 0, 0)) | 4034 | if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), horiz_flag, 0, 0)) |
| 4031 | { | 4035 | { |
| 4032 | delete_window (window); | 4036 | delete_window (window); |
| 4033 | return; | 4037 | return; |
| @@ -4040,11 +4044,11 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4040 | maximum = 0; | 4044 | maximum = 0; |
| 4041 | for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) | 4045 | for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) |
| 4042 | maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), | 4046 | maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), |
| 4043 | widthflag, 0, 0); | 4047 | horiz_flag, 0, 0); |
| 4044 | if (! preserve_before) | 4048 | if (! preserve_before) |
| 4045 | for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) | 4049 | for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) |
| 4046 | maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), | 4050 | maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), |
| 4047 | widthflag, 0, 0); | 4051 | horiz_flag, 0, 0); |
| 4048 | 4052 | ||
| 4049 | /* If we can get it all from them without deleting them, do so. */ | 4053 | /* If we can get it all from them without deleting them, do so. */ |
| 4050 | if (delta <= maximum) | 4054 | if (delta <= maximum) |
| @@ -4066,7 +4070,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4066 | { | 4070 | { |
| 4067 | int this_one = ((*sizefun) (next) | 4071 | int this_one = ((*sizefun) (next) |
| 4068 | - window_min_size (XWINDOW (next), | 4072 | - window_min_size (XWINDOW (next), |
| 4069 | widthflag, 0, &fixed_p)); | 4073 | horiz_flag, 0, &fixed_p)); |
| 4070 | if (!fixed_p) | 4074 | if (!fixed_p) |
| 4071 | { | 4075 | { |
| 4072 | if (this_one > delta) | 4076 | if (this_one > delta) |
| @@ -4088,7 +4092,7 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4088 | { | 4092 | { |
| 4089 | int this_one = ((*sizefun) (prev) | 4093 | int this_one = ((*sizefun) (prev) |
| 4090 | - window_min_size (XWINDOW (prev), | 4094 | - window_min_size (XWINDOW (prev), |
| 4091 | widthflag, 0, &fixed_p)); | 4095 | horiz_flag, 0, &fixed_p)); |
| 4092 | if (!fixed_p) | 4096 | if (!fixed_p) |
| 4093 | { | 4097 | { |
| 4094 | if (this_one > delta) | 4098 | if (this_one > delta) |
| @@ -4191,10 +4195,10 @@ enlarge_window (window, delta, widthflag, preserve_before) | |||
| 4191 | int n = 1; | 4195 | int n = 1; |
| 4192 | 4196 | ||
| 4193 | for (s = w->next; !NILP (s); s = XWINDOW (s)->next) | 4197 | for (s = w->next; !NILP (s); s = XWINDOW (s)->next) |
| 4194 | if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) | 4198 | if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) |
| 4195 | ++n; | 4199 | ++n; |
| 4196 | for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) | 4200 | for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) |
| 4197 | if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) | 4201 | if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) |
| 4198 | ++n; | 4202 | ++n; |
| 4199 | 4203 | ||
| 4200 | delta1 = n * delta; | 4204 | delta1 = n * delta; |