diff options
author | Chong Yidong <cyd@gnu.org> | 2011-10-30 09:56:03 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2011-10-30 09:56:03 +0800 |
commit | 2d197ffbe2029b479802528eeaec714df4c8a8f6 (patch) | |
tree | 970da6796e7ba009cd561928f735c2eea41e8f29 | |
parent | 196e41e4aec1a44ec5b6e9bed485185ba872ae67 (diff) | |
download | emacs-2d197ffbe2029b479802528eeaec714df4c8a8f6.tar.gz |
Rename split-window-{above-each-other|split-window-side-by-side}
to split-window-below and split-window-right.
* lisp/window.el (split-window-below, split-window-right): Rename from
split-window-above-each-other and split-window-side-by-side
respectively. All callers changed.
(split-window-sensibly, split-window-sensibly): Use them.
(split-window-keep-point): Doc fix.
* lisp/isearch.el: Add isearch-scroll property to split-window-below
and split-window-right.
* lisp/follow.el (follow-mode):
* lisp/vc/pcvs-util.el (cvs-pop-to-buffer-same-frame):
* lisp/progmodes/ada-xref.el (ada-gdb-application):
* lisp/emulation/vip.el (vip-buffer-in-two-windows):
* lisp/image-dired.el (image-dired-dired-with-window-configuration):
* lisp/dired-x.el (dired-do-find-marked-files):
* lisp/dired.el (dired-pop-to-buffer):
* lisp/bs.el (bs--show-with-configuration):
* lisp/vc/emerge.el (emerge-setup-windows):
* lisp/textmodes/two-column.el (2C-two-columns):
* lisp/textmodes/reftex-toc.el (reftex-toc):
* lisp/progmodes/gdb-mi.el (gdb-setup-windows):
* lisp/progmodes/fortran.el (fortran-window-create):
* lisp/net/newst-treeview.el (newsticker--treeview-window-init):
* lisp/emulation/ws-mode.el (wordstar-C-o-map, wordstar-mode):
* lisp/emulation/tpu-edt.el (tpu-gold-map):
* lisp/emulation/crisp.el (crisp-mode-map):
* lisp/calendar/calendar.el (calendar-basic-setup): Callers changed.
-rw-r--r-- | etc/NEWS | 4 | ||||
-rw-r--r-- | lisp/ChangeLog | 30 | ||||
-rw-r--r-- | lisp/bs.el | 3 | ||||
-rw-r--r-- | lisp/calculator.el | 2 | ||||
-rw-r--r-- | lisp/calendar/calendar.el | 4 | ||||
-rw-r--r-- | lisp/dired-x.el | 2 | ||||
-rw-r--r-- | lisp/dired.el | 4 | ||||
-rw-r--r-- | lisp/emulation/crisp.el | 4 | ||||
-rw-r--r-- | lisp/emulation/edt.el | 2 | ||||
-rw-r--r-- | lisp/emulation/tpu-edt.el | 4 | ||||
-rw-r--r-- | lisp/emulation/vip.el | 2 | ||||
-rw-r--r-- | lisp/emulation/ws-mode.el | 8 | ||||
-rw-r--r-- | lisp/follow.el | 4 | ||||
-rw-r--r-- | lisp/image-dired.el | 5 | ||||
-rw-r--r-- | lisp/isearch.el | 6 | ||||
-rw-r--r-- | lisp/menu-bar.el | 4 | ||||
-rw-r--r-- | lisp/net/newst-treeview.el | 4 | ||||
-rw-r--r-- | lisp/progmodes/ada-xref.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/fortran.el | 2 | ||||
-rw-r--r-- | lisp/progmodes/gdb-mi.el | 6 | ||||
-rw-r--r-- | lisp/talk.el | 2 | ||||
-rw-r--r-- | lisp/textmodes/reftex-toc.el | 4 | ||||
-rw-r--r-- | lisp/textmodes/two-column.el | 2 | ||||
-rw-r--r-- | lisp/tutorial.el | 2 | ||||
-rw-r--r-- | lisp/vc/emerge.el | 6 | ||||
-rw-r--r-- | lisp/vc/pcvs-util.el | 2 | ||||
-rw-r--r-- | lisp/window.el | 85 |
27 files changed, 114 insertions, 91 deletions
@@ -1101,8 +1101,8 @@ selected window, signaling an error otherwise. If nil, another window can be used, e.g. if the selected one is strongly dedicated. *** `split-window-vertically' and `split-window-horizontally' renamed -to `split-window-above-each-other' and `split-window-side-by-side' -respectively. The old names are kept as aliases. +to `split-window-below' and `split-window-right' respectively. +The old names are kept as aliases. *** Display actions diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8309d3256bf..614094aa334 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,33 @@ +2011-10-30 Chong Yidong <cyd@gnu.org> + + * window.el (split-window-below, split-window-right): Rename from + split-window-above-each-other and split-window-side-by-side + respectively. All callers changed. + (split-window-sensibly, split-window-sensibly): Use them. + (split-window-keep-point): Doc fix. + + * isearch.el: Add isearch-scroll property to split-window-below + and split-window-right. + + * follow.el (follow-mode): + * vc/pcvs-util.el (cvs-pop-to-buffer-same-frame): + * progmodes/ada-xref.el (ada-gdb-application): + * emulation/vip.el (vip-buffer-in-two-windows): + * image-dired.el (image-dired-dired-with-window-configuration): + * dired-x.el (dired-do-find-marked-files): + * dired.el (dired-pop-to-buffer): + * bs.el (bs--show-with-configuration): + * vc/emerge.el (emerge-setup-windows): + * textmodes/two-column.el (2C-two-columns): + * textmodes/reftex-toc.el (reftex-toc): + * progmodes/gdb-mi.el (gdb-setup-windows): + * progmodes/fortran.el (fortran-window-create): + * net/newst-treeview.el (newsticker--treeview-window-init): + * emulation/ws-mode.el (wordstar-C-o-map, wordstar-mode): + * emulation/tpu-edt.el (tpu-gold-map): + * emulation/crisp.el (crisp-mode-map): + * calendar/calendar.el (calendar-basic-setup): Callers changed. + 2011-10-29 Chong Yidong <cyd@gnu.org> * subr.el (y-or-n-p): Add code for batch mode (Bug#9818). diff --git a/lisp/bs.el b/lisp/bs.el index 49ffb3f822c..0c32c8b4f19 100644 --- a/lisp/bs.el +++ b/lisp/bs.el @@ -1414,8 +1414,7 @@ for buffer selection." (bs--restore-window-config) (setq bs--window-config-coming-from (current-window-configuration)) (when (> (window-height (selected-window)) 7) - (split-window-vertically) - (other-window 1))) + (select-window (split-window-below)))) (bs-show-in-buffer liste) (bs-message-without-log "%s" (bs--current-config-message))))) diff --git a/lisp/calculator.el b/lisp/calculator.el index 2cc7f5f6569..4a79316d736 100644 --- a/lisp/calculator.el +++ b/lisp/calculator.el @@ -720,7 +720,7 @@ See the documentation for `calculator-mode' for more information." ;; maybe leave two lines for our window because of the normal ;; `raised' modeline in Emacs 21 (select-window - (split-window-vertically + (split-window-below ;; If the modeline might interfere with the calculator buffer, ;; use 3 lines instead. (if (and (fboundp 'face-attr-construct) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 2c38101588c..6fa924dd788 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1330,12 +1330,12 @@ display the generated calendar." ;; the right thing in that case. ;; ;; Is this a wide frame? If so, split it horizontally. - (if (window-splittable-p t) (split-window-horizontally)) + (if (window-splittable-p t) (split-window-right)) (pop-to-buffer calendar-buffer) ;; Has the window already been split vertically? (when (and (not (window-dedicated-p)) (window-full-height-p)) - (let ((win (split-window-vertically))) + (let ((win (split-window-below))) ;; In the upper window, show whatever was visible before. ;; This looks better than using other-buffer. (switch-to-buffer buff) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index aaddc479b2a..4daf313445c 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1259,7 +1259,7 @@ Remaining lines go to bottom-most window. The number of files that can be displayed this way is restricted by the height of the current window and `window-min-height'. -To keep dired buffer displayed, type \\[split-window-vertically] first. +To keep dired buffer displayed, type \\[split-window-below] first. To display just marked files, type \\[delete-other-windows] first." (interactive "P") (dired-simultaneous-find-file (dired-get-marked-files) noselect)) diff --git a/lisp/dired.el b/lisp/dired.el index 3ff86869a78..4e03d61a06e 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2879,7 +2879,7 @@ or \"* [3 files]\"." (window-splittable-p (selected-window))) ;; Try to split the selected window vertically if ;; that's possible. (Bug#1806) - (split-window-vertically)) + (split-window-below)) ;; Otherwise, try to split WINDOW sensibly. (split-window-sensibly window)))) pop-up-frames) @@ -4128,7 +4128,7 @@ instead. ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) -;;;;;; "dired-x" "dired-x.el" "0a19e4cb2cadf007be715af1035c9c36") +;;;;;; "dired-x" "dired-x.el" "ea7c74fbb7dddf43bb85875018cb59ad") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el index 567a57949b3..010e32857c5 100644 --- a/lisp/emulation/crisp.el +++ b/lisp/emulation/crisp.el @@ -71,8 +71,8 @@ (define-key map [(f2) (left)] 'shrink-window-horizontally) (define-key map [(f2) (right)] 'enlarge-window-horizontally) (define-key map [(f2) (up)] 'shrink-window) - (define-key map [(f3) (down)] 'split-window-vertically) - (define-key map [(f3) (right)] 'split-window-horizontally) + (define-key map [(f3) (down)] 'split-window-below) + (define-key map [(f3) (right)] 'split-window-right) (define-key map [(f4)] 'delete-window) (define-key map [(control f4)] 'delete-other-windows) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 68550cc30e2..7ed0255d987 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -2362,7 +2362,7 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>." (edt-bind-gold-key-default "\C-h" 'help-for-help); Just in case. (edt-bind-gold-key-default [f1] 'help-for-help) (edt-bind-gold-key-default [help] 'help-for-help) - (edt-bind-gold-key-default "\C-\\" 'split-window-vertically) + (edt-bind-gold-key-default "\C-\\" 'split-window-below) ;; GOLD bindings for regular keys. (edt-bind-gold-key-default "a" 'edt-key-not-assigned) diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index b4bf47a6504..e2ad5d81d27 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -459,7 +459,7 @@ Otherwise, use `spell-region'." ;; (define-key map "\\" nil) ; \ (define-key map "]" 'blink-matching-open) ; ] (define-key map "^" 'tpu-add-at-bol) ; ^ - (define-key map "_" 'split-window-vertically) ; - + (define-key map "_" 'split-window-below) ; - (define-key map "`" 'what-line) ; ` (define-key map "a" 'tpu-toggle-newline-and-indent) ; a (define-key map "b" 'tpu-next-buffer) ; b @@ -487,7 +487,7 @@ Otherwise, use `spell-region'." (define-key map "y" 'copy-region-as-kill) ; y (define-key map "z" 'suspend-emacs) ; z ;; (define-key map "{" nil) ; { - (define-key map "|" 'split-window-horizontally) ; | + (define-key map "|" 'split-window-right) ; | ;; (define-key map "}" nil) ; } (define-key map "~" 'exchange-point-and-mark) ; ~ (define-key map "\177" 'delete-window) ; <X] diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index 6f4f0ce80ec..a0c6062fb29 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el @@ -1605,7 +1605,7 @@ used. This behavior is controlled by the sign of prefix numeric value." "Show current buffer in two windows." (interactive) (delete-other-windows) - (split-window-vertically nil)) + (split-window-below)) ;; searching diff --git a/lisp/emulation/ws-mode.el b/lisp/emulation/ws-mode.el index 3a205c7c4f0..886b4d6d4c4 100644 --- a/lisp/emulation/ws-mode.el +++ b/lisp/emulation/ws-mode.el @@ -95,9 +95,9 @@ (define-key map "\C-r" 'set-fill-column) (define-key map "\C-u" 'keyboard-quit) (define-key map "wd" 'delete-other-windows) - (define-key map "wh" 'split-window-horizontally) + (define-key map "wh" 'split-window-right) (define-key map "wo" 'other-window) - (define-key map "wv" 'split-window-vertically) + (define-key map "wv" 'split-window-below) map) "") @@ -257,9 +257,9 @@ The key bindings are: C-o r set-fill-column C-o C-u keyboard-quit C-o wd delete-other-windows - C-o wh split-window-horizontally + C-o wh split-window-right C-o wo other-window - C-o wv split-window-vertically + C-o wv split-window-below C-q 0 ws-find-marker-0 C-q 1 ws-find-marker-1 diff --git a/lisp/follow.el b/lisp/follow.el index 37295cc533b..b387427a47f 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -509,7 +509,7 @@ and being able to use 144 lines instead of the normal 72... (your mileage may vary). To split one large window into two side-by-side windows, the commands -`\\[split-window-horizontally]' or \ +`\\[split-window-right]' or \ `M-x follow-delete-other-windows-and-split' can be used. Only windows displayed in the same frame follow each other. @@ -662,7 +662,7 @@ in your `~/.emacs' file, replacing [f7] by your favourite key: (< (prefix-numeric-value arg) 0)))) (start (window-start))) (delete-other-windows) - (split-window-horizontally) + (split-window-right) (if other (progn (other-window 1) diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 5477d01379d..8c151d35ed2 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -782,13 +782,12 @@ calling `image-dired-restore-window-configuration'." (dired dir) (delete-other-windows) (when (not arg) - (split-window-horizontally) + (split-window-right) (setq truncate-lines t) (save-excursion (other-window 1) (switch-to-buffer buf) - (split-window-vertically) - (other-window 1) + (select-window (split-window-below)) (switch-to-buffer buf2) (other-window -2))))) diff --git a/lisp/isearch.el b/lisp/isearch.el index 6bb23916da3..3ffe6e8a656 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -1804,9 +1804,13 @@ Scroll-bar or mode-line events are processed appropriately." ;; Commands which change the window layout (put 'delete-other-windows 'isearch-scroll t) (put 'balance-windows 'isearch-scroll t) +(put 'split-window-right 'isearch-scroll t) +(put 'split-window-below 'isearch-scroll t) +(put 'enlarge-window 'isearch-scroll t) + +;; Aliases for split-window-* (put 'split-window-vertically 'isearch-scroll t) (put 'split-window-horizontally 'isearch-scroll t) -(put 'enlarge-window 'isearch-scroll t) ;; Universal argument commands (put 'universal-argument 'isearch-scroll t) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 75a2d70da5e..23947795112 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -101,13 +101,13 @@ :help ,(purecopy "Make selected window fill whole frame"))) (define-key menu [new-window-on-right] - `(menu-item ,(purecopy "New Window on Right") split-window-side-by-side + `(menu-item ,(purecopy "New Window on Right") split-window-right :enable (and (menu-bar-menu-frame-live-and-visible-p) (menu-bar-non-minibuffer-window-p)) :help ,(purecopy "Make new window on right of selected one"))) (define-key menu [new-window-below] - `(menu-item ,(purecopy "New Window Below") split-window-above-each-other + `(menu-item ,(purecopy "New Window Below") split-window-below :enable (and (menu-bar-menu-frame-live-and-visible-p) (menu-bar-non-minibuffer-window-p)) :help ,(purecopy "Make new window below selected one"))) diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index 37b31130e8b..26dddffb6ed 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -2018,10 +2018,10 @@ POS gives the position where EVENT occurred." (setq newsticker--treeview-windows nil) (setq newsticker--treeview-buffers nil) (delete-other-windows) - (split-window-horizontally newsticker-treeview-treewindow-width) + (split-window-right newsticker-treeview-treewindow-width) (add-to-list 'newsticker--treeview-windows (selected-window) t) (other-window 1) - (split-window-vertically newsticker-treeview-listwindow-height) + (split-window-below newsticker-treeview-listwindow-height) (add-to-list 'newsticker--treeview-windows (selected-window) t) (other-window 1) (add-to-list 'newsticker--treeview-windows (selected-window) t) diff --git a/lisp/progmodes/ada-xref.el b/lisp/progmodes/ada-xref.el index 7751f3e98fc..4a57a1eef67 100644 --- a/lisp/progmodes/ada-xref.el +++ b/lisp/progmodes/ada-xref.el @@ -1438,7 +1438,7 @@ project file." ;; is going to have some relevant information. (if (or (not (string-match "gvd" (comint-arguments cmd 0 0))) (string-match "--tty" cmd)) - (split-window-vertically)) + (split-window-below)) (switch-to-buffer buffer) ))) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index d30b9673d09..fd3d42685f0 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1097,7 +1097,7 @@ See also `fortran-window-create-momentarily'." (scroll-bar-width (- (nth 2 window-edges) (car window-edges) (window-width)))) - (split-window-horizontally (+ fortran-line-length scroll-bar-width))) + (split-window-right (+ fortran-line-length scroll-bar-width))) (other-window 1) (switch-to-buffer " fortran-window-extra" t) (select-window (previous-window)))) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index dde00d753ac..f9ddabf1552 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -4028,7 +4028,7 @@ window is dedicated." (let ((win0 (selected-window)) (win1 (split-window nil ( / ( * (window-height) 3) 4))) (win2 (split-window nil ( / (window-height) 3))) - (win3 (split-window-horizontally))) + (win3 (split-window-right))) (gdb-set-window-buffer (gdb-locals-buffer-name) nil win3) (select-window win2) (set-window-buffer @@ -4041,12 +4041,12 @@ window is dedicated." ;; can't find a source file. (list-buffers-noselect)))) (setq gdb-source-window (selected-window)) - (let ((win4 (split-window-horizontally))) + (let ((win4 (split-window-right))) (gdb-set-window-buffer (gdb-get-buffer-create 'gdb-inferior-io) nil win4)) (select-window win1) (gdb-set-window-buffer (gdb-stack-buffer-name)) - (let ((win5 (split-window-horizontally))) + (let ((win5 (split-window-right))) (gdb-set-window-buffer (if gdb-show-threads-by-default (gdb-threads-buffer-name) (gdb-breakpoints-buffer-name)) diff --git a/lisp/talk.el b/lisp/talk.el index c16255f7742..98c7f6d31ca 100644 --- a/lisp/talk.el +++ b/lisp/talk.el @@ -111,7 +111,7 @@ Select the first of these windows, displaying the first of the buffers." (while (progn (switch-to-buffer (car buffers)) (setq buffers (cdr buffers))) - (split-window-vertically lines-per-buffer) + (split-window-below lines-per-buffer) (other-window 1)) (select-window (frame-first-window frame))) (select-frame old-frame)))) diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 5d691f456f7..37983d17931 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -247,10 +247,10 @@ When called with a raw C-u prefix, rescan the document first." (unless unsplittable (if reftex-toc-split-windows-horizontally - (split-window-horizontally + (split-window-right (floor (* (window-width) reftex-toc-split-windows-fraction))) - (split-window-vertically + (split-window-below (floor (* (window-height) reftex-toc-split-windows-fraction))))) diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 68b858162df..de9ac10d0e9 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -333,7 +333,7 @@ first and the associated buffer to its right." ;; first go to full width, so that we can certainly split into two windows (unless (window-full-width-p) (enlarge-window 99999 t)) - (split-window-horizontally + (split-window-right (max window-min-width (min 2C-window-width (- (frame-width) window-min-width)))) (if (2C-other) diff --git a/lisp/tutorial.el b/lisp/tutorial.el index c57ec33d2e2..be1a12b499b 100644 --- a/lisp/tutorial.el +++ b/lisp/tutorial.el @@ -298,7 +298,7 @@ LEFT and RIGHT are the elements to compare." (isearch-backward [?\C-r]) ;; * MULTIPLE WINDOWS - (split-window-above-each-other [?\C-x ?2]) + (split-window-below [?\C-x ?2]) (scroll-other-window [?\C-\M-v]) (other-window [?\C-x ?o]) (find-file-other-window [?\C-x ?4 ?\C-f]) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index 5435a840ac9..3ba5bcdb90a 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -1354,8 +1354,8 @@ Otherwise, the A or B file present is copied to the output file." (delete-other-windows) (switch-to-buffer merge-buffer) (emerge-refresh-mode-line) - (split-window-vertically) - (split-window-horizontally) + (split-window-below) + (split-window-right) (switch-to-buffer buffer-A) (if pos (goto-char (point-min))) @@ -2121,7 +2121,7 @@ Use C-u l to reset the windows afterward." (delete-other-windows) (let ((temp-buffer-show-function (lambda (buf) - (split-window-vertically) + (split-window-below) (switch-to-buffer buf) (other-window 1)))) (with-output-to-temp-buffer "*Help*" diff --git a/lisp/vc/pcvs-util.el b/lisp/vc/pcvs-util.el index 752016a0392..311841d37a0 100644 --- a/lisp/vc/pcvs-util.el +++ b/lisp/vc/pcvs-util.el @@ -88,7 +88,7 @@ try to split a new window instead." (pop-up-frames nil)) (or (let ((buf (get-buffer-window buf))) (and buf (select-window buf))) (and pop-up-windows - (ignore-errors (select-window (split-window-vertically))) + (ignore-errors (select-window (split-window-below))) (switch-to-buffer buf)) (pop-to-buffer (current-buffer))))) diff --git a/lisp/window.el b/lisp/window.el index 968f47f4f31..e9f3a779785 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -3262,39 +3262,28 @@ frame. The selected window is not changed by this function." ;; I think this should be the default; I think people will prefer it--rms. (defcustom split-window-keep-point t - "If non-nil, \\[split-window-above-each-other] keeps the original point \ -in both children. -This is often more convenient for editing. -If nil, adjust point in each of the two windows to minimize redisplay. -This is convenient on slow terminals, but point can move strangely. - -This option applies only to `split-window-above-each-other' and -functions that call it. `split-window' always keeps the original -point in both children." + "If non-nil, \\[split-window-below] preserves point in the new window. +If nil, adjust point in the two windows to minimize redisplay. +This option applies only to `split-window-below' and functions +that call it. The low-level `split-window' function always keeps +the original point in both windows." :type 'boolean :group 'windows) -(defun split-window-above-each-other (&optional size) - "Split selected window into two windows, one above the other. -The upper window gets SIZE lines and the lower one gets the rest. -SIZE negative means the lower window gets -SIZE lines and the -upper one the rest. With no argument, split windows equally or -close to it. Both windows display the same buffer, now current. - -If the variable `split-window-keep-point' is non-nil, both new -windows will get the same value of point as the selected window. -This is often more convenient for editing. The upper window is -the selected window. - -Otherwise, we choose window starts so as to minimize the amount of -redisplay; this is convenient on slow terminals. 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. - -Regardless of the value of `split-window-keep-point', the upper -window is the original one and the return value is the new, lower -window." +(defun split-window-below (&optional size) + "Split the selected window into two windows, one above the other. +The selected window is above. The newly split-off window is +below, and displays the same buffer. Return the new window. + +If optional argument SIZE is omitted or nil, both windows get the +same height, or close to it. If SIZE is positive, the upper +\(selected) window gets SIZE lines. If SIZE is negative, the +lower (new) window gets -SIZE lines. + +If the variable `split-window-keep-point' is non-nil, both +windows get the same value of point as the selected window. +Otherwise, the window starts are chosen so as to minimize the +amount of redisplay; this is convenient on slow terminals." (interactive "P") (let ((old-window (selected-window)) (old-point (point)) @@ -3328,19 +3317,21 @@ window." (set-window-parameter new-window 'quit-restore quit-restore))) new-window)) -(defalias 'split-window-vertically 'split-window-above-each-other) +(defalias 'split-window-vertically 'split-window-below) -(defun split-window-side-by-side (&optional size) - "Split selected window into two windows side by side. -The selected window becomes the left one and gets SIZE columns. -SIZE negative means the right window gets -SIZE columns. - -SIZE includes the width of the window's scroll bar; if there are -no scroll bars, it includes the width of the divider column to -the window's right, if any. SIZE omitted or nil means split -window equally. +(defun split-window-right (&optional size) + "Split the selected window into two side-by-side windows. +The selected window is on the left. The newly split-off window +is on the right, and displays the same buffer. Return the new +window. -The selected window remains selected. Return the new window." +If optional argument SIZE is omitted or nil, both windows get the +same width, or close to it. If SIZE is positive, the left-hand +\(selected) window gets SIZE columns. If SIZE is negative, the +right-hand (new) window gets -SIZE columns. Here, SIZE includes +the width of the window's scroll bar; if there are no scroll +bars, it includes the width of the divider column to the window's +right, if any." (interactive "P") (let ((old-window (selected-window)) (size (and size (prefix-numeric-value size))) @@ -3355,7 +3346,7 @@ The selected window remains selected. Return the new window." (set-window-parameter new-window 'quit-restore quit-restore))) new-window)) -(defalias 'split-window-horizontally 'split-window-side-by-side) +(defalias 'split-window-horizontally 'split-window-right) ;;; Balancing windows. @@ -4431,11 +4422,11 @@ split." (or (and (window-splittable-p window) ;; Split window vertically. (with-selected-window window - (split-window-vertically))) + (split-window-below))) (and (window-splittable-p window t) ;; Split window horizontally. (with-selected-window window - (split-window-horizontally))) + (split-window-right))) (and (eq window (frame-root-window (window-frame window))) (not (window-minibuffer-p window)) ;; If WINDOW is the only window on its frame and is not the @@ -4444,7 +4435,7 @@ split." (let ((split-height-threshold 0)) (when (window-splittable-p window) (with-selected-window window - (split-window-vertically))))))) + (split-window-below))))))) (defun window--try-to-split-window (window) "Try to split WINDOW. @@ -5741,8 +5732,8 @@ Otherwise, consult the value of `truncate-partial-width-windows' ;; change these. (define-key ctl-x-map "0" 'delete-window) (define-key ctl-x-map "1" 'delete-other-windows) -(define-key ctl-x-map "2" 'split-window-above-each-other) -(define-key ctl-x-map "3" 'split-window-side-by-side) +(define-key ctl-x-map "2" 'split-window-below) +(define-key ctl-x-map "3" 'split-window-right) (define-key ctl-x-map "o" 'other-window) (define-key ctl-x-map "^" 'enlarge-window) (define-key ctl-x-map "}" 'enlarge-window-horizontally) |