1. 20 Jun, 2013 1 commit
    • Eli Zaretskii's avatar
      Yet another attempt at fixing bugs #14602, 14630, 14669. · b932cad7
      Eli Zaretskii authored
       src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode
       line dimensions here, to avoid race conditions with the main
       thread.
       src/w32term.c (w32_draw_window_cursor): Compute the header line and
       mode line dimensions here.
       <w32_system_caret_window, w32_system_caret_hdr_height>:
       <w32_system_caret_mode_height>: New variables.
       src/w32term.h: Declare them.
      b932cad7
  2. 03 Jun, 2013 1 commit
    • Eli Zaretskii's avatar
      * configure.ac (HAVE_GFILENOTIFY): Do not change $LIBS. · 7f203aa1
      Eli Zaretskii authored
      (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): Substitute.
      
      * nt/config.nt: Add HAVE_GFILENOTIFY, HAVE_W32NOTIFY and USE_FILE_NOTIFY.
      
      * src/Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
      (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
      (LIBES): Add $(GFILENOTIFY_LIBS).
      
      * src/w32inevt.c (handle_file_notifications): Add dummy implementation
      for !HAVE_W32NOTIFY.
      
      * src/w32term.c: Wrap code with HAVE_W32NOTIFY.
      7f203aa1
  3. 14 Apr, 2013 1 commit
    • Erik Charlebois's avatar
      * src/w32fns.c (w32_fullscreen_rect): New function to compute the · 1f635a07
      Erik Charlebois authored
      window rectangle for the given fullscreen mode.
      (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING
      no longer tunes the window size.  This keeps the window's edges
      flush with the screen and allows the taskbar to hide itself in
      fullboth.
      * src/w32term.c (w32fullscreen_hook): fullboth now shows without
      window decorations and uses the entire screen.
      1f635a07
  4. 01 Apr, 2013 1 commit
  5. 26 Mar, 2013 1 commit
  6. 24 Mar, 2013 1 commit
  7. 23 Mar, 2013 2 commits
    • Eli Zaretskii's avatar
      Fix fullscreen resizing of multiple frames on MS-Windows. · cdc0d0bd
      Eli Zaretskii authored
       src/w32term.h (struct w32_output): New members normal_width,
       normal_height, normal_top, normal_left, and prev_fsmode.
       (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
       (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
       members of a frame.
       src/w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
       FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
       variables, to save and restore frame dimensions.  Use
       FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
       after returning from a 'fullscreen' configuration.  use
       SendMessage instead of PostMessage to send the SC_RESTORE message,
       to avoid races between the main thread and the input thread.
      cdc0d0bd
    • Eli Zaretskii's avatar
      Fix bug #14032 with restoring frame dimensions on MS-Windows. · b5b7745f
      Eli Zaretskii authored
       src/w32term.c (w32fullscreen_hook): Record last value of the frame's
       'fullscreen' parameter.  Always record previous width and height
       of the frame, except when switching out of maximized modes, so
       that they could be restored correctly, instead of resetting to the
       default frame dimensions.  Send SC_RESTORE command to the frame,
       unless we are going to send SC_MAXIMIZE, to restore the frame
       resize hints in the mouse pointer shown by the window manager.
       src/frame.c (get_frame_param): Now extern for WINDOWSNT as well.
       src/lisp.h (get_frame_param): Adjust conditions for prototype
       declaration.
      b5b7745f
  8. 15 Mar, 2013 1 commit
  9. 14 Mar, 2013 1 commit
    • Eli Zaretskii's avatar
      Fix bug #13953 with spontaneous frame resizes on MS-Windows. · a5cc4dde
      Eli Zaretskii authored
       src/w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
       and incorrect code.  Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
       and WM_ACTIVATEAPP.
       (w32fullscreen_hook): If the frame is visible, reset
       f->want_fullscreen flag after changing the frame size.  If the
       frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
      a5cc4dde
  10. 13 Mar, 2013 1 commit
  11. 10 Mar, 2013 1 commit
    • Daniel Colascione's avatar
      2013-03-10 Daniel Colascione <dancol@dancol.org> · 819e2da9
      Daniel Colascione authored
      	* w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
      	(GUI_SDATA, guichar_t): Macros to abstract out differences between
      	NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
      	w32fns.c.
      
      	* w32term.c (construct_drag_n_drop): Use the above macros to make
      	drag-and-drop work for non-ASCII filenames in cygw32 builds.
      
      	* w32fns.c (x_set_name, x_set_title): Use the above macros to
      	properly display non-ASCII frame titles in cygw32 builds.
      
      	* w32fns.c (Fw32_shell_execute): Use the above macros to properly
      	call ShellExecute in cygw32 builds.
      
      	* w32fn.c (Fx_file_dialog): Use the above macros to simplify the
      	common file dialog code.
      
      	* w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
      	can just use du like other systems.
      
      	* coding.c (from_unicode_buffer): Declare.
      	* coding.c (from_unicode_buffer): Implement.
      819e2da9
  12. 16 Feb, 2013 1 commit
  13. 24 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop async_visible and async_iconified fields of struct frame. · edfa7fa0
      Dmitry Antipov authored
      This is possible because async input is gone; for details, see
      http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
      * frame.h (struct frame): Remove async_visible and async_iconified
      members, convert garbaged to unsigned bitfield.  Adjust comments.
      (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
      (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
      * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
      Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
      FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
      * w32term.c: Ditto.
      (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
      properly.  Likewise for obscured.
      * xterm.c: Ditto.
      (handle_one_xevent): Save visible state go generate ICONIFY_EVENT
      properly.
      * nsterm.m: Ditto.
      (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
      edfa7fa0
  14. 23 Jan, 2013 1 commit
  15. 09 Jan, 2013 1 commit
  16. 04 Jan, 2013 2 commits
  17. 01 Jan, 2013 1 commit
  18. 22 Dec, 2012 1 commit
  19. 10 Dec, 2012 1 commit
  20. 04 Dec, 2012 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state · 350f51ad
      Dmitry Antipov authored
      member.  Adjust users.  Convert mouse_face_past_end, mouse_face_defer
      and mouse_face_hidden members to a bitfields.
      * frame.h (struct frame): Remove set-but-not-used space_width member.
      (FRAME_SPACE_WIDTH): Remove.
      * nsterm.m, w32term.c, xterm.c: Adjust users.
      * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
      member.  Adjust users.  Convert term_initted, delete_in_insert_mode,
      costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
      members to a bitfields.
      350f51ad
  21. 01 Dec, 2012 1 commit
  22. 22 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      * alloc.c (Fgarbage_collect): Unblock input after clearing · 5c747675
      Dmitry Antipov authored
      gc_in_progress to avoid note_mouse_highlight glitch with GC.
      * frame.h (FRAME_MOUSE_UPDATE): New macro.
      * msdos.c (IT_frame_up_to_date): Use it here...
      * w32term.c (w32_frame_up_to_date): ...here...
      * xterm.c (XTframe_up_to_date): ...and here...
      * nsterm.m (ns_frame_up_to_date): ...but not here.
      * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
      Adjust users.
      * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
      Do not check whether GC is in progress.
      5c747675
  23. 12 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Simplify by using FOR_EACH_FRAME here and there. · 5b04e9f9
      Dmitry Antipov authored
      * frame.c (next_frame, prev_frame, other_visible_frames)
      (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
      * w32term.c (x_window_to_scroll_bar): Likewise.
      * window.c (window_list): Likewise.
      * xdisp.c (x_consider_frame_title): Likewise.
      * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
      * xfns.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
      * xmenu.c (menubar_id_to_frame): Likewise.
      * xselect.c (frame_for_x_selection): Likewise.
      * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
      (x_window_to_menu_bar): Likewise.
      * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
      5b04e9f9
  24. 09 Nov, 2012 1 commit
  25. 18 Oct, 2012 2 commits
  26. 14 Oct, 2012 1 commit
  27. 12 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Some cleanups: · 4f0800ec
      Eli Zaretskii authored
        1. If fill_queue returns -1, but there were file notifications, return 0.
        2. Move invariant code out of the loop in queue_notifications and 
           handle_file_notifications.
      4f0800ec
  28. 10 Oct, 2012 1 commit
  29. 08 Oct, 2012 1 commit
  30. 07 Oct, 2012 3 commits
  31. 06 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Initial version of the w32notify code. · 477f1e50
      Eli Zaretskii authored
      Adding and removing a watch seems to work: a new thread is launched
      when a watch is added and exits when the watch is removed.
      But there are no notifications, so it seems.  At least, the Lisp
      callback function passed to w32notify-add-watch is not called.
      477f1e50
  32. 30 Sep, 2012 1 commit
    • Fabrice Popineau's avatar
      Support x64 build on MS-Windows with MSVC. · 62aba0d4
      Fabrice Popineau authored
       src/w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
       (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
       compatibility with x64.
       src/w32term.c (w32_draw_underwave): Don't use GCC extensions for
       defining an XRectangle structure.
       src/w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
       arithmetics for compatibility with x64.
       src/w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
       compatibility with x64.
       src/w32heap.h: Adjust prototypes and declarations.
       src/w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
       (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
       DWORD, long, and unsigned long, for compatibility with x64.
       (allocate_heap) [_WIN64]: Reserve 32GB of memory.
       (sbrk): Argument is now of type ptrdiff_t.
       src/w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
       less than 0x0500.
       (w32_msg_pump): Use WPARAM type for 'result'.
       src/w32.c (init_environment, get_emacs_configuration): Support AMD64
       architecture.
       (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
       compatibility with x64.
       src/vm-limit.c (lim_data): Now size_t.
       (check_memory_limits): Adjust prototypes of real_morecore and
       __morecore to receive argument of type ptrdiff_t.  Use size_t for
       five_percent and data_size.
       src/unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
       variables, for compatibility with x64.
       (rva_to_section, offset_to_section, relocate_offset)
       (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
       (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
       (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
       for compatibility with x64.
       src/sysdep.c (STDERR_FILENO): Define if not already defined.
       src/ralloc.c (real_morecore): Argument type is now ptrdiff_t.
       (__morecore): Argument type is now ptrdiff_t.
       (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
       (relinquish): Use ptrdiff_t type for 'excess'.
       (r_alloc_sbrk): Argument type is now ptrdiff_t.
       src/makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
       (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
       instead of a literal number.
       src/gmalloc.c [WINDOWSNT]: Include w32heap.h.
       (min): Define only if not already defined.
       src/frame.c (x_report_frame_params): Use EMACS_UINT for the return
       value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
       hosts.
       src/image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
       'bitmaps' is a pointer.
       src/dispextern.h (x_bitmap_pixmap): Adjust prototype.
       src/alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
      
       nt/makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST).
       nt/inc/sys/socket.h: Don't map Winsock error codes to standard ones
       that are already defined.
       nt/inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX)
       (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC.
       [_MSC_VER]: Add pragmas to suppress some MSVC warnings.
       nt/preprep.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use
       DWORD_PTR instead of DWORD for compatibility with x64.
       nt/nmake.defs: Support AMD64.
       (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros.
       nt/gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST):
       New macros.
       nt/addsection.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_add_section, main): Use DWORD_PTR instead of
       DWORD, for compatibility with x64.
       nt/emacs-x64.manifest: New file.
       nt/emacs-x86.manifest: Renamed from emacs.manifest.
      
       lib-src/ntlib.c (gettimeofday): Copy from src/w32.c.  lib/gettime. 
       needs this function.
      62aba0d4
  33. 23 Sep, 2012 3 commits
    • Paul Eggert's avatar
      gnutls.c, gtkutil.c: Use bool for boolean. · 18e27ea8
      Paul Eggert authored
      * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
      (emacs_gnutls_handle_error):
      * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
      (xg_hide_tooltip, xg_create_frame_widgets)
      (create_dialog, xg_uses_old_file_dialog)
      (xg_get_file_with_chooser, xg_get_file_with_selection)
      (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
      (xg_item_label_same_p, xg_update_menubar)
      (xg_modify_menubar_widgets, xg_event_is_for_menubar)
      (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
      (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
      (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
      (update_frame_tool_bar, free_frame_tool_bar):
      * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
      * nsmenu.m (ns_update_menubar):
      * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
      * xfns.c (Fx_show_tip) [USE_GTK]:
      Use bool for boolean.
      * gtkutil.c (xg_update_frame_menubar):
      * xmenu.c (update_frame_menubar):
      Return void, not int, since caller ignores return value.
      * gtkutil.c (xg_change_toolbar_position):
      Return void, not 1.
      18e27ea8
    • Juanma Barranquero's avatar
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51