diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-08-18 21:03:37 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-08-18 21:03:37 +0000 |
commit | 5fb260e693a38781c0d9804b1e69cf07a1dd8bb7 (patch) | |
tree | 0e3f0f8270316711085dc44def81e7d01ea71950 /lisp | |
parent | 3662d4ceb430c36f35068285f93c855e57c8103e (diff) | |
download | emacs-5fb260e693a38781c0d9804b1e69cf07a1dd8bb7.tar.gz |
(split-window-horizontally): If size is negative, measure from the right.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/window.el | 10 |
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." |