diff options
| author | Dmitry Antipov | 2013-03-19 13:21:31 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-03-19 13:21:31 +0400 |
| commit | 095d384da66c2b227803a0540d9bde9df52a97e1 (patch) | |
| tree | 5d11a1b12f0bc6904146599aa3b3181cfc47771e /src | |
| parent | 7ec31b02ef777b3174ca5be807d2987c69f061cd (diff) | |
| download | emacs-095d384da66c2b227803a0540d9bde9df52a97e1.tar.gz emacs-095d384da66c2b227803a0540d9bde9df52a97e1.zip | |
* window.c (Fwindow_combination_limit, Fset_window_combination_limit):
Signal error if window is not internal. Adjust docstring.
(delete_all_child_windows): Use combination_limit to save the buffer.
(Fset_window_configuration): Adjust accordingly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/window.c | 39 |
2 files changed, 30 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1814a699b4b..72db989910f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * window.c (Fwindow_combination_limit, Fset_window_combination_limit): | ||
| 4 | Signal error if window is not internal. Adjust docstring. | ||
| 5 | (delete_all_child_windows): Use combination_limit to save the buffer. | ||
| 6 | (Fset_window_configuration): Adjust accordingly. | ||
| 7 | |||
| 1 | 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru> | 8 | 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 9 | ||
| 3 | * window.c (window_resize_check, window_resize_apply) | 10 | * window.c (window_resize_check, window_resize_apply) |
diff --git a/src/window.c b/src/window.c index df7878f42e5..5dc908f0a4d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -635,30 +635,37 @@ Return nil if WINDOW has no previous sibling. */) | |||
| 635 | 635 | ||
| 636 | DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, | 636 | DEFUN ("window-combination-limit", Fwindow_combination_limit, Swindow_combination_limit, 1, 1, 0, |
| 637 | doc: /* Return combination limit of window WINDOW. | 637 | doc: /* Return combination limit of window WINDOW. |
| 638 | WINDOW must be a valid window used in horizontal or vertical combination. | ||
| 638 | If the return value is nil, child windows of WINDOW can be recombined with | 639 | If the return value is nil, child windows of WINDOW can be recombined with |
| 639 | WINDOW's siblings. A return value of t means that child windows of | 640 | WINDOW's siblings. A return value of t means that child windows of |
| 640 | WINDOW are never \(re-)combined with WINDOW's siblings. | 641 | WINDOW are never \(re-)combined with WINDOW's siblings. */) |
| 641 | |||
| 642 | WINDOW must be a valid window. The return value is meaningful for | ||
| 643 | internal windows only. */) | ||
| 644 | (Lisp_Object window) | 642 | (Lisp_Object window) |
| 645 | { | 643 | { |
| 644 | struct window *w; | ||
| 645 | |||
| 646 | CHECK_VALID_WINDOW (window); | 646 | CHECK_VALID_WINDOW (window); |
| 647 | w = XWINDOW (window); | ||
| 648 | if (!NILP (w->buffer)) | ||
| 649 | error ("Combination limit is meaningful for internal windows only"); | ||
| 647 | return XWINDOW (window)->combination_limit; | 650 | return XWINDOW (window)->combination_limit; |
| 648 | } | 651 | } |
| 649 | 652 | ||
| 650 | DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, | 653 | DEFUN ("set-window-combination-limit", Fset_window_combination_limit, Sset_window_combination_limit, 2, 2, 0, |
| 651 | doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT. | 654 | doc: /* Set combination limit of window WINDOW to LIMIT; return LIMIT. |
| 655 | WINDOW must be a valid window used in horizontal or vertical combination. | ||
| 652 | If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's | 656 | If LIMIT is nil, child windows of WINDOW can be recombined with WINDOW's |
| 653 | siblings. LIMIT t means that child windows of WINDOW are never | 657 | siblings. LIMIT t means that child windows of WINDOW are never |
| 654 | \(re-)combined with WINDOW's siblings. Other values are reserved for | 658 | \(re-)combined with WINDOW's siblings. Other values are reserved for |
| 655 | future use. | 659 | future use. */) |
| 656 | |||
| 657 | WINDOW must be a valid window. Setting the combination limit is | ||
| 658 | meaningful for internal windows only. */) | ||
| 659 | (Lisp_Object window, Lisp_Object limit) | 660 | (Lisp_Object window, Lisp_Object limit) |
| 660 | { | 661 | { |
| 661 | wset_combination_limit (decode_valid_window (window), limit); | 662 | struct window *w; |
| 663 | |||
| 664 | CHECK_VALID_WINDOW (window); | ||
| 665 | w = XWINDOW (window); | ||
| 666 | if (!NILP (w->buffer)) | ||
| 667 | error ("Combination limit is meaningful for internal windows only"); | ||
| 668 | wset_combination_limit (w, limit); | ||
| 662 | return limit; | 669 | return limit; |
| 663 | } | 670 | } |
| 664 | 671 | ||
| @@ -5711,10 +5718,9 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5711 | } | 5718 | } |
| 5712 | } | 5719 | } |
| 5713 | 5720 | ||
| 5714 | /* If we squirreled away the buffer in the window's height, | 5721 | /* If we squirreled away the buffer, restore it now. */ |
| 5715 | restore it now. */ | 5722 | if (BUFFERP (w->combination_limit)) |
| 5716 | if (BUFFERP (w->total_lines)) | 5723 | wset_buffer (w, w->combination_limit); |
| 5717 | wset_buffer (w, w->total_lines); | ||
| 5718 | wset_left_col (w, p->left_col); | 5724 | wset_left_col (w, p->left_col); |
| 5719 | wset_top_line (w, p->top_line); | 5725 | wset_top_line (w, p->top_line); |
| 5720 | wset_total_cols (w, p->total_cols); | 5726 | wset_total_cols (w, p->total_cols); |
| @@ -5918,9 +5924,6 @@ delete_all_child_windows (Lisp_Object window) | |||
| 5918 | /* Delete WINDOW's siblings (we traverse postorderly). */ | 5924 | /* Delete WINDOW's siblings (we traverse postorderly). */ |
| 5919 | delete_all_child_windows (w->next); | 5925 | delete_all_child_windows (w->next); |
| 5920 | 5926 | ||
| 5921 | /* See Fset_window_configuration for excuse. */ | ||
| 5922 | wset_total_lines (w, w->buffer); | ||
| 5923 | |||
| 5924 | if (!NILP (w->vchild)) | 5927 | if (!NILP (w->vchild)) |
| 5925 | { | 5928 | { |
| 5926 | delete_all_child_windows (w->vchild); | 5929 | delete_all_child_windows (w->vchild); |
| @@ -5936,6 +5939,10 @@ delete_all_child_windows (Lisp_Object window) | |||
| 5936 | unshow_buffer (w); | 5939 | unshow_buffer (w); |
| 5937 | unchain_marker (XMARKER (w->pointm)); | 5940 | unchain_marker (XMARKER (w->pointm)); |
| 5938 | unchain_marker (XMARKER (w->start)); | 5941 | unchain_marker (XMARKER (w->start)); |
| 5942 | /* Since combination limit makes sense for an internal windows | ||
| 5943 | only, we use this slot to save the buffer for the sake of | ||
| 5944 | possible resurrection in Fset_window_configuration. */ | ||
| 5945 | wset_combination_limit (w, w->buffer); | ||
| 5939 | wset_buffer (w, Qnil); | 5946 | wset_buffer (w, Qnil); |
| 5940 | } | 5947 | } |
| 5941 | 5948 | ||