8416 |
{ |
{ |
8417 |
struct buffer *prev = current_buffer; |
struct buffer *prev = current_buffer; |
8418 |
int count = SPECPDL_INDEX (); |
int count = SPECPDL_INDEX (); |
8419 |
Lisp_Object old_tool_bar; |
Lisp_Object new_tool_bar; |
8420 |
|
int new_n_tool_bar; |
8421 |
struct gcpro gcpro1; |
struct gcpro gcpro1; |
8422 |
|
|
8423 |
/* Set current_buffer to the buffer of the selected |
/* Set current_buffer to the buffer of the selected |
8436 |
specbind (Qoverriding_local_map, Qnil); |
specbind (Qoverriding_local_map, Qnil); |
8437 |
} |
} |
8438 |
|
|
8439 |
old_tool_bar = f->tool_bar_items; |
GCPRO1 (new_tool_bar); |
|
GCPRO1 (old_tool_bar); |
|
8440 |
|
|
8441 |
/* Build desired tool-bar items from keymaps. */ |
/* Build desired tool-bar items from keymaps. */ |
8442 |
BLOCK_INPUT; |
new_tool_bar = tool_bar_items (Fcopy_sequence (f->tool_bar_items), |
8443 |
f->tool_bar_items |
&new_n_tool_bar); |
|
= tool_bar_items (f->tool_bar_items, &f->n_tool_bar_items); |
|
|
UNBLOCK_INPUT; |
|
8444 |
|
|
8445 |
/* Redisplay the tool-bar if we changed it. */ |
/* Redisplay the tool-bar if we changed it. */ |
8446 |
if (! NILP (Fequal (old_tool_bar, f->tool_bar_items))) |
if (NILP (Fequal (new_tool_bar, f->tool_bar_items))) |
8447 |
w->update_mode_line = Qt; |
{ |
8448 |
|
/* Redisplay that happens asynchronously due to an expose event |
8449 |
|
may access f->tool_bar_items. Make sure we update both |
8450 |
|
variables within BLOCK_INPUT so no such event interrupts. */ |
8451 |
|
BLOCK_INPUT; |
8452 |
|
f->tool_bar_items = new_tool_bar; |
8453 |
|
f->n_tool_bar_items = new_n_tool_bar; |
8454 |
|
w->update_mode_line = Qt; |
8455 |
|
UNBLOCK_INPUT; |
8456 |
|
} |
8457 |
|
|
8458 |
UNGCPRO; |
UNGCPRO; |
8459 |
|
|