# HG changeset patch # User Karl Heuer # Date 777243817 0 # Node ID 2a220828695533f38c1f682ab455024e351dde8f # Parent ca09c53c16a61276ff16f94a2be83d248ac4ad9f (split-window-horizontally): If size is negative, measure from the right. diff -r ca09c53c16a6 -r 2a2208286955 lisp/window.el --- 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."