diff options
| author | Martin Rudalics | 2011-11-16 11:10:40 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2011-11-16 11:10:40 +0100 |
| commit | b6f6789018b0bd41368126cfb45307334d6ff4d6 (patch) | |
| tree | eb2f35085b12fa731c3dcfdb82ac97abafc913a7 | |
| parent | ce7ddba00114b8876179e87c222fd8697da19ac0 (diff) | |
| download | emacs-b6f6789018b0bd41368126cfb45307334d6ff4d6.tar.gz emacs-b6f6789018b0bd41368126cfb45307334d6ff4d6.zip | |
Rename window-nest to window-combination-limit.
* window.h (window): Rename slot "nest" to "combination_limit".
* window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
(Fset_window_nest): Rename to Fset_window_combination_limit.
(Vwindow_nest): Rename to Vwindow_combination_limit.
(recombine_windows, make_parent_window, make_window)
(Fsplit_window_internal, saved_window)
(Fset_window_configuration, save_window_save): Rename all
occurrences of window_nest to window_combination_limit.
* window.el (split-window, window-state-get-1)
(window-state-put-1, window-state-put-2): Rename occurrences of
window-nest to window-combination-limit.
* cus-start.el (window-nest): Rename to
window-combination-limit.
* windows.texi (Resizing Windows, Splitting Windows): Rename
occurrences of window-nest to window-combination-limit.
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 89 | ||||
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/cus-start.el | 2 | ||||
| -rw-r--r-- | lisp/window.el | 36 | ||||
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/window.c | 88 | ||||
| -rw-r--r-- | src/window.h | 5 |
8 files changed, 141 insertions, 103 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1e7f0529bd5..3ca675a2144 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2011-11-16 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * windows.texi (Resizing Windows, Splitting Windows): Rename | ||
| 4 | occurrences of window-nest to window-combination-limit. | ||
| 5 | |||
| 1 | 2011-11-14 Juanma Barranquero <lekktu@gmail.com> | 6 | 2011-11-14 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 7 | ||
| 3 | * intro.texi (Lisp History): Fix typo. | 8 | * intro.texi (Lisp History): Fix typo. |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index b6bacc27684..6c5247bd144 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -632,11 +632,12 @@ the window cannot be resized as demanded, an error is signaled. | |||
| 632 | The optional argument @var{ignore} has the same meaning as for the | 632 | The optional argument @var{ignore} has the same meaning as for the |
| 633 | function @code{window-resizable} above. | 633 | function @code{window-resizable} above. |
| 634 | 634 | ||
| 635 | The choice of which window edge this function alters depends on the | 635 | The choice of which window edges this function alters depends on the |
| 636 | splitting and nesting status of the involved windows; in some cases, | 636 | values of the option @code{window-splits} and the combination-limit |
| 637 | it may alter both edges. @xref{Splitting Windows}. To resize by | 637 | status of the involved windows; in some cases, it may alter both edges. |
| 638 | moving only the bottom or right edge of a window, use the function | 638 | @xref{Splitting Windows}. To resize by moving only the bottom or right |
| 639 | @code{adjust-window-trailing-edge}, below. | 639 | edge of a window, use the function @code{adjust-window-trailing-edge}, |
| 640 | below. | ||
| 640 | @end defun | 641 | @end defun |
| 641 | 642 | ||
| 642 | @c The commands enlarge-window, enlarge-window-horizontally, | 643 | @c The commands enlarge-window, enlarge-window-horizontally, |
| @@ -859,8 +860,8 @@ Also if this variable is non-@code{nil}, subsequent resizing and | |||
| 859 | deleting @var{window} will usually affect @emph{all} windows in | 860 | deleting @var{window} will usually affect @emph{all} windows in |
| 860 | @var{window}'s combination. | 861 | @var{window}'s combination. |
| 861 | 862 | ||
| 862 | The setting of this variable has no effect if @code{window-nest} (see | 863 | The setting of this variable has no effect if |
| 863 | below) is non-@code{nil}. | 864 | @code{window-combination-limit} (see below) is non-@code{nil}. |
| 864 | @end defopt | 865 | @end defopt |
| 865 | 866 | ||
| 866 | To illustrate the use of @code{window-splits} consider the following | 867 | To illustrate the use of @code{window-splits} consider the following |
| @@ -931,34 +932,36 @@ height: | |||
| 931 | @end group | 932 | @end group |
| 932 | @end smallexample | 933 | @end smallexample |
| 933 | 934 | ||
| 934 | @defopt window-nest | 935 | @defopt window-combination-limit |
| 935 | If this variable is @code{nil}, @code{split-window} creates a new parent | 936 | If this variable is @code{nil}, @code{split-window} creates a new parent |
| 936 | window if and only if the old window has no parent window or shall be | 937 | window if and only if the old window has no parent window or shall be |
| 937 | split orthogonally to the combination it is part of. If this variable | 938 | split orthogonally to the combination it is part of. If this variable |
| 938 | is non-@code{nil}, @code{split-window} always creates a new parent | 939 | is @code{t}, @code{split-window} always creates a new parent window. If |
| 939 | window. If this variable is always non-@code{nil}, a frame's window | 940 | this variable is always @code{t}, a frame's window tree is a binary tree |
| 940 | tree is a binary tree so every window but the frame's root window has | 941 | so every window but the frame's root window has exactly one sibling. |
| 941 | exactly one sibling. | 942 | Other values are reserved for future use. |
| 942 | 943 | ||
| 943 | The value of this variable is also assigned to the nest status of the | 944 | The value of this variable is also assigned to the combination-limit |
| 944 | new parent window. The nest status of any window can be retrieved via | 945 | status of the new parent window. The combination-limit status of any |
| 945 | the function @code{window-nest} and altered by the function | 946 | window can be retrieved via the function @code{window-combination-limit} |
| 946 | @code{set-window-nest}, see below. | 947 | and altered by the function @code{set-window-combination-limit}, see |
| 948 | below. | ||
| 947 | @end defopt | 949 | @end defopt |
| 948 | 950 | ||
| 949 | @defun window-nest &optional window | 951 | @defun window-combination-limit &optional window |
| 950 | This function returns the nest status of @var{window}. The argument | 952 | This function returns the combination-limit status of @var{window}. The |
| 951 | @var{window} can be any window and defaults to the selected one. Note, | 953 | argument @var{window} can be any window and defaults to the selected |
| 952 | however, that the nest status is currently meaningful for internal | 954 | one. Note, however, that the combination-limit status is currently |
| 953 | windows only. | 955 | meaningful for internal windows only. |
| 954 | 956 | ||
| 955 | @cindex nest status | 957 | @cindex combination-limit status |
| 956 | The @dfn{nest status} of a window specifies whether that window may be | 958 | The @dfn{combination-limit status} of a window specifies whether that |
| 957 | removed and its child windows recombined with that window's siblings | 959 | window may be removed and its child windows recombined with that |
| 958 | when such a sibling's child window is deleted. The nest status is | 960 | window's siblings when such a sibling's child window is deleted. The |
| 959 | initially assigned by @code{split-window} from the current value of the | 961 | combination-limit status is initially assigned by @code{split-window} |
| 960 | variable @code{window-nest} (see above) and can be reset by the function | 962 | from the current value of the variable @code{window-combination-limit} |
| 961 | @code{set-window-nest} (see below). | 963 | (see above) and can be reset by the function |
| 964 | @code{set-window-combination-limit} (see below). | ||
| 962 | 965 | ||
| 963 | If the return value is @code{nil}, child windows of @var{window} may be | 966 | If the return value is @code{nil}, child windows of @var{window} may be |
| 964 | recombined with @var{window}'s siblings when a window gets deleted. A | 967 | recombined with @var{window}'s siblings when a window gets deleted. A |
| @@ -966,16 +969,17 @@ return value of @code{nil} means that child windows of @var{window} are | |||
| 966 | never (re-)combined with @var{window}'s siblings in such a case. | 969 | never (re-)combined with @var{window}'s siblings in such a case. |
| 967 | @end defun | 970 | @end defun |
| 968 | 971 | ||
| 969 | @defun set-window-nest window &optional status | 972 | @defun set-window-combination-limit window &optional status |
| 970 | This functions sets the nest status (see above) of @var{window} to | 973 | This functions sets the combination-limit status (see above) of |
| 971 | @var{status}. The argument @var{window} can be any window and defaults | 974 | @var{window} to @var{status}. The argument @var{window} can be any |
| 972 | to the selected one. Note that setting the nest status is meaningful | 975 | window and defaults to the selected one. Note that setting the |
| 973 | for internal windows only. The return value is @var{status}. | 976 | combination-limit status is meaningful for internal windows only. The |
| 977 | return value is @var{status}. | ||
| 974 | @end defun | 978 | @end defun |
| 975 | 979 | ||
| 976 | To illustrate the use of @code{window-nest} consider the following | 980 | To illustrate the use of @code{window-combination-limit} consider the |
| 977 | configuration (throughout the following examples we shall assume that | 981 | following configuration (throughout the following examples we shall |
| 978 | @code{window-splits} invariantly is @code{nil}). | 982 | assume that @code{window-splits} invariantly is @code{nil}). |
| 979 | @smallexample | 983 | @smallexample |
| 980 | @group | 984 | @group |
| 981 | ______________________________________ | 985 | ______________________________________ |
| @@ -997,7 +1001,8 @@ configuration (throughout the following examples we shall assume that | |||
| 997 | @end smallexample | 1001 | @end smallexample |
| 998 | 1002 | ||
| 999 | Splitting @code{W2} into two windows above each other with | 1003 | Splitting @code{W2} into two windows above each other with |
| 1000 | @code{window-nest} equal @code{nil} will get you a configuration like: | 1004 | @code{window-combination-limit} equal @code{nil} will get you a |
| 1005 | configuration like: | ||
| 1001 | @smallexample | 1006 | @smallexample |
| 1002 | @group | 1007 | @group |
| 1003 | ______________________________________ | 1008 | ______________________________________ |
| @@ -1064,9 +1069,9 @@ follows: | |||
| 1064 | 1069 | ||
| 1065 | Hence, with respect to the initial configuration, window @code{W2} has | 1070 | Hence, with respect to the initial configuration, window @code{W2} has |
| 1066 | grown at the expense of window @code{W3}. If, however, in the initial | 1071 | grown at the expense of window @code{W3}. If, however, in the initial |
| 1067 | configuration you had split @code{W2} with @code{window-nest} bound to | 1072 | configuration you had split @code{W2} with |
| 1068 | @code{t}, a new internal window @code{W5} would have been created as | 1073 | @code{window-combination-limit} bound to @code{t}, a new internal window |
| 1069 | depicted below. | 1074 | @code{W5} would have been created as depicted below. |
| 1070 | @smallexample | 1075 | @smallexample |
| 1071 | @group | 1076 | @group |
| 1072 | ______________________________________ | 1077 | ______________________________________ |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e4a9be99d5c..df356fbbfc0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2011-11-16 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.el (split-window, window-state-get-1) | ||
| 4 | (window-state-put-1, window-state-put-2): Rename occurrences of | ||
| 5 | window-nest to window-combination-limit. | ||
| 6 | * cus-start.el (window-nest): Rename to | ||
| 7 | window-combination-limit. | ||
| 8 | |||
| 1 | 2011-11-16 Chong Yidong <cyd@gnu.org> | 9 | 2011-11-16 Chong Yidong <cyd@gnu.org> |
| 2 | 10 | ||
| 3 | * progmodes/autoconf.el (autoconf-mode): Fix comment-start-skip | 11 | * progmodes/autoconf.el (autoconf-mode): Fix comment-start-skip |
diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 3760a7a9d74..c8df8985be9 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el | |||
| @@ -401,7 +401,7 @@ since it could result in memory overflow and make Emacs crash." | |||
| 401 | (const :tag "Only on ttys" :value tty) | 401 | (const :tag "Only on ttys" :value tty) |
| 402 | (other :tag "Always" t)) "23.1") | 402 | (other :tag "Always" t)) "23.1") |
| 403 | (window-splits windows boolean "24.1") | 403 | (window-splits windows boolean "24.1") |
| 404 | (window-nest windows boolean "24.1") | 404 | (window-combination-limit windows boolean "24.1") |
| 405 | ;; xdisp.c | 405 | ;; xdisp.c |
| 406 | (show-trailing-whitespace whitespace-faces boolean nil | 406 | (show-trailing-whitespace whitespace-faces boolean nil |
| 407 | :safe booleanp) | 407 | :safe booleanp) |
diff --git a/lisp/window.el b/lisp/window.el index ddb29b95856..6de37c1d16e 100644 --- a/lisp/window.el +++ b/lisp/window.el | |||
| @@ -3083,9 +3083,9 @@ frame. The selected window is not changed by this function." | |||
| 3083 | (parent (window-parent window)) | 3083 | (parent (window-parent window)) |
| 3084 | (function (window-parameter window 'split-window)) | 3084 | (function (window-parameter window 'split-window)) |
| 3085 | (window-side (window-parameter window 'window-side)) | 3085 | (window-side (window-parameter window 'window-side)) |
| 3086 | ;; Rebind `window-nest' since in some cases we may have to | 3086 | ;; Rebind `window-combination-limit' since in some cases we may |
| 3087 | ;; override its value. | 3087 | ;; have to override its value. |
| 3088 | (window-nest window-nest) | 3088 | (window-combination-limit window-combination-limit) |
| 3089 | atom-root) | 3089 | atom-root) |
| 3090 | 3090 | ||
| 3091 | (window--check frame) | 3091 | (window--check frame) |
| @@ -3109,15 +3109,15 @@ frame. The selected window is not changed by this function." | |||
| 3109 | (or (not parent) | 3109 | (or (not parent) |
| 3110 | (not (window-parameter parent 'window-side)))) | 3110 | (not (window-parameter parent 'window-side)))) |
| 3111 | ;; WINDOW is a side root window. To make sure that a new parent | 3111 | ;; WINDOW is a side root window. To make sure that a new parent |
| 3112 | ;; window gets created set `window-nest' to t. | 3112 | ;; window gets created set `window-combination-limit' to t. |
| 3113 | (setq window-nest t)) | 3113 | (setq window-combination-limit t)) |
| 3114 | 3114 | ||
| 3115 | (when (and window-splits size (> size 0)) | 3115 | (when (and window-splits size (> size 0)) |
| 3116 | ;; If `window-splits' is non-nil and SIZE is a non-negative | 3116 | ;; If `window-splits' is non-nil and SIZE is a non-negative |
| 3117 | ;; integer, we cannot reasonably resize other windows. Rather | 3117 | ;; integer, we cannot reasonably resize other windows. Rather |
| 3118 | ;; bind `window-nest' to t to make sure that subsequent window | 3118 | ;; bind `window-combination-limit' to t to make sure that |
| 3119 | ;; deletions are handled correctly. | 3119 | ;; subsequent window deletions are handled correctly. |
| 3120 | (setq window-nest t)) | 3120 | (setq window-combination-limit t)) |
| 3121 | 3121 | ||
| 3122 | (let* ((parent-size | 3122 | (let* ((parent-size |
| 3123 | ;; `parent-size' is the size of WINDOW's parent, provided | 3123 | ;; `parent-size' is the size of WINDOW's parent, provided |
| @@ -3126,7 +3126,7 @@ frame. The selected window is not changed by this function." | |||
| 3126 | ;; `resize' non-nil means we are supposed to resize other | 3126 | ;; `resize' non-nil means we are supposed to resize other |
| 3127 | ;; windows in WINDOW's combination. | 3127 | ;; windows in WINDOW's combination. |
| 3128 | (resize | 3128 | (resize |
| 3129 | (and window-splits (not window-nest) | 3129 | (and window-splits (not window-combination-limit) |
| 3130 | ;; Resize makes sense in iso-combinations only. | 3130 | ;; Resize makes sense in iso-combinations only. |
| 3131 | (window-combined-p window horizontal))) | 3131 | (window-combined-p window horizontal))) |
| 3132 | ;; `old-size' is the current size of WINDOW. | 3132 | ;; `old-size' is the current size of WINDOW. |
| @@ -3206,7 +3206,8 @@ frame. The selected window is not changed by this function." | |||
| 3206 | ;; Make new-parent non-nil if we need a new parent window; | 3206 | ;; Make new-parent non-nil if we need a new parent window; |
| 3207 | ;; either because we want to nest or because WINDOW is not | 3207 | ;; either because we want to nest or because WINDOW is not |
| 3208 | ;; iso-combined. | 3208 | ;; iso-combined. |
| 3209 | (or window-nest (not (window-combined-p window horizontal)))) | 3209 | (or window-combination-limit |
| 3210 | (not (window-combined-p window horizontal)))) | ||
| 3210 | (setq new-normal | 3211 | (setq new-normal |
| 3211 | ;; Make new-normal the normal size of the new window. | 3212 | ;; Make new-normal the normal size of the new window. |
| 3212 | (cond | 3213 | (cond |
| @@ -3584,7 +3585,7 @@ specific buffers." | |||
| 3584 | (total-width . ,(window-total-size window t)) | 3585 | (total-width . ,(window-total-size window t)) |
| 3585 | (normal-height . ,(window-normal-size window)) | 3586 | (normal-height . ,(window-normal-size window)) |
| 3586 | (normal-width . ,(window-normal-size window t)) | 3587 | (normal-width . ,(window-normal-size window t)) |
| 3587 | (nest . ,(window-nest window)) | 3588 | (combination-limit . ,(window-combination-limit window)) |
| 3588 | ,@(let (list) | 3589 | ,@(let (list) |
| 3589 | (dolist (parameter (window-parameters window)) | 3590 | (dolist (parameter (window-parameters window)) |
| 3590 | (unless (memq (car parameter) | 3591 | (unless (memq (car parameter) |
| @@ -3709,9 +3710,11 @@ value can be also stored on disk and read back in a new session." | |||
| 3709 | window-safe-min-width))) | 3710 | window-safe-min-width))) |
| 3710 | 3711 | ||
| 3711 | (if (window-sizable-p window (- size) horizontal 'safe) | 3712 | (if (window-sizable-p window (- size) horizontal 'safe) |
| 3712 | (let* ((window-nest (assq 'nest item))) | 3713 | (let* ((window-combination-limit |
| 3713 | ;; We must inherit the nesting, otherwise we might mess | 3714 | (assq 'combination-limit item))) |
| 3714 | ;; up handling of atomic and side window. | 3715 | ;; We must inherit the combiantion limit, otherwise |
| 3716 | ;; we might mess up handling of atomic and side | ||
| 3717 | ;; window. | ||
| 3715 | (setq new (split-window window size horizontal))) | 3718 | (setq new (split-window window size horizontal))) |
| 3716 | ;; Give up if we can't resize window down to safe sizes. | 3719 | ;; Give up if we can't resize window down to safe sizes. |
| 3717 | (error "Cannot resize window %s" window)) | 3720 | (error "Cannot resize window %s" window)) |
| @@ -3735,10 +3738,11 @@ value can be also stored on disk and read back in a new session." | |||
| 3735 | (dolist (item window-state-put-list) | 3738 | (dolist (item window-state-put-list) |
| 3736 | (let ((window (car item)) | 3739 | (let ((window (car item)) |
| 3737 | (splits (cdr (assq 'splits item))) | 3740 | (splits (cdr (assq 'splits item))) |
| 3738 | (nest (cdr (assq 'nest item))) | 3741 | (combination-limit (cdr (assq 'combination-limit item))) |
| 3739 | (parameters (cdr (assq 'parameters item))) | 3742 | (parameters (cdr (assq 'parameters item))) |
| 3740 | (state (cdr (assq 'buffer item)))) | 3743 | (state (cdr (assq 'buffer item)))) |
| 3741 | (when nest (set-window-nest window nest)) | 3744 | (when combination-limit |
| 3745 | (set-window-combination-limit window combination-limit)) | ||
| 3742 | ;; Process parameters. | 3746 | ;; Process parameters. |
| 3743 | (when parameters | 3747 | (when parameters |
| 3744 | (dolist (parameter parameters) | 3748 | (dolist (parameter parameters) |
diff --git a/src/ChangeLog b/src/ChangeLog index e8bd3ac3e1f..0cbf2274ff9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-11-16 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * window.h (window): Rename slot "nest" to "combination_limit". | ||
| 4 | * window.c (Fwindow_nest): Rename to Fwindow_combination_limit. | ||
| 5 | (Fset_window_nest): Rename to Fset_window_combination_limit. | ||
| 6 | (Vwindow_nest): Rename to Vwindow_combination_limit. | ||
| 7 | (recombine_windows, make_parent_window, make_window) | ||
| 8 | (Fsplit_window_internal, saved_window) | ||
| 9 | (Fset_window_configuration, save_window_save): Rename all | ||
| 10 | occurrences of window_nest to window_combination_limit. | ||
| 11 | |||
| 1 | 2011-11-15 Juanma Barranquero <lekktu@gmail.com> | 12 | 2011-11-15 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 13 | ||
| 3 | * image.c (imagemagick_load_image): Fix typo. | 14 | * image.c (imagemagick_load_image): Fix typo. |
diff --git a/src/window.c b/src/window.c index 9c7e1349011..1b344773b1a 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -465,32 +465,33 @@ Return nil if WINDOW has no previous sibling. */) | |||
| 465 | return decode_any_window (window)->prev; | 465 | return decode_any_window (window)->prev; |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0, | 468 | DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 0, 1, 0, |
| 469 | doc: /* Return nest status of window WINDOW. | 469 | doc: /* Return combination limit of window WINDOW. |
| 470 | If WINDOW is omitted or nil, it defaults to the selected window. | 470 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 471 | 471 | ||
| 472 | If the return value is nil, child windows of WINDOW can be recombined with | 472 | If the return value is nil, child windows of WINDOW can be recombined with |
| 473 | WINDOW's siblings. A return value of non-nil means that child windows of | 473 | WINDOW's siblings. A return value of t means that child windows of |
| 474 | WINDOW are never \(re-)combined with WINDOW's siblings. */) | 474 | WINDOW are never \(re-)combined with WINDOW's siblings. */) |
| 475 | (Lisp_Object window) | 475 | (Lisp_Object window) |
| 476 | { | 476 | { |
| 477 | return decode_any_window (window)->nest; | 477 | return decode_any_window (window)->combination_limit; |
| 478 | } | 478 | } |
| 479 | 479 | ||
| 480 | DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0, | 480 | DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, |
| 481 | doc: /* Set nest status of window WINDOW to STATUS; return STATUS. | 481 | doc: /* Set combination limit of window WINDOW to STATUS; return STATUS. |
| 482 | If WINDOW is omitted or nil, it defaults to the selected window. | 482 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 483 | 483 | ||
| 484 | If STATUS is nil, child windows of WINDOW can be recombined with WINDOW's | 484 | If STATUS is nil, child windows of WINDOW can be recombined with |
| 485 | siblings. STATUS non-nil means that child windows of WINDOW are never | 485 | WINDOW's siblings. STATUS t means that child windows of WINDOW are |
| 486 | \(re-)combined with WINDOW's siblings. */) | 486 | never \(re-)combined with WINDOW's siblings. Other values are reserved |
| 487 | for future use. */) | ||
| 487 | (Lisp_Object window, Lisp_Object status) | 488 | (Lisp_Object window, Lisp_Object status) |
| 488 | { | 489 | { |
| 489 | register struct window *w = decode_any_window (window); | 490 | register struct window *w = decode_any_window (window); |
| 490 | 491 | ||
| 491 | w->nest = status; | 492 | w->combination_limit = status; |
| 492 | 493 | ||
| 493 | return w->nest; | 494 | return w->combination_limit; |
| 494 | } | 495 | } |
| 495 | 496 | ||
| 496 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, | 497 | DEFUN ("window-use-time", Fwindow_use_time, Swindow_use_time, 0, 1, 0, |
| @@ -1879,7 +1880,7 @@ recombine_windows (Lisp_Object window) | |||
| 1879 | 1880 | ||
| 1880 | w = XWINDOW (window); | 1881 | w = XWINDOW (window); |
| 1881 | parent = w->parent; | 1882 | parent = w->parent; |
| 1882 | if (!NILP (parent) && NILP (w->nest)) | 1883 | if (!NILP (parent) && NILP (w->combination_limit)) |
| 1883 | { | 1884 | { |
| 1884 | p = XWINDOW (parent); | 1885 | p = XWINDOW (parent); |
| 1885 | if (((!NILP (p->vchild) && !NILP (w->vchild)) | 1886 | if (((!NILP (p->vchild) && !NILP (w->vchild)) |
| @@ -3248,7 +3249,7 @@ make_parent_window (Lisp_Object window, int horflag) | |||
| 3248 | p->start = Qnil; | 3249 | p->start = Qnil; |
| 3249 | p->pointm = Qnil; | 3250 | p->pointm = Qnil; |
| 3250 | p->buffer = Qnil; | 3251 | p->buffer = Qnil; |
| 3251 | p->nest = Qnil; | 3252 | p->combination_limit = Qnil; |
| 3252 | p->window_parameters = Qnil; | 3253 | p->window_parameters = Qnil; |
| 3253 | } | 3254 | } |
| 3254 | 3255 | ||
| @@ -3295,7 +3296,7 @@ make_window (void) | |||
| 3295 | w->start_at_line_beg = w->display_table = w->dedicated = Qnil; | 3296 | w->start_at_line_beg = w->display_table = w->dedicated = Qnil; |
| 3296 | w->base_line_number = w->base_line_pos = w->region_showing = Qnil; | 3297 | w->base_line_number = w->base_line_pos = w->region_showing = Qnil; |
| 3297 | w->column_number_displayed = w->redisplay_end_trigger = Qnil; | 3298 | w->column_number_displayed = w->redisplay_end_trigger = Qnil; |
| 3298 | w->nest = w->window_parameters = Qnil; | 3299 | w->combination_limit = w->window_parameters = Qnil; |
| 3299 | w->prev_buffers = w->next_buffers = Qnil; | 3300 | w->prev_buffers = w->next_buffers = Qnil; |
| 3300 | /* Initialize non-Lisp data. */ | 3301 | /* Initialize non-Lisp data. */ |
| 3301 | w->desired_matrix = w->current_matrix = 0; | 3302 | w->desired_matrix = w->current_matrix = 0; |
| @@ -3668,7 +3669,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3668 | int horflag | 3669 | int horflag |
| 3669 | /* HORFLAG is 1 when we split side-by-side, 0 otherwise. */ | 3670 | /* HORFLAG is 1 when we split side-by-side, 0 otherwise. */ |
| 3670 | = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright); | 3671 | = EQ (side, Qt) || EQ (side, Qleft) || EQ (side, Qright); |
| 3671 | int do_nest = 0; | 3672 | int combination_limit = 0; |
| 3672 | 3673 | ||
| 3673 | CHECK_WINDOW (old); | 3674 | CHECK_WINDOW (old); |
| 3674 | o = XWINDOW (old); | 3675 | o = XWINDOW (old); |
| @@ -3677,11 +3678,11 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3677 | 3678 | ||
| 3678 | CHECK_NUMBER (total_size); | 3679 | CHECK_NUMBER (total_size); |
| 3679 | 3680 | ||
| 3680 | /* Set do_nest to 1 if we have to make a new parent window. We do | 3681 | /* Set combination_limit to 1 if we have to make a new parent window. |
| 3681 | that if either `window-nest' is non-nil, or OLD has no parent, or | 3682 | We do that if either `window-combination-limit' is t, or OLD has no |
| 3682 | OLD is ortho-combined. */ | 3683 | parent, or OLD is ortho-combined. */ |
| 3683 | do_nest = | 3684 | combination_limit = |
| 3684 | !NILP (Vwindow_nest) | 3685 | !NILP (Vwindow_combination_limit) |
| 3685 | || NILP (o->parent) | 3686 | || NILP (o->parent) |
| 3686 | || NILP (horflag | 3687 | || NILP (horflag |
| 3687 | ? (XWINDOW (o->parent)->hchild) | 3688 | ? (XWINDOW (o->parent)->hchild) |
| @@ -3701,7 +3702,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3701 | error ("Attempt to split minibuffer window"); | 3702 | error ("Attempt to split minibuffer window"); |
| 3702 | else if (XINT (total_size) < (horflag ? 2 : 1)) | 3703 | else if (XINT (total_size) < (horflag ? 2 : 1)) |
| 3703 | error ("Size of new window too small (after split)"); | 3704 | error ("Size of new window too small (after split)"); |
| 3704 | else if (!do_nest && !NILP (Vwindow_splits)) | 3705 | else if (!combination_limit && !NILP (Vwindow_splits)) |
| 3705 | /* `window-splits' non-nil means try to resize OLD's siblings | 3706 | /* `window-splits' non-nil means try to resize OLD's siblings |
| 3706 | proportionally. */ | 3707 | proportionally. */ |
| 3707 | { | 3708 | { |
| @@ -3726,7 +3727,7 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3726 | } | 3727 | } |
| 3727 | 3728 | ||
| 3728 | /* This is our point of no return. */ | 3729 | /* This is our point of no return. */ |
| 3729 | if (do_nest) | 3730 | if (combination_limit) |
| 3730 | { | 3731 | { |
| 3731 | /* Save the old value of o->normal_cols/lines. It gets corrupted | 3732 | /* Save the old value of o->normal_cols/lines. It gets corrupted |
| 3732 | by make_parent_window and we need it below for assigning it to | 3733 | by make_parent_window and we need it below for assigning it to |
| @@ -3735,8 +3736,9 @@ set correctly. See the code of `split-window' for how this is done. */) | |||
| 3735 | 3736 | ||
| 3736 | make_parent_window (old, horflag); | 3737 | make_parent_window (old, horflag); |
| 3737 | p = XWINDOW (o->parent); | 3738 | p = XWINDOW (o->parent); |
| 3738 | /* Store value of `window-nest' in new parent's nest slot. */ | 3739 | /* Store value of `window-combination-limit' in new parent's |
| 3739 | p->nest = Vwindow_nest; | 3740 | combination_limit slot. */ |
| 3741 | p->combination_limit = Vwindow_combination_limit; | ||
| 3740 | /* These get applied below. */ | 3742 | /* These get applied below. */ |
| 3741 | p->new_total = horflag ? o->total_cols : o->total_lines; | 3743 | p->new_total = horflag ? o->total_cols : o->total_lines; |
| 3742 | p->new_normal = new_normal; | 3744 | p->new_normal = new_normal; |
| @@ -3923,7 +3925,7 @@ Signal an error when WINDOW is the only window on its frame. */) | |||
| 3923 | /* Put SIBLING into PARENT's place. */ | 3925 | /* Put SIBLING into PARENT's place. */ |
| 3924 | replace_window (parent, sibling, 0); | 3926 | replace_window (parent, sibling, 0); |
| 3925 | /* Have SIBLING inherit the following three slot values from | 3927 | /* Have SIBLING inherit the following three slot values from |
| 3926 | PARENT (the nest slot is not inherited). */ | 3928 | PARENT (the combination_limit slot is not inherited). */ |
| 3927 | s->normal_cols = p->normal_cols; | 3929 | s->normal_cols = p->normal_cols; |
| 3928 | s->normal_lines = p->normal_lines; | 3930 | s->normal_lines = p->normal_lines; |
| 3929 | /* Mark PARENT as deleted. */ | 3931 | /* Mark PARENT as deleted. */ |
| @@ -5312,7 +5314,7 @@ struct saved_window | |||
| 5312 | Lisp_Object left_margin_cols, right_margin_cols; | 5314 | Lisp_Object left_margin_cols, right_margin_cols; |
| 5313 | Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins; | 5315 | Lisp_Object left_fringe_width, right_fringe_width, fringes_outside_margins; |
| 5314 | Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated; | 5316 | Lisp_Object scroll_bar_width, vertical_scroll_bar_type, dedicated; |
| 5315 | Lisp_Object nest, window_parameters; | 5317 | Lisp_Object combination_limit, window_parameters; |
| 5316 | }; | 5318 | }; |
| 5317 | 5319 | ||
| 5318 | #define SAVED_WINDOW_N(swv,n) \ | 5320 | #define SAVED_WINDOW_N(swv,n) \ |
| @@ -5543,7 +5545,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5543 | w->scroll_bar_width = p->scroll_bar_width; | 5545 | w->scroll_bar_width = p->scroll_bar_width; |
| 5544 | w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; | 5546 | w->vertical_scroll_bar_type = p->vertical_scroll_bar_type; |
| 5545 | w->dedicated = p->dedicated; | 5547 | w->dedicated = p->dedicated; |
| 5546 | w->nest = p->nest; | 5548 | w->combination_limit = p->combination_limit; |
| 5547 | w->window_parameters = p->window_parameters; | 5549 | w->window_parameters = p->window_parameters; |
| 5548 | XSETFASTINT (w->last_modified, 0); | 5550 | XSETFASTINT (w->last_modified, 0); |
| 5549 | XSETFASTINT (w->last_overlay_modified, 0); | 5551 | XSETFASTINT (w->last_overlay_modified, 0); |
| @@ -5821,7 +5823,7 @@ save_window_save (Lisp_Object window, struct Lisp_Vector *vector, int i) | |||
| 5821 | p->scroll_bar_width = w->scroll_bar_width; | 5823 | p->scroll_bar_width = w->scroll_bar_width; |
| 5822 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; | 5824 | p->vertical_scroll_bar_type = w->vertical_scroll_bar_type; |
| 5823 | p->dedicated = w->dedicated; | 5825 | p->dedicated = w->dedicated; |
| 5824 | p->nest = w->nest; | 5826 | p->combination_limit = w->combination_limit; |
| 5825 | p->window_parameters = w->window_parameters; | 5827 | p->window_parameters = w->window_parameters; |
| 5826 | if (!NILP (w->buffer)) | 5828 | if (!NILP (w->buffer)) |
| 5827 | { | 5829 | { |
| @@ -6284,7 +6286,8 @@ freeze_window_starts (struct frame *f, int freeze_p) | |||
| 6284 | and the like. | 6286 | and the like. |
| 6285 | 6287 | ||
| 6286 | This ignores a couple of things like the dedicatedness status of | 6288 | This ignores a couple of things like the dedicatedness status of |
| 6287 | window, nest and the like. This might have to be fixed. */ | 6289 | window, combination_limit and the like. This might have to be |
| 6290 | fixed. */ | ||
| 6288 | 6291 | ||
| 6289 | int | 6292 | int |
| 6290 | compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions) | 6293 | compare_window_configurations (Lisp_Object configuration1, Lisp_Object configuration2, int ignore_positions) |
| @@ -6496,24 +6499,27 @@ variable is non-nil, splitting a window may resize all windows in the | |||
| 6496 | same combination. This also allows to split a window that is otherwise | 6499 | same combination. This also allows to split a window that is otherwise |
| 6497 | too small or of fixed size. | 6500 | too small or of fixed size. |
| 6498 | 6501 | ||
| 6499 | This variable takes no effect if `window-nest' is non-nil. */); | 6502 | This variable takes no effect if `window-combination-limit' is non-nil. */); |
| 6500 | Vwindow_splits = Qnil; | 6503 | Vwindow_splits = Qnil; |
| 6501 | 6504 | ||
| 6502 | DEFVAR_LISP ("window-nest", Vwindow_nest, | 6505 | DEFVAR_LISP ("window-combination-limit", Vwindow_combination_limit, |
| 6503 | doc: /* Non-nil means splitting a window makes a new parent window. | 6506 | doc: /* Non-nil means splitting a window makes a new parent window. |
| 6504 | If this variable is nil, splitting a window will create a new parent | 6507 | If this variable is nil, splitting a window will create a new parent |
| 6505 | window only if the window has no parent window or the window shall | 6508 | window only if the window has no parent window or the window shall |
| 6506 | become a combination orthogonal to the one it it is part of. | 6509 | become a combination orthogonal to the one it it is part of. |
| 6507 | 6510 | ||
| 6508 | If this variable is non-nil, splitting a window always creates a new | 6511 | If this variable is t, splitting a window always creates a new parent |
| 6509 | parent window. If all splits behave this way, each frame's window tree | 6512 | window. If all splits behave this way, each frame's window tree is a |
| 6510 | is a binary tree and every window but the frame's root window has | 6513 | binary tree and every window but the frame's root window has exactly one |
| 6511 | exactly one sibling. | 6514 | sibling. |
| 6512 | 6515 | ||
| 6513 | The value of this variable is also assigned to the nest status of the | 6516 | Other values are reserved for future use. |
| 6514 | new parent window. The nest status of a window can be retrieved via the | 6517 | |
| 6515 | function `window-nest' and altered by the function `set-window-nest'. */); | 6518 | The value of this variable is also assigned to the combination_limit |
| 6516 | Vwindow_nest = Qnil; | 6519 | status of the new parent window. The combination-limit status of a |
| 6520 | window can be retrieved via the function `window-combination-limit' and | ||
| 6521 | altered by the function `set-window-combination-limit'. */); | ||
| 6522 | Vwindow_combination_limit = Qnil; | ||
| 6517 | 6523 | ||
| 6518 | defsubr (&Sselected_window); | 6524 | defsubr (&Sselected_window); |
| 6519 | defsubr (&Sminibuffer_window); | 6525 | defsubr (&Sminibuffer_window); |
| @@ -6533,8 +6539,8 @@ function `window-nest' and altered by the function `set-window-nest'. */); | |||
| 6533 | defsubr (&Swindow_left_child); | 6539 | defsubr (&Swindow_left_child); |
| 6534 | defsubr (&Swindow_next_sibling); | 6540 | defsubr (&Swindow_next_sibling); |
| 6535 | defsubr (&Swindow_prev_sibling); | 6541 | defsubr (&Swindow_prev_sibling); |
| 6536 | defsubr (&Swindow_nest); | 6542 | defsubr (&Swindow_combination_limit); |
| 6537 | defsubr (&Sset_window_nest); | 6543 | defsubr (&Sset_window_combination_limit); |
| 6538 | defsubr (&Swindow_use_time); | 6544 | defsubr (&Swindow_use_time); |
| 6539 | defsubr (&Swindow_top_line); | 6545 | defsubr (&Swindow_top_line); |
| 6540 | defsubr (&Swindow_left_column); | 6546 | defsubr (&Swindow_left_column); |
diff --git a/src/window.h b/src/window.h index c11235bd67b..de0f7307a51 100644 --- a/src/window.h +++ b/src/window.h | |||
| @@ -258,9 +258,8 @@ struct window | |||
| 258 | must run the redisplay-end-trigger-hook. */ | 258 | must run the redisplay-end-trigger-hook. */ |
| 259 | Lisp_Object redisplay_end_trigger; | 259 | Lisp_Object redisplay_end_trigger; |
| 260 | 260 | ||
| 261 | /* Non-nil means this window's child windows are never | 261 | /* t means this window's child windows are not (re-)combined. */ |
| 262 | (re-)combined. */ | 262 | Lisp_Object combination_limit; |
| 263 | Lisp_Object nest; | ||
| 264 | 263 | ||
| 265 | /* Alist of <buffer, window-start, window-point> triples listing | 264 | /* Alist of <buffer, window-start, window-point> triples listing |
| 266 | buffers previously shown in this window. */ | 265 | buffers previously shown in this window. */ |