summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-04-05 00:49:58 +0000
committerKarl Heuer <kwzh@gnu.org>1994-04-05 00:49:58 +0000
commitab94bf9f4c627ca4019c786cb6c995655308d789 (patch)
tree9c005a7b7974c328738e0f53828b9bbb2ac1e965 /lisp
parentf8591023f2edd8a1ec8552d83efa5f558bf08680 (diff)
downloademacs-ab94bf9f4c627ca4019c786cb6c995655308d789.tar.gz
(split-window-vertically): If size is negative, measure from bottom.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/window.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/window.el b/lisp/window.el
index 187d01d1cfa..57fadfd5701 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -83,6 +83,7 @@ This is convenient on slow terminals, but point can move strangely.")
(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 @@ new mode line."
(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