diff options
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/window.c b/src/window.c index eaa910571e0..9ab9fab2c13 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3690,27 +3690,23 @@ temp_output_buffer_show (register Lisp_Object buf) | |||
| 3690 | 3690 | ||
| 3691 | /* Run temp-buffer-show-hook, with the chosen window selected | 3691 | /* Run temp-buffer-show-hook, with the chosen window selected |
| 3692 | and its buffer current. */ | 3692 | and its buffer current. */ |
| 3693 | 3693 | { | |
| 3694 | if (!NILP (Vrun_hooks) | 3694 | int count = SPECPDL_INDEX (); |
| 3695 | && !NILP (Fboundp (Qtemp_buffer_show_hook)) | 3695 | Lisp_Object prev_window, prev_buffer; |
| 3696 | && !NILP (Fsymbol_value (Qtemp_buffer_show_hook))) | 3696 | prev_window = selected_window; |
| 3697 | { | 3697 | XSETBUFFER (prev_buffer, old); |
| 3698 | int count = SPECPDL_INDEX (); | 3698 | |
| 3699 | Lisp_Object prev_window, prev_buffer; | 3699 | /* Select the window that was chosen, for running the hook. |
| 3700 | prev_window = selected_window; | 3700 | Note: Both Fselect_window and select_window_norecord may |
| 3701 | XSETBUFFER (prev_buffer, old); | 3701 | set-buffer to the buffer displayed in the window, |
| 3702 | 3702 | so we need to save the current buffer. --stef */ | |
| 3703 | /* Select the window that was chosen, for running the hook. | 3703 | record_unwind_protect (Fset_buffer, prev_buffer); |
| 3704 | Note: Both Fselect_window and select_window_norecord may | 3704 | record_unwind_protect (select_window_norecord, prev_window); |
| 3705 | set-buffer to the buffer displayed in the window, | 3705 | Fselect_window (window, Qt); |
| 3706 | so we need to save the current buffer. --stef */ | 3706 | Fset_buffer (w->buffer); |
| 3707 | record_unwind_protect (Fset_buffer, prev_buffer); | 3707 | Frun_hooks (1, &Qtemp_buffer_show_hook); |
| 3708 | record_unwind_protect (select_window_norecord, prev_window); | 3708 | unbind_to (count, Qnil); |
| 3709 | Fselect_window (window, Qt); | 3709 | } |
| 3710 | Fset_buffer (w->buffer); | ||
| 3711 | call1 (Vrun_hooks, Qtemp_buffer_show_hook); | ||
| 3712 | unbind_to (count, Qnil); | ||
| 3713 | } | ||
| 3714 | } | 3710 | } |
| 3715 | } | 3711 | } |
| 3716 | 3712 | ||