Mercurial > emacs
changeset 8565:2a2208286955
(split-window-horizontally): If size is negative, measure from the right.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 18 Aug 1994 21:03:37 +0000 |
parents | ca09c53c16a6 |
children | ce5ba216927d |
files | lisp/window.el |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/window.el Thu Aug 18 01:08:03 1994 +0000 +++ b/lisp/window.el Thu Aug 18 21:03:37 1994 +0000 @@ -124,10 +124,14 @@ (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."