aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.c
diff options
context:
space:
mode:
authorRichard M. Stallman1996-08-23 06:20:58 +0000
committerRichard M. Stallman1996-08-23 06:20:58 +0000
commita59fed7e23bf7cb49020dbc818e219bf3050eed7 (patch)
treefa3351e7d7dcf141c92274e24b6dc4c958f98b06 /src/window.c
parentfed7afa1013e656a01e1ba2513ae8ebdabb95e43 (diff)
downloademacs-a59fed7e23bf7cb49020dbc818e219bf3050eed7.tar.gz
emacs-a59fed7e23bf7cb49020dbc818e219bf3050eed7.zip
(Fsplit_window): Treat width just like height;
no special handling for scroll bars.
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/window.c b/src/window.c
index 1605203e70d..41fc8f73075 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2324,8 +2324,6 @@ and put SIZE columns in the first of the pair.")
2324 register struct window *o, *p; 2324 register struct window *o, *p;
2325 FRAME_PTR fo; 2325 FRAME_PTR fo;
2326 register int size_int; 2326 register int size_int;
2327 int internal_width;
2328 int separator_width = 1;
2329 2327
2330 if (NILP (window)) 2328 if (NILP (window))
2331 window = selected_window; 2329 window = selected_window;
@@ -2334,16 +2332,14 @@ and put SIZE columns in the first of the pair.")
2334 2332
2335 o = XWINDOW (window); 2333 o = XWINDOW (window);
2336 fo = XFRAME (WINDOW_FRAME (o)); 2334 fo = XFRAME (WINDOW_FRAME (o));
2337 if (FRAME_HAS_VERTICAL_SCROLL_BARS (fo)) 2335 width = XFASTINT (o->width);
2338 separator_width = FRAME_SCROLL_BAR_COLS (fo);
2339 internal_width = window_internal_width (o);
2340 2336
2341 if (NILP (size)) 2337 if (NILP (size))
2342 { 2338 {
2343 if (!NILP (horflag)) 2339 if (!NILP (horflag))
2344 /* Calculate the size of the left-hand window, by dividing 2340 /* Calculate the size of the left-hand window, by dividing
2345 the usable space in columns by two. */ 2341 the usable space in columns by two. */
2346 size_int = (internal_width - separator_width) >> 1; 2342 size_int = XFASTINT (o->width) >> 1;
2347 else 2343 else
2348 size_int = XFASTINT (o->height) >> 1; 2344 size_int = XFASTINT (o->height) >> 1;
2349 } 2345 }
@@ -2379,9 +2375,10 @@ and put SIZE columns in the first of the pair.")
2379 { 2375 {
2380 if (size_int < window_min_width) 2376 if (size_int < window_min_width)
2381 error ("Window width %d too small (after splitting)", size_int); 2377 error ("Window width %d too small (after splitting)", size_int);
2382 if (internal_width - size_int - separator_width < window_min_width) 2378
2379 if (size_int + window_min_width > XFASTINT (o->width))
2383 error ("Window width %d too small (after splitting)", 2380 error ("Window width %d too small (after splitting)",
2384 internal_width - size_int - separator_width); 2381 XFASTINT (o->width) - size_int);
2385 if (NILP (o->parent) 2382 if (NILP (o->parent)
2386 || NILP (XWINDOW (o->parent)->hchild)) 2383 || NILP (XWINDOW (o->parent)->hchild))
2387 { 2384 {
@@ -2417,8 +2414,7 @@ and put SIZE columns in the first of the pair.")
2417 { 2414 {
2418 p->height = o->height; 2415 p->height = o->height;
2419 p->top = o->top; 2416 p->top = o->top;
2420 size_int += separator_width; 2417 XSETFASTINT (p->width, XFASTINT (o->width) - size_int);
2421 XSETFASTINT (p->width, internal_width - size_int);
2422 XSETFASTINT (o->width, size_int); 2418 XSETFASTINT (o->width, size_int);
2423 XSETFASTINT (p->left, XFASTINT (o->left) + size_int); 2419 XSETFASTINT (p->left, XFASTINT (o->left) + size_int);
2424 } 2420 }