From 2cccc823493aa1b8c1c117d5f2831a3d023d0cfc Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 13 Apr 1995 02:03:59 +0000 Subject: [PATCH] (temp_output_buffer_show): Select the chosen window temporarily for running temp-buffer-show-hook. (syms_of_window): Fix typo. --- src/window.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/window.c b/src/window.c index 56281f02027..daefb968f91 100644 --- a/src/window.c +++ b/src/window.c @@ -2128,8 +2128,28 @@ temp_output_buffer_show (buf) set_marker_restricted (w->pointm, make_number (1), buf); } + /* Run temp-buffer-show-hook, with the chosen window selected. */ if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, Qtemp_buffer_show_hook); + { + Lisp_Object tem; + tem = Fboundp (Qtemp_buffer_show_hook); + if (!NILP (tem)) + { + tem = Fsymbol_value (Qtemp_buffer_show_hook); + if (!NILP (tem)) + { + int count = specpdl_ptr - specpdl; + + /* Select the window that was chosen, for running the hook. */ + record_unwind_protect (Fset_window_configuration, + Fcurrent_window_configuration (Qnil)); + + Fselect_window (window); + call1 (Vrun_hooks, Qtemp_buffer_show_hook); + unbind_to (count, Qnil); + } + } + } } static @@ -3347,7 +3367,7 @@ syms_of_window () Qwindow_live_p = intern ("window-live-p"); staticpro (&Qwindow_live_p); - Qtemp_buffer_show_hook = intern ("Qtemp-buffer-show-hook"); + Qtemp_buffer_show_hook = intern ("temp-buffer-show-hook"); staticpro (&Qtemp_buffer_show_hook); #ifndef MULTI_FRAME -- 2.39.5