aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-08-18 21:03:37 +0000
committerKarl Heuer1994-08-18 21:03:37 +0000
commit0ef2c2f2e63e6d5e173b076bca140ef0bc112df3 (patch)
treee49543d9701db83325e78df23babf228d552e577
parent21d5959fe72a01f4f72e1825289944317677b63e (diff)
downloademacs-0ef2c2f2e63e6d5e173b076bca140ef0bc112df3.tar.gz
emacs-0ef2c2f2e63e6d5e173b076bca140ef0bc112df3.zip
(split-window-horizontally): If size is negative, measure from the right.
-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."
124 124
125(defun split-window-horizontally (&optional arg) 125(defun split-window-horizontally (&optional arg)
126 "Split current window into two windows side by side. 126 "Split current window into two windows side by side.
127This window becomes the leftmost of the two, and gets 127This window becomes the leftmost of the two, and gets ARG columns.
128ARG columns. No arg means split equally." 128Negative arg means select the size of the rightmost window instead.
129No arg means split equally."
129 (interactive "P") 130 (interactive "P")
130 (split-window nil (and arg (prefix-numeric-value arg)) t)) 131 (let ((size (and arg (prefix-numeric-value arg))))
132 (and size (< size 0)
133 (setq size (+ (window-width) size)))
134 (split-window nil size t)))
131 135
132(defun enlarge-window-horizontally (arg) 136(defun enlarge-window-horizontally (arg)
133 "Make current window ARG columns wider." 137 "Make current window ARG columns wider."