From: Andrew C. <ak...@cs...> - 2002-01-03 08:20:15
|
Hi Everyone, I posted a bug fix to the patch emacs-21.1-2-mac.patch.gz that was supposed to improve the speed of redisplay. Turns out it didn't really do anything (it didn't do any harm either). My apologies. Here is one that really works! This fix makes a big difference for people using a quail input method for typing Chinese or Japanese. Without it, input is very sluggish because there's a long delay (to regenerate and reinstall the menus) after each key press. It may fix other input-related sluggishness too. You'd never know :-). Please apply the following patch to src/macmenu.c (without applying the previous one; undo it if you have already applied that one). Andrew. ----- --- macmenu.c.orig Fri Nov 2 10:50:08 2001 +++ macmenu.c Thu Jan 3 15:48:06 2002 @@ -1336,11 +1336,13 @@ = (Lisp_Object *) alloca (previous_menu_items_used * sizeof (Lisp_Object)); +#if 0 /* If we are making a new widget, its contents are empty, do always reinitialize them. */ if (! menubar_widget) previous_menu_items_used = 0; - +#endif + buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer; specbind (Qinhibit_quit, Qt); /* Don't let the debugger step into this code @@ -1370,12 +1372,13 @@ inhibit_garbage_collection (); /* Save the frame's previous menu bar contents data. */ - bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, - previous_menu_items_used * sizeof (Lisp_Object)); + if (previous_menu_items_used) + bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, + previous_menu_items_used * sizeof (Lisp_Object)); /* Fill in the current menu bar contents. */ menu_items = f->menu_bar_vector; - menu_items_allocated = XVECTOR (menu_items)->size; + menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; init_menu_items (); for (i = 0; i < XVECTOR (items)->size; i += 4) { @@ -1407,9 +1410,10 @@ of the menu bar, skip redisplaying it. Just exit. */ for (i = 0; i < previous_menu_items_used; i++) - if (menu_items_used == i - || (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))) - break; + if (menu_items_used == i + || (!Fequal (previous_items[i], + XVECTOR (menu_items)->contents[i]))) + break; if (i == menu_items_used && i == previous_menu_items_used && i != 0) { free_menubar_widget_value_tree (first_wv); |