diff options
| author | Stefan Monnier | 2003-06-26 23:20:50 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-06-26 23:20:50 +0000 |
| commit | 2d0834cc27e4f58763ae21c7da70a0e770d365d4 (patch) | |
| tree | 20097c73a7bfa6df6651231614928d3a7062835a /src/window.c | |
| parent | cfea0546e8ba854dddd1b9ac259407521a7b65ae (diff) | |
| download | emacs-2d0834cc27e4f58763ae21c7da70a0e770d365d4.tar.gz emacs-2d0834cc27e4f58763ae21c7da70a0e770d365d4.zip | |
(Fset_window_dedicated_p): Simplify.
(display_buffer_1): Don't raise the win from which minibuf was entered.
(temp_output_buffer_show): Don't assume BEG == 1. Simplify.
(Fminibuffer_selected_window): Simplify.
(delete_window): Update for new types.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/window.c b/src/window.c index b323bb5fcb8..b5df84b55ce 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1119,10 +1119,7 @@ non-nil means yes. */) | |||
| 1119 | { | 1119 | { |
| 1120 | register struct window *w = decode_window (window); | 1120 | register struct window *w = decode_window (window); |
| 1121 | 1121 | ||
| 1122 | if (NILP (arg)) | 1122 | w->dedicated = arg; |
| 1123 | w->dedicated = Qnil; | ||
| 1124 | else | ||
| 1125 | w->dedicated = Qt; | ||
| 1126 | 1123 | ||
| 1127 | return w->dedicated; | 1124 | return w->dedicated; |
| 1128 | } | 1125 | } |
| @@ -1381,8 +1378,8 @@ delete_window (window) | |||
| 1381 | if (!NILP (tem)) | 1378 | if (!NILP (tem)) |
| 1382 | { | 1379 | { |
| 1383 | unshow_buffer (p); | 1380 | unshow_buffer (p); |
| 1384 | unchain_marker (p->pointm); | 1381 | unchain_marker (XMARKER (p->pointm)); |
| 1385 | unchain_marker (p->start); | 1382 | unchain_marker (XMARKER (p->start)); |
| 1386 | } | 1383 | } |
| 1387 | 1384 | ||
| 1388 | /* Free window glyph matrices. It is sure that they are allocated | 1385 | /* Free window glyph matrices. It is sure that they are allocated |
| @@ -2922,6 +2919,9 @@ defaults. */) | |||
| 2922 | return Qnil; | 2919 | return Qnil; |
| 2923 | } | 2920 | } |
| 2924 | 2921 | ||
| 2922 | /* Note that selected_window can be nil | ||
| 2923 | when this is called from Fset_window_configuration. */ | ||
| 2924 | |||
| 2925 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, | 2925 | DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, |
| 2926 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. | 2926 | doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. |
| 2927 | If WINDOW is not already selected, also make WINDOW's buffer current. | 2927 | If WINDOW is not already selected, also make WINDOW's buffer current. |
| @@ -3021,7 +3021,14 @@ display_buffer_1 (window) | |||
| 3021 | 3021 | ||
| 3022 | FRAME_SAMPLE_VISIBILITY (f); | 3022 | FRAME_SAMPLE_VISIBILITY (f); |
| 3023 | 3023 | ||
| 3024 | if (!EQ (frame, selected_frame)) | 3024 | if (EQ (frame, selected_frame)) |
| 3025 | ; /* Assume the selected frame is already visible enough. */ | ||
| 3026 | else if (minibuf_level > 0 | ||
| 3027 | && MINI_WINDOW_P (XWINDOW (selected_window)) | ||
| 3028 | && WINDOW_LIVE_P (minibuf_selected_window) | ||
| 3029 | && EQ (frame, WINDOW_FRAME (XWINDOW (minibuf_selected_window)))) | ||
| 3030 | ; /* Assume the frame from which we invoked the minibuffer is visible. */ | ||
| 3031 | else | ||
| 3025 | { | 3032 | { |
| 3026 | if (FRAME_ICONIFIED_P (f)) | 3033 | if (FRAME_ICONIFIED_P (f)) |
| 3027 | Fmake_frame_visible (frame); | 3034 | Fmake_frame_visible (frame); |
| @@ -3328,37 +3335,31 @@ temp_output_buffer_show (buf) | |||
| 3328 | w = XWINDOW (window); | 3335 | w = XWINDOW (window); |
| 3329 | XSETFASTINT (w->hscroll, 0); | 3336 | XSETFASTINT (w->hscroll, 0); |
| 3330 | XSETFASTINT (w->min_hscroll, 0); | 3337 | XSETFASTINT (w->min_hscroll, 0); |
| 3331 | set_marker_restricted_both (w->start, buf, 1, 1); | 3338 | set_marker_restricted_both (w->start, buf, BEG, BEG); |
| 3332 | set_marker_restricted_both (w->pointm, buf, 1, 1); | 3339 | set_marker_restricted_both (w->pointm, buf, BEG, BEG); |
| 3333 | 3340 | ||
| 3334 | /* Run temp-buffer-show-hook, with the chosen window selected | 3341 | /* Run temp-buffer-show-hook, with the chosen window selected |
| 3335 | and its buffer current. */ | 3342 | and its buffer current. */ |
| 3336 | if (!NILP (Vrun_hooks)) | 3343 | |
| 3344 | if (!NILP (Vrun_hooks) | ||
| 3345 | && !NILP (Fboundp (Qtemp_buffer_show_hook)) | ||
| 3346 | && !NILP (Fsymbol_value (Qtemp_buffer_show_hook))) | ||
| 3337 | { | 3347 | { |
| 3338 | Lisp_Object tem; | 3348 | int count = SPECPDL_INDEX (); |
| 3339 | tem = Fboundp (Qtemp_buffer_show_hook); | 3349 | Lisp_Object prev_window, prev_buffer; |
| 3340 | if (!NILP (tem)) | 3350 | prev_window = selected_window; |
| 3341 | { | 3351 | XSETBUFFER (prev_buffer, old); |
| 3342 | tem = Fsymbol_value (Qtemp_buffer_show_hook); | 3352 | |
| 3343 | if (!NILP (tem)) | 3353 | /* Select the window that was chosen, for running the hook. |
| 3344 | { | 3354 | Note: Both Fselect_window and select_window_norecord may |
| 3345 | int count = SPECPDL_INDEX (); | 3355 | set-buffer to the buffer displayed in the window, |
| 3346 | Lisp_Object prev_window, prev_buffer; | 3356 | so we need to save the current buffer. --stef */ |
| 3347 | prev_window = selected_window; | 3357 | record_unwind_protect (Fset_buffer, prev_buffer); |
| 3348 | XSETBUFFER (prev_buffer, old); | 3358 | record_unwind_protect (select_window_norecord, prev_window); |
| 3349 | 3359 | Fselect_window (window, Qt); | |
| 3350 | /* Select the window that was chosen, for running the hook. | 3360 | Fset_buffer (w->buffer); |
| 3351 | Note: Both Fselect_window and select_window_norecord may | 3361 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); |
| 3352 | set-buffer to the buffer displayed in the window, | 3362 | unbind_to (count, Qnil); |
| 3353 | so we need to save the current buffer. --stef */ | ||
| 3354 | record_unwind_protect (Fset_buffer, prev_buffer); | ||
| 3355 | record_unwind_protect (select_window_norecord, prev_window); | ||
| 3356 | Fselect_window (window, Qt); | ||
| 3357 | Fset_buffer (w->buffer); | ||
| 3358 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); | ||
| 3359 | unbind_to (count, Qnil); | ||
| 3360 | } | ||
| 3361 | } | ||
| 3362 | } | 3363 | } |
| 3363 | } | 3364 | } |
| 3364 | } | 3365 | } |
| @@ -4818,7 +4819,6 @@ Returns nil, if current window is not a minibuffer window. */) | |||
| 4818 | { | 4819 | { |
| 4819 | if (minibuf_level > 0 | 4820 | if (minibuf_level > 0 |
| 4820 | && MINI_WINDOW_P (XWINDOW (selected_window)) | 4821 | && MINI_WINDOW_P (XWINDOW (selected_window)) |
| 4821 | && !NILP (minibuf_selected_window) | ||
| 4822 | && WINDOW_LIVE_P (minibuf_selected_window)) | 4822 | && WINDOW_LIVE_P (minibuf_selected_window)) |
| 4823 | return minibuf_selected_window; | 4823 | return minibuf_selected_window; |
| 4824 | 4824 | ||