aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorKaroly Lorentey2005-11-07 14:56:19 +0000
committerKaroly Lorentey2005-11-07 14:56:19 +0000
commit79c3172f78d56cf88c927fb0ff5c3b30fd676686 (patch)
tree20932caaa9695f3bb29b543f46107319a687308d /src/window.c
parent9684e4c92f12f7c31f5e6fda7742960b403395f6 (diff)
parentfab0d3087eb5215a5d08379ac765af27abc28842 (diff)
downloademacs-79c3172f78d56cf88c927fb0ff5c3b30fd676686.tar.gz
emacs-79c3172f78d56cf88c927fb0ff5c3b30fd676686.zip
Merged from miles@gnu.org--gnu-2005 (patch 149-151, 629-641)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-629 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-631 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-632 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-633 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-634 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-635 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-636 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-637 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-638 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-639 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-640 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-641 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-149 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-150 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-151 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-437
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c128
1 files changed, 72 insertions, 56 deletions
diff --git a/src/window.c b/src/window.c
index 520d5ae8eaa..69cee518ca4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1998,11 +1998,13 @@ window_loop (type, obj, mini, frames)
1998 break; 1998 break;
1999 1999
2000 case GET_LRU_WINDOW: 2000 case GET_LRU_WINDOW:
2001 /* t as arg means consider only full-width windows */ 2001 /* `obj' is an integer encoding a bitvector.
2002 if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (w)) 2002 `obj & 1' means consider only full-width windows.
2003 break; 2003 `obj & 2' means consider also dedicated windows. */
2004 /* Ignore dedicated windows and minibuffers. */ 2004 if (((XINT (obj) & 1) && !WINDOW_FULL_WIDTH_P (w))
2005 if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt)) 2005 || (!(XINT (obj) & 2) && EQ (w->dedicated, Qt))
2006 /* Minibuffer windows are always ignored. */
2007 || MINI_WINDOW_P (w))
2006 break; 2008 break;
2007 if (NILP (best_window) 2009 if (NILP (best_window)
2008 || (XFASTINT (XWINDOW (best_window)->use_time) 2010 || (XFASTINT (XWINDOW (best_window)->use_time)
@@ -2053,9 +2055,9 @@ window_loop (type, obj, mini, frames)
2053 break; 2055 break;
2054 2056
2055 case GET_LARGEST_WINDOW: 2057 case GET_LARGEST_WINDOW:
2056 { 2058 { /* nil `obj' means to ignore dedicated windows. */
2057 /* Ignore dedicated windows and minibuffers. */ 2059 /* Ignore dedicated windows and minibuffers. */
2058 if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt)) 2060 if (MINI_WINDOW_P (w) || (NILP (obj) && EQ (w->dedicated, Qt)))
2059 break; 2061 break;
2060 2062
2061 if (NILP (best_window)) 2063 if (NILP (best_window))
@@ -2149,43 +2151,47 @@ check_all_windows ()
2149 window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt); 2151 window_loop (CHECK_ALL_WINDOWS, Qnil, 1, Qt);
2150} 2152}
2151 2153
2152DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 1, 0, 2154DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 2, 0,
2153 doc: /* Return the window least recently selected or used for display. 2155 doc: /* Return the window least recently selected or used for display.
2154Return a full-width window if possible. 2156Return a full-width window if possible.
2155A minibuffer window is never a candidate. 2157A minibuffer window is never a candidate.
2156A dedicated window is never a candidate, so if all windows are dedicated, 2158A dedicated window is never a candidate, unless DEDICATED is non-nil,
2157the value is nil. 2159 so if all windows are dedicated, the value is nil.
2158If optional argument FRAME is `visible', search all visible frames. 2160If optional argument FRAME is `visible', search all visible frames.
2159If FRAME is 0, search all visible and iconified frames. 2161If FRAME is 0, search all visible and iconified frames.
2160If FRAME is t, search all frames. 2162If FRAME is t, search all frames.
2161If FRAME is nil, search only the selected frame. 2163If FRAME is nil, search only the selected frame.
2162If FRAME is a frame, search only that frame. */) 2164If FRAME is a frame, search only that frame. */)
2163 (frame) 2165 (frame, dedicated)
2164 Lisp_Object frame; 2166 Lisp_Object frame, dedicated;
2165{ 2167{
2166 register Lisp_Object w; 2168 register Lisp_Object w;
2167 /* First try for a window that is full-width */ 2169 /* First try for a window that is full-width */
2168 w = window_loop (GET_LRU_WINDOW, Qt, 0, frame); 2170 w = window_loop (GET_LRU_WINDOW,
2171 NILP (dedicated) ? make_number (1) : make_number (3),
2172 0, frame);
2169 if (!NILP (w) && !EQ (w, selected_window)) 2173 if (!NILP (w) && !EQ (w, selected_window))
2170 return w; 2174 return w;
2171 /* If none of them, try the rest */ 2175 /* If none of them, try the rest */
2172 return window_loop (GET_LRU_WINDOW, Qnil, 0, frame); 2176 return window_loop (GET_LRU_WINDOW,
2177 NILP (dedicated) ? make_number (0) : make_number (2),
2178 0, frame);
2173} 2179}
2174 2180
2175DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 1, 0, 2181DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 2, 0,
2176 doc: /* Return the largest window in area. 2182 doc: /* Return the largest window in area.
2177A minibuffer window is never a candidate. 2183A minibuffer window is never a candidate.
2178A dedicated window is never a candidate, so if all windows are dedicated, 2184A dedicated window is never a candidate unless DEDICATED is non-nil,
2179the value is nil. 2185 so if all windows are dedicated, the value is nil.
2180If optional argument FRAME is `visible', search all visible frames. 2186If optional argument FRAME is `visible', search all visible frames.
2181If FRAME is 0, search all visible and iconified frames. 2187If FRAME is 0, search all visible and iconified frames.
2182If FRAME is t, search all frames. 2188If FRAME is t, search all frames.
2183If FRAME is nil, search only the selected frame. 2189If FRAME is nil, search only the selected frame.
2184If FRAME is a frame, search only that frame. */) 2190If FRAME is a frame, search only that frame. */)
2185 (frame) 2191 (frame, dedicated)
2186 Lisp_Object frame; 2192 Lisp_Object frame, dedicated;
2187{ 2193{
2188 return window_loop (GET_LARGEST_WINDOW, Qnil, 0, 2194 return window_loop (GET_LARGEST_WINDOW, dedicated, 0,
2189 frame); 2195 frame);
2190} 2196}
2191 2197
@@ -3505,15 +3511,17 @@ displayed. */)
3505 if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame)) 3511 if (FRAME_NO_SPLIT_P (NILP (frames) ? f : last_nonminibuf_frame))
3506 { 3512 {
3507 /* Try visible frames first. */ 3513 /* Try visible frames first. */
3508 window = Fget_largest_window (Qvisible); 3514 window = Fget_largest_window (Qvisible, Qt);
3509 /* If that didn't work, try iconified frames. */ 3515 /* If that didn't work, try iconified frames. */
3510 if (NILP (window)) 3516 if (NILP (window))
3511 window = Fget_largest_window (make_number (0)); 3517 window = Fget_largest_window (make_number (0), Qt);
3518#if 0 /* Don't try windows on other displays. */
3512 if (NILP (window)) 3519 if (NILP (window))
3513 window = Fget_largest_window (Qt); 3520 window = Fget_largest_window (Qt, Qt);
3521#endif
3514 } 3522 }
3515 else 3523 else
3516 window = Fget_largest_window (frames); 3524 window = Fget_largest_window (frames, Qt);
3517 3525
3518 /* If we got a tall enough full-width window that can be split, 3526 /* If we got a tall enough full-width window that can be split,
3519 split it. */ 3527 split it. */
@@ -3526,7 +3534,7 @@ displayed. */)
3526 { 3534 {
3527 Lisp_Object upper, lower, other; 3535 Lisp_Object upper, lower, other;
3528 3536
3529 window = Fget_lru_window (frames); 3537 window = Fget_lru_window (frames, Qt);
3530 /* If the LRU window is selected, and big enough, 3538 /* If the LRU window is selected, and big enough,
3531 and can be split, split it. */ 3539 and can be split, split it. */
3532 if (!NILP (window) 3540 if (!NILP (window)
@@ -3535,23 +3543,27 @@ displayed. */)
3535 || EQ (XWINDOW (window)->parent, Qnil)) 3543 || EQ (XWINDOW (window)->parent, Qnil))
3536 && window_height (window) >= window_min_height << 1) 3544 && window_height (window) >= window_min_height << 1)
3537 window = Fsplit_window (window, Qnil, Qnil); 3545 window = Fsplit_window (window, Qnil, Qnil);
3546 else
3547 window = Fget_lru_window (frames, Qnil);
3538 /* If Fget_lru_window returned nil, try other approaches. */ 3548 /* If Fget_lru_window returned nil, try other approaches. */
3539 3549
3540 /* Try visible frames first. */ 3550 /* Try visible frames first. */
3541 if (NILP (window)) 3551 if (NILP (window))
3542 window = Fget_buffer_window (buffer, Qvisible); 3552 window = Fget_buffer_window (buffer, Qvisible);
3543 if (NILP (window)) 3553 if (NILP (window))
3544 window = Fget_largest_window (Qvisible); 3554 window = Fget_largest_window (Qvisible, Qnil);
3545 /* If that didn't work, try iconified frames. */ 3555 /* If that didn't work, try iconified frames. */
3546 if (NILP (window)) 3556 if (NILP (window))
3547 window = Fget_buffer_window (buffer, make_number (0)); 3557 window = Fget_buffer_window (buffer, make_number (0));
3548 if (NILP (window)) 3558 if (NILP (window))
3549 window = Fget_largest_window (make_number (0)); 3559 window = Fget_largest_window (make_number (0), Qnil);
3550 /* Try invisible frames. */ 3560
3561#if 0 /* Don't try frames on other displays. */
3551 if (NILP (window)) 3562 if (NILP (window))
3552 window = Fget_buffer_window (buffer, Qt); 3563 window = Fget_buffer_window (buffer, Qt);
3553 if (NILP (window)) 3564 if (NILP (window))
3554 window = Fget_largest_window (Qt); 3565 window = Fget_largest_window (Qt, Qnil);
3566#endif
3555 /* As a last resort, make a new frame. */ 3567 /* As a last resort, make a new frame. */
3556 if (NILP (window)) 3568 if (NILP (window))
3557 window = Fframe_selected_window (call0 (Vpop_up_frame_function)); 3569 window = Fframe_selected_window (call0 (Vpop_up_frame_function));
@@ -3578,7 +3590,7 @@ displayed. */)
3578 } 3590 }
3579 } 3591 }
3580 else 3592 else
3581 window = Fget_lru_window (Qnil); 3593 window = Fget_lru_window (Qnil, Qnil);
3582 3594
3583 Fset_window_buffer (window, buffer, Qnil); 3595 Fset_window_buffer (window, buffer, Qnil);
3584 return display_buffer_1 (window); 3596 return display_buffer_1 (window);
@@ -3868,15 +3880,16 @@ DEFUN ("enlarge-window", Fenlarge_window, Senlarge_window, 1, 3, "p",
3868 doc: /* Make current window ARG lines bigger. 3880 doc: /* Make current window ARG lines bigger.
3869From program, optional second arg non-nil means grow sideways ARG columns. 3881From program, optional second arg non-nil means grow sideways ARG columns.
3870Interactively, if an argument is not given, make the window one line bigger. 3882Interactively, if an argument is not given, make the window one line bigger.
3883If HORIZONTAL is non-nil, enlarge horizontally instead of vertically.
3871 3884
3872Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size 3885Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size
3873of the siblings above or to the left of the selected window. Only 3886of the siblings above or to the left of the selected window. Only
3874siblings to the right or below are changed. */) 3887siblings to the right or below are changed. */)
3875 (arg, side, preserve_before) 3888 (arg, horizontal, preserve_before)
3876 register Lisp_Object arg, side, preserve_before; 3889 register Lisp_Object arg, horizontal, preserve_before;
3877{ 3890{
3878 CHECK_NUMBER (arg); 3891 CHECK_NUMBER (arg);
3879 enlarge_window (selected_window, XINT (arg), !NILP (side), 3892 enlarge_window (selected_window, XINT (arg), !NILP (horizontal),
3880 !NILP (preserve_before)); 3893 !NILP (preserve_before));
3881 3894
3882 if (! NILP (Vwindow_configuration_change_hook)) 3895 if (! NILP (Vwindow_configuration_change_hook))
@@ -3924,40 +3937,43 @@ window_width (window)
3924 3937
3925 3938
3926#define CURBEG(w) \ 3939#define CURBEG(w) \
3927 *(widthflag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line)) 3940 *(horiz_flag ? &(XWINDOW (w)->left_col) : &(XWINDOW (w)->top_line))
3928 3941
3929#define CURSIZE(w) \ 3942#define CURSIZE(w) \
3930 *(widthflag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines)) 3943 *(horiz_flag ? &(XWINDOW (w)->total_cols) : &(XWINDOW (w)->total_lines))
3944
3931 3945
3946/* Enlarge WINDOW by DELTA.
3947 HORIZ_FLAG nonzero means enlarge it horizontally;
3948 zero means do it vertically.
3932 3949
3933/* Enlarge WINDOW by DELTA. WIDTHFLAG non-zero means 3950 Siblings of the selected window are resized to fulfill the size
3934 increase its width. Siblings of the selected window are resized to 3951 request. If they become too small in the process, they will be
3935 fulfill the size request. If they become too small in the process, 3952 deleted.
3936 they will be deleted.
3937 3953
3938 If PRESERVE_BEFORE is nonzero, that means don't alter 3954 If PRESERVE_BEFORE is nonzero, that means don't alter
3939 the siblings to the left or above WINDOW. */ 3955 the siblings to the left or above WINDOW. */
3940 3956
3941static void 3957static void
3942enlarge_window (window, delta, widthflag, preserve_before) 3958enlarge_window (window, delta, horiz_flag, preserve_before)
3943 Lisp_Object window; 3959 Lisp_Object window;
3944 int delta, widthflag, preserve_before; 3960 int delta, horiz_flag, preserve_before;
3945{ 3961{
3946 Lisp_Object parent, next, prev; 3962 Lisp_Object parent, next, prev;
3947 struct window *p; 3963 struct window *p;
3948 Lisp_Object *sizep; 3964 Lisp_Object *sizep;
3949 int maximum; 3965 int maximum;
3950 int (*sizefun) P_ ((Lisp_Object)) 3966 int (*sizefun) P_ ((Lisp_Object))
3951 = widthflag ? window_width : window_height; 3967 = horiz_flag ? window_width : window_height;
3952 void (*setsizefun) P_ ((Lisp_Object, int, int)) 3968 void (*setsizefun) P_ ((Lisp_Object, int, int))
3953 = (widthflag ? set_window_width : set_window_height); 3969 = (horiz_flag ? set_window_width : set_window_height);
3954 3970
3955 /* Check values of window_min_width and window_min_height for 3971 /* Check values of window_min_width and window_min_height for
3956 validity. */ 3972 validity. */
3957 check_min_window_sizes (); 3973 check_min_window_sizes ();
3958 3974
3959 /* Give up if this window cannot be resized. */ 3975 /* Give up if this window cannot be resized. */
3960 if (window_fixed_size_p (XWINDOW (window), widthflag, 1)) 3976 if (window_fixed_size_p (XWINDOW (window), horiz_flag, 1))
3961 error ("Window is not resizable"); 3977 error ("Window is not resizable");
3962 3978
3963 /* Find the parent of the selected window. */ 3979 /* Find the parent of the selected window. */
@@ -3968,12 +3984,12 @@ enlarge_window (window, delta, widthflag, preserve_before)
3968 3984
3969 if (NILP (parent)) 3985 if (NILP (parent))
3970 { 3986 {
3971 if (widthflag) 3987 if (horiz_flag)
3972 error ("No other window to side of this one"); 3988 error ("No other window to side of this one");
3973 break; 3989 break;
3974 } 3990 }
3975 3991
3976 if (widthflag 3992 if (horiz_flag
3977 ? !NILP (XWINDOW (parent)->hchild) 3993 ? !NILP (XWINDOW (parent)->hchild)
3978 : !NILP (XWINDOW (parent)->vchild)) 3994 : !NILP (XWINDOW (parent)->vchild))
3979 break; 3995 break;
@@ -3999,7 +4015,7 @@ enlarge_window (window, delta, widthflag, preserve_before)
3999 else 4015 else
4000 maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next) 4016 maxdelta = (!NILP (p->next) ? ((*sizefun) (p->next)
4001 - window_min_size (XWINDOW (p->next), 4017 - window_min_size (XWINDOW (p->next),
4002 widthflag, 0, 0)) 4018 horiz_flag, 0, 0))
4003 : (delta = 0)); 4019 : (delta = 0));
4004 } 4020 }
4005 else 4021 else
@@ -4007,11 +4023,11 @@ enlarge_window (window, delta, widthflag, preserve_before)
4007 /* This is a main window followed by a minibuffer. */ 4023 /* This is a main window followed by a minibuffer. */
4008 : !NILP (p->next) ? ((*sizefun) (p->next) 4024 : !NILP (p->next) ? ((*sizefun) (p->next)
4009 - window_min_size (XWINDOW (p->next), 4025 - window_min_size (XWINDOW (p->next),
4010 widthflag, 0, 0)) 4026 horiz_flag, 0, 0))
4011 /* This is a minibuffer following a main window. */ 4027 /* This is a minibuffer following a main window. */
4012 : !NILP (p->prev) ? ((*sizefun) (p->prev) 4028 : !NILP (p->prev) ? ((*sizefun) (p->prev)
4013 - window_min_size (XWINDOW (p->prev), 4029 - window_min_size (XWINDOW (p->prev),
4014 widthflag, 0, 0)) 4030 horiz_flag, 0, 0))
4015 /* This is a frame with only one window, a minibuffer-only 4031 /* This is a frame with only one window, a minibuffer-only
4016 or a minibufferless frame. */ 4032 or a minibufferless frame. */
4017 : (delta = 0)); 4033 : (delta = 0));
@@ -4023,7 +4039,7 @@ enlarge_window (window, delta, widthflag, preserve_before)
4023 delta = maxdelta; 4039 delta = maxdelta;
4024 } 4040 }
4025 4041
4026 if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), widthflag, 0, 0)) 4042 if (XINT (*sizep) + delta < window_min_size (XWINDOW (window), horiz_flag, 0, 0))
4027 { 4043 {
4028 delete_window (window); 4044 delete_window (window);
4029 return; 4045 return;
@@ -4036,11 +4052,11 @@ enlarge_window (window, delta, widthflag, preserve_before)
4036 maximum = 0; 4052 maximum = 0;
4037 for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) 4053 for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
4038 maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), 4054 maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
4039 widthflag, 0, 0); 4055 horiz_flag, 0, 0);
4040 if (! preserve_before) 4056 if (! preserve_before)
4041 for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) 4057 for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
4042 maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), 4058 maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
4043 widthflag, 0, 0); 4059 horiz_flag, 0, 0);
4044 4060
4045 /* If we can get it all from them without deleting them, do so. */ 4061 /* If we can get it all from them without deleting them, do so. */
4046 if (delta <= maximum) 4062 if (delta <= maximum)
@@ -4062,7 +4078,7 @@ enlarge_window (window, delta, widthflag, preserve_before)
4062 { 4078 {
4063 int this_one = ((*sizefun) (next) 4079 int this_one = ((*sizefun) (next)
4064 - window_min_size (XWINDOW (next), 4080 - window_min_size (XWINDOW (next),
4065 widthflag, 0, &fixed_p)); 4081 horiz_flag, 0, &fixed_p));
4066 if (!fixed_p) 4082 if (!fixed_p)
4067 { 4083 {
4068 if (this_one > delta) 4084 if (this_one > delta)
@@ -4084,7 +4100,7 @@ enlarge_window (window, delta, widthflag, preserve_before)
4084 { 4100 {
4085 int this_one = ((*sizefun) (prev) 4101 int this_one = ((*sizefun) (prev)
4086 - window_min_size (XWINDOW (prev), 4102 - window_min_size (XWINDOW (prev),
4087 widthflag, 0, &fixed_p)); 4103 horiz_flag, 0, &fixed_p));
4088 if (!fixed_p) 4104 if (!fixed_p)
4089 { 4105 {
4090 if (this_one > delta) 4106 if (this_one > delta)
@@ -4187,10 +4203,10 @@ enlarge_window (window, delta, widthflag, preserve_before)
4187 int n = 1; 4203 int n = 1;
4188 4204
4189 for (s = w->next; !NILP (s); s = XWINDOW (s)->next) 4205 for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
4190 if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) 4206 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
4191 ++n; 4207 ++n;
4192 for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) 4208 for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
4193 if (!window_fixed_size_p (XWINDOW (s), widthflag, 0)) 4209 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
4194 ++n; 4210 ++n;
4195 4211
4196 delta1 = n * delta; 4212 delta1 = n * delta;