aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2002-10-22 19:28:17 +0000
committerStefan Monnier2002-10-22 19:28:17 +0000
commita5731348b5ad4bec5b33104208dbb9372130c3f2 (patch)
tree51eda07ba95c240f00ca9acaa2079b9a1f4e46a1 /src
parent6d70a280d5a838ea61fd08538742b4ca5f6e9a46 (diff)
downloademacs-a5731348b5ad4bec5b33104208dbb9372130c3f2.tar.gz
emacs-a5731348b5ad4bec5b33104208dbb9372130c3f2.zip
(window_loop): For GET_LRU_WINDOW and GET_LARGEST_WINDOW>,
Only ignore truly dedicated windows. For UNSHOW_BUFFER, delete the window if it is dedicated. (Fshrink_window): Add preserve_before as was done for enlarge_window. (Vspecial_display_function): Update docstring.
Diffstat (limited to 'src')
-rw-r--r--src/window.c48
1 files changed, 34 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index d69db508746..1c7bff2767c 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1861,7 +1861,7 @@ window_loop (type, obj, mini, frames)
1861 if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (w)) 1861 if (!NILP (obj) && !WINDOW_FULL_WIDTH_P (w))
1862 break; 1862 break;
1863 /* Ignore dedicated windows and minibuffers. */ 1863 /* Ignore dedicated windows and minibuffers. */
1864 if (MINI_WINDOW_P (w) || !NILP (w->dedicated)) 1864 if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
1865 break; 1865 break;
1866 if (NILP (best_window) 1866 if (NILP (best_window)
1867 || (XFASTINT (XWINDOW (best_window)->use_time) 1867 || (XFASTINT (XWINDOW (best_window)->use_time)
@@ -1914,7 +1914,7 @@ window_loop (type, obj, mini, frames)
1914 case GET_LARGEST_WINDOW: 1914 case GET_LARGEST_WINDOW:
1915 { 1915 {
1916 /* Ignore dedicated windows and minibuffers. */ 1916 /* Ignore dedicated windows and minibuffers. */
1917 if (MINI_WINDOW_P (w) || !NILP (w->dedicated)) 1917 if (MINI_WINDOW_P (w) || EQ (w->dedicated, Qt))
1918 break; 1918 break;
1919 1919
1920 if (NILP (best_window)) 1920 if (NILP (best_window))
@@ -1954,6 +1954,14 @@ window_loop (type, obj, mini, frames)
1954 /* Now we can safely delete the frame. */ 1954 /* Now we can safely delete the frame. */
1955 Fdelete_frame (w->frame, Qnil); 1955 Fdelete_frame (w->frame, Qnil);
1956 } 1956 }
1957 else if (!NILP (w->dedicated) && !NILP (w->parent))
1958 {
1959 Lisp_Object window;
1960 XSETWINDOW (window, w);
1961 /* If this window is dedicated and not the only window
1962 in its frame, then kill it. */
1963 Fdelete_window (window);
1964 }
1957 else 1965 else
1958 { 1966 {
1959 /* Otherwise show a different buffer in the window. */ 1967 /* Otherwise show a different buffer in the window. */
@@ -3032,7 +3040,7 @@ displayed. */)
3032 frames = Qnil; 3040 frames = Qnil;
3033 if (FRAME_MINIBUF_ONLY_P (f)) 3041 if (FRAME_MINIBUF_ONLY_P (f))
3034 XSETFRAME (frames, last_nonminibuf_frame); 3042 XSETFRAME (frames, last_nonminibuf_frame);
3035 /* Don't try to create a window if would get an error */ 3043 /* Don't try to create a window if we would get an error. */
3036 if (split_height_threshold < window_min_height << 1) 3044 if (split_height_threshold < window_min_height << 1)
3037 split_height_threshold = window_min_height << 1; 3045 split_height_threshold = window_min_height << 1;
3038 3046
@@ -3160,7 +3168,7 @@ temp_output_buffer_show (buf)
3160 set_marker_restricted_both (w->pointm, buf, 1, 1); 3168 set_marker_restricted_both (w->pointm, buf, 1, 1);
3161 3169
3162 /* Run temp-buffer-show-hook, with the chosen window selected 3170 /* Run temp-buffer-show-hook, with the chosen window selected
3163 and it sbuffer current. */ 3171 and its buffer current. */
3164 if (!NILP (Vrun_hooks)) 3172 if (!NILP (Vrun_hooks))
3165 { 3173 {
3166 Lisp_Object tem; 3174 Lisp_Object tem;
@@ -3175,6 +3183,9 @@ temp_output_buffer_show (buf)
3175 prev_window = selected_window; 3183 prev_window = selected_window;
3176 3184
3177 /* Select the window that was chosen, for running the hook. */ 3185 /* Select the window that was chosen, for running the hook. */
3186 /* Both this Fselect_window and the select_window_1
3187 below will (may) incorrectly set-buffer to the buffer
3188 displayed in the window. --stef */
3178 record_unwind_protect (Fselect_window, prev_window); 3189 record_unwind_protect (Fselect_window, prev_window);
3179 select_window_1 (window, 0); 3190 select_window_1 (window, 0);
3180 Fset_buffer (w->buffer); 3191 Fset_buffer (w->buffer);
@@ -3362,15 +3373,20 @@ siblings to the right or below are changed. */)
3362 return Qnil; 3373 return Qnil;
3363} 3374}
3364 3375
3365DEFUN ("shrink-window", Fshrink_window, Sshrink_window, 1, 2, "p", 3376DEFUN ("shrink-window", Fshrink_window, Sshrink_window, 1, 3, "p",
3366 doc: /* Make current window ARG lines smaller. 3377 doc: /* Make current window ARG lines smaller.
3367From program, optional second arg non-nil means shrink sideways arg columns. 3378From program, optional second arg non-nil means shrink sideways arg columns.
3368Interactively, if an argument is not given, make the window one line smaller. */) 3379Interactively, if an argument is not given, make the window one line smaller.
3369 (arg, side) 3380
3370 register Lisp_Object arg, side; 3381Optional third arg PRESERVE-BEFORE, if non-nil, means do not change the size
3382of the siblings above or to the left of the selected window. Only
3383siblings to the right or below are changed. */)
3384 (arg, side, preserve_before)
3385 register Lisp_Object arg, side, preserve_before;
3371{ 3386{
3372 CHECK_NUMBER (arg); 3387 CHECK_NUMBER (arg);
3373 enlarge_window (selected_window, -XINT (arg), !NILP (side), 0); 3388 enlarge_window (selected_window, -XINT (arg), !NILP (side),
3389 !NILP (preserve_before));
3374 3390
3375 if (! NILP (Vwindow_configuration_change_hook)) 3391 if (! NILP (Vwindow_configuration_change_hook))
3376 call1 (Vrun_hooks, Qwindow_configuration_change_hook); 3392 call1 (Vrun_hooks, Qwindow_configuration_change_hook);
@@ -3650,7 +3666,7 @@ enlarge_window (window, delta, widthflag, preserve_before)
3650 delta1/n = delta 3666 delta1/n = delta
3651 delta1 = n * delta. 3667 delta1 = n * delta.
3652 3668
3653 The number of children n rquals the number of resizable 3669 The number of children n equals the number of resizable
3654 children of this window + 1 because we know window itself 3670 children of this window + 1 because we know window itself
3655 is resizable (otherwise we would have signalled an error. */ 3671 is resizable (otherwise we would have signalled an error. */
3656 3672
@@ -5956,10 +5972,14 @@ Those variables take precedence over this one. */);
5956 doc: /* Function to call to make a new frame for a special buffer. 5972 doc: /* Function to call to make a new frame for a special buffer.
5957It is called with two arguments, the buffer and optional buffer specific 5973It is called with two arguments, the buffer and optional buffer specific
5958data, and should return a window displaying that buffer. 5974data, and should return a window displaying that buffer.
5959The default value makes a separate frame for the buffer, 5975The default value normally makes a separate frame for the buffer,
5960using `special-display-frame-alist' to specify the frame parameters. 5976 using `special-display-frame-alist' to specify the frame parameters.
5961 5977But if the buffer specific data includes (same-buffer . t) then the
5962A buffer is special if its is listed in `special-display-buffer-names' 5978 buffer is displayed in the current selected window.
5979Otherwise if it includes (same-frame . t) then the buffer is displayed in
5980 a new window in the currently selected frame.
5981
5982A buffer is special if it is listed in `special-display-buffer-names'
5963or matches a regexp in `special-display-regexps'. */); 5983or matches a regexp in `special-display-regexps'. */);
5964 Vspecial_display_function = Qnil; 5984 Vspecial_display_function = Qnil;
5965 5985