]> git.eshelyaron.com Git - emacs.git/commitdiff
(split-window-horizontally): If size is negative, measure from the right.
authorKarl Heuer <kwzh@gnu.org>
Thu, 18 Aug 1994 21:03:37 +0000 (21:03 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 18 Aug 1994 21:03:37 +0000 (21:03 +0000)
lisp/window.el

index bab282a265c1fdc0d8eba8602dd27b5b7d16e9ca..4ebe8b50e41d7671fa1efea58f62266589a89000 100644 (file)
@@ -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."