summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-08-18 21:03:37 +0000
committerKarl Heuer <kwzh@gnu.org>1994-08-18 21:03:37 +0000
commit5fb260e693a38781c0d9804b1e69cf07a1dd8bb7 (patch)
tree0e3f0f8270316711085dc44def81e7d01ea71950 /lisp/window.el
parent3662d4ceb430c36f35068285f93c855e57c8103e (diff)
downloademacs-5fb260e693a38781c0d9804b1e69cf07a1dd8bb7.tar.gz
(split-window-horizontally): If size is negative, measure from the right.
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/window.el b/lisp/window.el
index bab282a265c..4ebe8b50e41 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -124,10 +124,14 @@ new mode line."
(defun split-window-horizontally (&optional arg)
"Split current window into two windows side by side.
-This window becomes the leftmost of the two, and gets
-ARG columns. No arg means split equally."
+This window becomes the leftmost of the two, and gets ARG columns.
+Negative arg means select the size of the rightmost window instead.
+No arg means split equally."
(interactive "P")
- (split-window nil (and arg (prefix-numeric-value arg)) t))
+ (let ((size (and arg (prefix-numeric-value arg))))
+ (and size (< size 0)
+ (setq size (+ (window-width) size)))
+ (split-window nil size t)))
(defun enlarge-window-horizontally (arg)
"Make current window ARG columns wider."