diff options
| author | Chong Yidong | 2008-08-29 01:06:42 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-08-29 01:06:42 +0000 |
| commit | 40bb7e6f66eb8f88c324bc2756e19f7128d06603 (patch) | |
| tree | 33a2c0f603a5a0bb8a394d36983f187977c42313 /src | |
| parent | efe63a4bdfdac3986978973070ebee8672c32d2c (diff) | |
| download | emacs-40bb7e6f66eb8f88c324bc2756e19f7128d06603.tar.gz emacs-40bb7e6f66eb8f88c324bc2756e19f7128d06603.zip | |
(update_tool_bar_unwind): New function.
(update_tool_bar): Temporarily set selected frame before building
tool-bar items.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 89dc814f71a..dc1dd16a3bc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -9834,6 +9834,14 @@ FRAME_PTR last_mouse_frame; | |||
| 9834 | int last_tool_bar_item; | 9834 | int last_tool_bar_item; |
| 9835 | 9835 | ||
| 9836 | 9836 | ||
| 9837 | static Lisp_Object | ||
| 9838 | update_tool_bar_unwind (frame) | ||
| 9839 | Lisp_Object frame; | ||
| 9840 | { | ||
| 9841 | selected_frame = frame; | ||
| 9842 | return Qnil; | ||
| 9843 | } | ||
| 9844 | |||
| 9837 | /* Update the tool-bar item list for frame F. This has to be done | 9845 | /* Update the tool-bar item list for frame F. This has to be done |
| 9838 | before we start to fill in any display lines. Called from | 9846 | before we start to fill in any display lines. Called from |
| 9839 | prepare_menu_bars. If SAVE_MATCH_DATA is non-zero, we must save | 9847 | prepare_menu_bars. If SAVE_MATCH_DATA is non-zero, we must save |
| @@ -9878,7 +9886,7 @@ update_tool_bar (f, save_match_data) | |||
| 9878 | { | 9886 | { |
| 9879 | struct buffer *prev = current_buffer; | 9887 | struct buffer *prev = current_buffer; |
| 9880 | int count = SPECPDL_INDEX (); | 9888 | int count = SPECPDL_INDEX (); |
| 9881 | Lisp_Object new_tool_bar; | 9889 | Lisp_Object frame, new_tool_bar; |
| 9882 | int new_n_tool_bar; | 9890 | int new_n_tool_bar; |
| 9883 | struct gcpro gcpro1; | 9891 | struct gcpro gcpro1; |
| 9884 | 9892 | ||
| @@ -9900,6 +9908,14 @@ update_tool_bar (f, save_match_data) | |||
| 9900 | 9908 | ||
| 9901 | GCPRO1 (new_tool_bar); | 9909 | GCPRO1 (new_tool_bar); |
| 9902 | 9910 | ||
| 9911 | /* We must temporarily set the selected frame to this frame | ||
| 9912 | before calling tool_bar_items, because the calculation of | ||
| 9913 | the tool-bar keymap uses the selected frame (see | ||
| 9914 | `tool-bar-make-keymap' in tool-bar.el). */ | ||
| 9915 | record_unwind_protect (update_tool_bar_unwind, selected_frame); | ||
| 9916 | XSETFRAME (frame, f); | ||
| 9917 | selected_frame = frame; | ||
| 9918 | |||
| 9903 | /* Build desired tool-bar items from keymaps. */ | 9919 | /* Build desired tool-bar items from keymaps. */ |
| 9904 | new_tool_bar = tool_bar_items (Fcopy_sequence (f->tool_bar_items), | 9920 | new_tool_bar = tool_bar_items (Fcopy_sequence (f->tool_bar_items), |
| 9905 | &new_n_tool_bar); | 9921 | &new_n_tool_bar); |