summaryrefslogtreecommitdiff
path: root/lisp/window.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1990-10-22 03:36:55 +0000
committerRichard M. Stallman <rms@gnu.org>1990-10-22 03:36:55 +0000
commit1fdd1ee0ac1f370180a60f3def584611aef6cc56 (patch)
tree4077c618d9d8fc6d12dc4e33981b9c48d59d09c8 /lisp/window.el
parent867196958129b6a2def047e4610067be20bb29d4 (diff)
downloademacs-1fdd1ee0ac1f370180a60f3def584611aef6cc56.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/window.el')
-rw-r--r--lisp/window.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/window.el b/lisp/window.el
index ce1c0e566c9..f16d8942824 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -43,11 +43,18 @@ even if it is active."
(defun split-window-vertically (&optional arg)
"Split current window into two windows, one above the other.
-This window becomes the uppermost of the two, and gets
-ARG lines. No arg means split equally."
+The uppermost window gets ARG lines and the other gets the rest.
+With no argument, split equally or close to it.
+Both windows display the same buffer now current.
+The new selected window is the one that the current value of point
+appears in.
+
+The value of point can change if the text around point
+is hidden by the new mode line."
(interactive "P")
(let ((old-w (selected-window))
- new-w bottom)
+ (old-point (point))
+ new-w bottom switch)
(setq new-w (split-window nil (and arg (prefix-numeric-value arg))))
(save-excursion
(set-buffer (window-buffer))
@@ -59,7 +66,11 @@ ARG lines. No arg means split equally."
(vertical-motion -1)
(setq bottom (point)))
(if (<= bottom (point))
- (set-window-point old-w (1- bottom)))))
+ (set-window-point old-w (1- bottom)))
+ (if (< (window-start new-w) old-point)
+ (progn
+ (set-window-point new-w old-point)
+ (select-window new-w)))))
(defun split-window-horizontally (&optional arg)
"Split current window into two windows side by side.