aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1990-10-22 03:36:55 +0000
committerRichard M. Stallman1990-10-22 03:36:55 +0000
commitc65c168111503be21981c877bc64bd7a6bb37ca3 (patch)
tree6ed150fe464a2cc0982cbd0198a020741183b243
parent7e1335cfe976915c354d7a50a4aba8c599afbb6e (diff)
downloademacs-c65c168111503be21981c877bc64bd7a6bb37ca3.tar.gz
emacs-c65c168111503be21981c877bc64bd7a6bb37ca3.zip
*** empty log message ***
-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."
43 43
44(defun split-window-vertically (&optional arg) 44(defun split-window-vertically (&optional arg)
45 "Split current window into two windows, one above the other. 45 "Split current window into two windows, one above the other.
46This window becomes the uppermost of the two, and gets 46The uppermost window gets ARG lines and the other gets the rest.
47ARG lines. No arg means split equally." 47With no argument, split equally or close to it.
48Both windows display the same buffer now current.
49The new selected window is the one that the current value of point
50appears in.
51
52The value of point can change if the text around point
53is hidden by the new mode line."
48 (interactive "P") 54 (interactive "P")
49 (let ((old-w (selected-window)) 55 (let ((old-w (selected-window))
50 new-w bottom) 56 (old-point (point))
57 new-w bottom switch)
51 (setq new-w (split-window nil (and arg (prefix-numeric-value arg)))) 58 (setq new-w (split-window nil (and arg (prefix-numeric-value arg))))
52 (save-excursion 59 (save-excursion
53 (set-buffer (window-buffer)) 60 (set-buffer (window-buffer))
@@ -59,7 +66,11 @@ ARG lines. No arg means split equally."
59 (vertical-motion -1) 66 (vertical-motion -1)
60 (setq bottom (point))) 67 (setq bottom (point)))
61 (if (<= bottom (point)) 68 (if (<= bottom (point))
62 (set-window-point old-w (1- bottom))))) 69 (set-window-point old-w (1- bottom)))
70 (if (< (window-start new-w) old-point)
71 (progn
72 (set-window-point new-w old-point)
73 (select-window new-w)))))
63 74
64(defun split-window-horizontally (&optional arg) 75(defun split-window-horizontally (&optional arg)
65 "Split current window into two windows side by side. 76 "Split current window into two windows side by side.