diff options
| author | Karl Heuer | 1994-08-18 21:03:37 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-08-18 21:03:37 +0000 |
| commit | 0ef2c2f2e63e6d5e173b076bca140ef0bc112df3 (patch) | |
| tree | e49543d9701db83325e78df23babf228d552e577 | |
| parent | 21d5959fe72a01f4f72e1825289944317677b63e (diff) | |
| download | emacs-0ef2c2f2e63e6d5e173b076bca140ef0bc112df3.tar.gz emacs-0ef2c2f2e63e6d5e173b076bca140ef0bc112df3.zip | |
(split-window-horizontally): If size is negative, measure from the right.
| -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." | |||
| 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. |
| 127 | This window becomes the leftmost of the two, and gets | 127 | This window becomes the leftmost of the two, and gets ARG columns. |
| 128 | ARG columns. No arg means split equally." | 128 | Negative arg means select the size of the rightmost window instead. |
| 129 | No 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." |