(composition_gstring_width): Fix handling of LGLYPH_YOFF.
(autocmp_chars): Use fast_looking_at. Don't compose more
characters than MAX_COMPOSITION_COMPONENST.
(find_automatic_composition): While looking forward and backward,
check static composition. Fix where to stop looking forward.
(composition_adjust_point): Fix checking of static composition.
(Fcomposition_get_gstring): Pay attention to
MAX_COMPOSITION_COMPONENST.
<struct glyph>.u.cmp.to. Check if the glyph belongs to the same
composition.
(append_composite_glyph): Adjusted for the change of
<strcut glyph>.u.cmp.to.
when modal window is active. (Bug #2152)
(applicationShouldTerminate:): Remove now-unneeded while loop
around NSRunAlertPanel.
* nsmenu.m (popupSession): New file-global variable.
(pop_down_menu): End the popupSession before closing dialog.
(ns_popup_dialog): BLOCK_INPUT around dialog presentation.
(EmacsDialogPanel-runDialogAt:): Don't place window (superfluous),
don't query NSApp for events (just sleep instead).
(ns_popup_dialog): Call it on unwind.
(EmacsDialogPanel-runDialogAt:): Check popup_activated_flag and
call timer_check() (Bug#2154).
(EmacsMenu-menuNeedsUpdate:): Don't call ns_update_menu if
handling_signal is set.
(EmacsMenu-fillWithWidgetValue:): Set submenu title.
* s/darwin.h: Same and NO_SOCK_SIGIO as well.
* nsterm.m (ns_read_socket): Same and don't set handling_signal.
* keyboard.c (poll_for_input_1, handle_async_input): Set
handling_signal under HAVE_NS.
(composition_gstring_p): Fix for the terminal case.
(composition_gstring_width): Likewise.
(fill_gstring_body): Likewise.
(autocmp_chars): For terminal, call Fcomposition_get_gstring with
the frame.
(composition_compute_stop_pos): Adjust cmp_it->stop_pos if point
is within a composition.
(Fcomposition_get_gstring): Fix the the terminal case.
Initialize it as a relative filename pattern.
(init_callproc): Don't initialize Vtemp_file_name_pattern here.
(Fcall_process_region): Simplify temp file creation using
temporary-file-directory.
Initialize it as a relative filename pattern.
(init_callproc): Don't initialize Vtemp_file_name_pattern here.
(Fcall_process_region): Simplify temp file creation using
temporary-file-directory.