Mercurial > emacs
comparison src/window.c @ 15902:985270efc514
(Fsplit_window): Treat width just like height;
no special handling for scroll bars.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 23 Aug 1996 06:20:58 +0000 |
parents | a272ccf6c225 |
children | 76fb9ea4460f |
comparison
equal
deleted
inserted
replaced
15901:4b6c924dfb89 | 15902:985270efc514 |
---|---|
2322 { | 2322 { |
2323 register Lisp_Object new; | 2323 register Lisp_Object new; |
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; |
2332 else | 2330 else |
2333 CHECK_LIVE_WINDOW (window, 0); | 2331 CHECK_LIVE_WINDOW (window, 0); |
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 } |
2350 else | 2346 else |
2351 { | 2347 { |
2377 } | 2373 } |
2378 else | 2374 else |
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 { |
2388 make_dummy_parent (window); | 2385 make_dummy_parent (window); |
2389 new = o->parent; | 2386 new = o->parent; |
2415 | 2412 |
2416 if (!NILP (horflag)) | 2413 if (!NILP (horflag)) |
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 } |
2425 else | 2421 else |
2426 { | 2422 { |