Mercurial > emacs
comparison lisp/window.el @ 6670:b2c5fca3c10c
(split-window-vertically): If size is negative, measure from bottom.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 05 Apr 1994 00:49:58 +0000 |
parents | 0c0b00572d96 |
children | e068218e992b |
comparison
equal
deleted
inserted
replaced
6669:11db8cd482ad | 6670:b2c5fca3c10c |
---|---|
81 This is convenient on slow terminals, but point can move strangely.") | 81 This is convenient on slow terminals, but point can move strangely.") |
82 | 82 |
83 (defun split-window-vertically (&optional arg) | 83 (defun split-window-vertically (&optional arg) |
84 "Split current window into two windows, one above the other. | 84 "Split current window into two windows, one above the other. |
85 The uppermost window gets ARG lines and the other gets the rest. | 85 The uppermost window gets ARG lines and the other gets the rest. |
86 Negative arg means select the size of the lowermost window instead. | |
86 With no argument, split equally or close to it. | 87 With no argument, split equally or close to it. |
87 Both windows display the same buffer now current. | 88 Both windows display the same buffer now current. |
88 | 89 |
89 If the variable split-window-keep-point is non-nil, both new windows | 90 If the variable split-window-keep-point is non-nil, both new windows |
90 will get the same value of point as the current window. This is often | 91 will get the same value of point as the current window. This is often |
96 value of point can change if the text around point is hidden by the | 97 value of point can change if the text around point is hidden by the |
97 new mode line." | 98 new mode line." |
98 (interactive "P") | 99 (interactive "P") |
99 (let ((old-w (selected-window)) | 100 (let ((old-w (selected-window)) |
100 (old-point (point)) | 101 (old-point (point)) |
102 (size (and arg (prefix-numeric-value arg))) | |
101 new-w bottom switch) | 103 new-w bottom switch) |
102 (setq new-w (split-window nil (and arg (prefix-numeric-value arg)))) | 104 (and size (< size 0) (setq size (+ (window-height) size))) |
105 (setq new-w (split-window nil size)) | |
103 (or split-window-keep-point | 106 (or split-window-keep-point |
104 (progn | 107 (progn |
105 (save-excursion | 108 (save-excursion |
106 (set-buffer (window-buffer)) | 109 (set-buffer (window-buffer)) |
107 (goto-char (window-start)) | 110 (goto-char (window-start)) |