changeset 6670:b2c5fca3c10c

(split-window-vertically): If size is negative, measure from bottom.
author Karl Heuer <kwzh@gnu.org>
date Tue, 05 Apr 1994 00:49:58 +0000
parents 11db8cd482ad
children 5b26038687ed
files lisp/window.el
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/window.el	Tue Apr 05 00:28:43 1994 +0000
+++ b/lisp/window.el	Tue Apr 05 00:49:58 1994 +0000
@@ -83,6 +83,7 @@
 (defun split-window-vertically (&optional arg)
   "Split current window into two windows, one above the other.
 The uppermost window gets ARG lines and the other gets the rest.
+Negative arg means select the size of the lowermost window instead.
 With no argument, split equally or close to it.
 Both windows display the same buffer now current.
 
@@ -98,8 +99,10 @@
   (interactive "P")
   (let ((old-w (selected-window))
 	(old-point (point))
+	(size (and arg (prefix-numeric-value arg)))
 	new-w bottom switch)
-    (setq new-w (split-window nil (and arg (prefix-numeric-value arg))))
+    (and size (< size 0) (setq size (+ (window-height) size)))
+    (setq new-w (split-window nil size))
     (or split-window-keep-point
 	(progn
 	  (save-excursion