summaryrefslogtreecommitdiff
path: root/src/window.c
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2011-03-23 11:06:57 +0100
committerJulien Danjou <julien@danjou.info>2011-03-23 11:06:57 +0100
commitdee091a37f6486dbbcf7bf00f6ee54d77033f997 (patch)
tree922b3490e04f512f9664ca350102d57a18296680 /src/window.c
parent904a432cf44c176fa3c88a975f046d0cf2992023 (diff)
downloademacs-dee091a37f6486dbbcf7bf00f6ee54d77033f997.tar.gz
emacs-dee091a37f6486dbbcf7bf00f6ee54d77033f997.tar.bz2
emacs-dee091a37f6486dbbcf7bf00f6ee54d77033f997.zip
Use Frun_hooks rather than calling Vrun_hooks manually
Diffstat (limited to 'src/window.c')
-rw-r--r--src/window.c38
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)
/* Run temp-buffer-show-hook, with the chosen window selected
and its buffer current. */
-
- if (!NILP (Vrun_hooks)
- && !NILP (Fboundp (Qtemp_buffer_show_hook))
- && !NILP (Fsymbol_value (Qtemp_buffer_show_hook)))
- {
- int count = SPECPDL_INDEX ();
- Lisp_Object prev_window, prev_buffer;
- prev_window = selected_window;
- XSETBUFFER (prev_buffer, old);
-
- /* Select the window that was chosen, for running the hook.
- Note: Both Fselect_window and select_window_norecord may
- set-buffer to the buffer displayed in the window,
- so we need to save the current buffer. --stef */
- record_unwind_protect (Fset_buffer, prev_buffer);
- record_unwind_protect (select_window_norecord, prev_window);
- Fselect_window (window, Qt);
- Fset_buffer (w->buffer);
- call1 (Vrun_hooks, Qtemp_buffer_show_hook);
- unbind_to (count, Qnil);
- }
+ {
+ int count = SPECPDL_INDEX ();
+ Lisp_Object prev_window, prev_buffer;
+ prev_window = selected_window;
+ XSETBUFFER (prev_buffer, old);
+
+ /* Select the window that was chosen, for running the hook.
+ Note: Both Fselect_window and select_window_norecord may
+ set-buffer to the buffer displayed in the window,
+ so we need to save the current buffer. --stef */
+ record_unwind_protect (Fset_buffer, prev_buffer);
+ record_unwind_protect (select_window_norecord, prev_window);
+ Fselect_window (window, Qt);
+ Fset_buffer (w->buffer);
+ Frun_hooks (1, &Qtemp_buffer_show_hook);
+ unbind_to (count, Qnil);
+ }
}
}