1. 26 Mar, 2020 1 commit
    • Philipp Stephani's avatar
      Add a module function to open a file descriptor connected to a pipe. · d28b0047
      Philipp Stephani authored
      A common complaint about the module API is that modules can't
      communicate asynchronously with Emacs.  While it isn't possible to
      call arbitrary Emacs functions asynchronously, writing to a pipe
      should always be fine and is a pretty low-hanging fruit.
      
      This patch implements a function that adapts an existing pipe
      process.  That way, users can use familiar tools like process filters
      or 'accept-process-output'.
      
      * src/module-env-28.h: Add 'open_channel' module function.
      
      * src/emacs-module.c (module_open_channel): Provide definition for
      'open_channel'.
      (initialize_environment): Use it.
      
      * src/process.c (open_channel_for_module): New helper function.
      (syms_of_process): Define necessary symbol.
      
      * test/src/emacs-module-tests.el (module/async-pipe): New unit test.
      
      * test/data/emacs-module/mod-test.c (signal_system_error): New helper
      function.
      (signal_errno): Use it.
      (write_to_pipe): New function running in the background.
      (Fmod_test_async_pipe): New test module function.
      (emacs_module_init): Export it.
      
      * doc/lispref/internals.texi (Module Misc): Document new module
      function.
      
      * doc/lispref/processes.texi (Asynchronous Processes): New anchor
      for pipe processes.
      
      * etc/NEWS: Document 'open_channel' function.
      d28b0047
  2. 01 Jan, 2020 1 commit
  3. 26 Nov, 2019 1 commit
    • Robert Pluim's avatar
      Extend network-interface-list to return IPv6 and network info · 650a514e
      Robert Pluim authored
      Bug#38218
      
      * src/process.c (Fnetwork_interface_list): Extend argument list to
      allow requesting full network info and/or IPv4/IPv6 info.
      (network_interface_list) [HAVE_GETIFADDRS]: Use getifaddrs to retrieve
      interface IP addresses.
      
      * src/process.h: Update prototype of network_interface_list.
      
      * src/w32.c (g_b_init_get_adapters_addresses): New init flag.
      (globals_of_w32): Initialize it.
      (GetAdaptersAddresses_Proc): New function typedef.
      (get_adapters_addresses): New wrapper function.
      (init_winsock): Load htonl and ntohl.
      (sys_htonl, sys_ntohl): New wrapper functions.
      (network_interface_list): Implement in terms of
      get_adapters_addresses.
      
      * nt/inc/sys/socket.h: Add sys_htonl and sys_ntohl prototypes.
      
      * etc/NEWS: Announce IPv4/IPv6 changes in network-interface-list.
      
      * doc/lispref/processes.texi (Misc Network): Document updated arglist
      and return values for network-interface-list.
      650a514e
  4. 07 Aug, 2019 1 commit
  5. 08 Apr, 2019 1 commit
  6. 01 Jan, 2019 1 commit
  7. 10 Nov, 2018 1 commit
    • Paul Eggert's avatar
      Dissociate controlling tty better on Darwin · 9cd23a29
      Paul Eggert authored
      * src/process.c (dissociate_controlling_tty): New function.
      (create_process): Use it to dissociate controlling tty if setsid
      fails, which happens on Darwin after a vfork (Bug#33154).
      Do this on all platforms, not just on Darwin, as a similar
      problem is plausible elsewhere.
      * src/callproc.c (call_process): Use the new function here, too,
      for consistency and to avoid duplicate code.
      9cd23a29
  8. 07 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Shrink pseudovectors a bit · 2c8520e1
      Paul Eggert authored
      sizeof (struct Lisp_Marker) was 32 on x86, where 24 would do.
      Problem noted by Stefan Monnier in:
      https://lists.gnu.org/r/emacs-devel/2018-09/msg00165.html
      * src/bignum.h (struct Lisp_Bignum):
      * src/frame.h (struct frame):
      * src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
      (struct Lisp_Char_Table, struct Lisp_Hash_Table)
      (struct Lisp_Marker, struct Lisp_Overlay)
      (struct Lisp_Misc_Ptr, struct Lisp_User_Ptr)
      (struct Lisp_Finalizer, struct Lisp_Float)
      (struct Lisp_Module_Function):
      * src/process.h (struct Lisp_Process):
      * src/termhooks.h (struct terminal):
      * src/thread.h (struct thread_state, struct Lisp_Mutex)
      (struct Lisp_CondVar):
      * src/window.c (struct save_window_data):
      * src/window.h (struct window):
      * src/xterm.h (struct scroll_bar):
      * src/xwidget.h (struct xwidget, struct xwidget_view):
      Add GCALIGNED_STRUCT attribute.
      * src/lisp.h (GCALIGNED_UNION_MEMBER): Renamed from GCALIGNED_UNION.
      All uses changed.
      (GCALIGNED_STRUCT_MEMBER, GCALIGNED_STRUCT, GCALIGNED): New macros.
      All uses of open-coded GCALIGNED changed to use GCALIGNED.
      (union vectorlike_header): No longer GC-aligned.
      (PSEUDOVECSIZE): Yield 0 for pseudovectors without Lisp
      objects that place a member before where the first Lisp object
      member would be.
      2c8520e1
  9. 16 Jul, 2018 1 commit
    • Robert Pluim's avatar
      Implement hostname->ip lookup function · e89c06e8
      Robert Pluim authored
      * src/process.c (conv_sockaddr_to_lisp): Add include_port
      argument.  Don't put a port in the result if this is false.
      (conv_addrinfo_to_lisp, Fprocess_datagram_address)
      (connect_network_socket, network_interface_list)
      (network_interface_info, server_accept_connection)
      (init_process_emacs): Update callers.
      (Fnetwork_lookup_address_info): New function.  Performs hostname to
      ip address lookups.
      
      * src/w32.c (network_interface_get_info): Update callers of
        conv_sockaddr_to_lisp
      
      * etc/NEWS : mention addition of 'network-lookup-address-info'
      e89c06e8
  10. 24 Jun, 2018 1 commit
    • Lars Ingebrigtsen's avatar
      Return the entire TLS certificate chain back to the caller · c8745d95
      Lars Ingebrigtsen authored
      * src/gnutls.c (gnutls_deinit_certificates): New function.
      (Fgnutls_peer_status): Return all certificates in the chain back
      to Lisp land.
      (gnutls_verify_boot): Compute all the x509 certificates in the
      chain.
      
      * src/process.h (struct Lisp_Process): Adjust gnutls fields so
      that we can keep tracks of all certificates in the chain instead
      of just the host certificate.
      c8745d95
  11. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Use native alignment to access Lisp object data · 0303fab3
      Paul Eggert authored
      Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
      tell GCC that P has alignment 8, use (T *) P where T is the
      type of the pointed-to object, to tell GCC that P has native
      alignment.  This is simpler, matches the intent better, and
      should help simplify future improvements.  Some of these
      changes are to pacify gcc -Wnull-dereference, since GCC is
      smarter about pointers now that Emacs no longer uses
      __builtin_assume_aligned; these minor changes should improve
      code efficiency slightly.  On Fedora 28 x86-64 with default
      optimization this patch shrinks the size of the Emacs text
      segment by 0.36%.
      * src/conf_post.h (__has_builtin, __builtin_assume_aligned):
      Remove; no longer used.
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
      Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
      and XCDR instead of CDR_SAFE when this is safe.
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (clear_font_cache):
      Pacify -Wnull-dereference by removing unnecessary NILP test.
      * src/keyboard.c (xevent_start): New function.
      (read_char, read_key_sequence): Pacify -Wnull-dereference by
      using xevent_start instead of EVENT_START.
      * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
      now, since it can no longer be implemented as a function.
      (XUNTAG): New third argument CTYPE.  All uses changed.
      Cast result to CTYPE * instead of using __builtin_assume_aligned.
      Simplify by using LISP_WORD_TAG.
      (LISP_WORD_TAG): New macro.
      (TAG_PTR): Use it.
      * src/menu.c (x_popup_menu_1):
      Pacify -Wnull-dereference by using XCAR instead of Fcar and
      XCDR instead of Fcdr where this is safe.
      0303fab3
  12. 02 Jun, 2018 1 commit
    • Matthias Dahl's avatar
      Fix wait_reading_process_output wait_proc hang · de69d284
      Matthias Dahl authored
      * src/process.c (read_process_output): Track bytes read from
      a process.
      (wait_reading_process_output): If called recursively through
      timers and/or process filters via accept-process-output, it is
      possible that the output of wait_proc has already been read by
      one of those recursive calls, leaving the original call hanging
      forever if no further output arrives through that fd and no
      timeout has been set.  Fix that by using the process read
      accounting to keep track of how many bytes have been read and
      use that as a condition to break out of the infinite loop and
      return to the caller as well as to calculate the proper return
      value (if a wait_proc is given that is).
      
      * src/process.h (struct Lisp_Process): Add nbytes_read to track
      bytes read from a process.
      
      (cherry picked from commit 4ba32858)
      de69d284
  13. 16 Feb, 2018 1 commit
    • Matthias Dahl's avatar
      Fix wait_reading_process_output wait_proc hang · 4ba32858
      Matthias Dahl authored
      * src/process.c (read_process_output): Track bytes read from
      a process.
      (wait_reading_process_output): If called recursively through
      timers and/or process filters via accept-process-output, it is
      possible that the output of wait_proc has already been read by
      one of those recursive calls, leaving the original call hanging
      forever if no further output arrives through that fd and no
      timeout has been set.  Fix that by using the process read
      accounting to keep track of how many bytes have been read and
      use that as a condition to break out of the infinite loop and
      return to the caller as well as to calculate the proper return
      value (if a wait_proc is given that is).
      
      * src/process.h (struct Lisp_Process): Add nbytes_read to track
      bytes read from a process.
      4ba32858
  14. 01 Jan, 2018 1 commit
  15. 13 Nov, 2017 1 commit
    • Paul Eggert's avatar
      Change vectorlike from struct to union · 5d68dc9a
      Paul Eggert authored
      * src/lisp.h (vectorlike_headed): Change from struct to union.
      All uses changed.  Since it has only one member, this does not
      change semantics.  This is designed to simplify future changes
      needed to fix bugs like Bug#29040.  All uses changed.
      5d68dc9a
  16. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  17. 01 Jan, 2017 1 commit
  18. 25 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Reorder lisp.h to declare types before using them · f5b9c1e5
      Paul Eggert authored
      This puts basic functions for types to be after the corresponding
      type definitions.  This is a more-common programming style in C,
      and will make it easier to port Emacs to gcc
      -fcheck-pointer-bounds, since the functions now have access to the
      corresponding types' sizes.  This patch does not change the code;
      it just moves declarations and definitions and removes
      no-longer-needed forward declarations (Bug#25128).
      * src/buffer.c, src/data.c, src/image.c:
      Include process.h, for PROCESSP.
      * src/buffer.h (BUFFERP, CHECK_BUFFER, XBUFFER):
      * src/process.h (PROCESSP, CHECK_PROCESS, XPROCESS):
      * src/termhooks.h (TERMINALP, XTERMINAL):
      * src/window.h (WINDOWP, CHECK_WINDOW, XWINDOW):
      * src/thread.h (THREADP, CHECK_THREAD, XTHREAD, MUTEXP, CHECK_MUTEX)
      (XMUTEX, CONDVARP, CHECK_CONDVAR, XCONDVAR):
      Move here from lisp.h.
      * src/intervals.h: Include buffer.h, for BUFFERP.
      Include lisp.h, for Lisp_Object.
      * src/lisp.h: Reorder declarations and definitions as described
      above.  Move thread includes to be later, so that they can use the
      reordered definitions.  Move some symbols to other headers (noted
      elsewhere).  Remove forward decls that are no longer needed.
      * src/thread.h: Include systhread.h here, not in lisp.h,
      since lisp.h itself does not need systhread.h.
      f5b9c1e5
  19. 07 Nov, 2016 1 commit
    • Paul Eggert's avatar
      Restore file descriptor limit in subprocesses · b6d9613d
      Paul Eggert authored
      Problem reported by Philipp Stephani (Bug#24869).
      * src/callproc.c (child_setup) [!DOS_NT]:
      Call restore_nofile_limit in the child.
      * src/process.c (nofile_limit) [HAVE_SETRLIMIT]: New static var.
      (restore_nofile_limit): New function.
      (init_process_emacs) [HAVE_SETRLIMIT]: Set the new var.
      b6d9613d
  20. 11 Aug, 2016 1 commit
    • Paul Eggert's avatar
      Fix process leak with make-network-process · 2dd8044b
      Paul Eggert authored
      This problem was introduced by the recent async changes (Bug#23808).
      * src/process.c (Fmake_process): Move USE_SAFE_ALLOCA later,
      so that it follows the start_process_unwind unwind-protect.
      Set pid to -1 while the process is being created.
      (start_process_unwind): Omit unnecessary emacs_abort test.
      (connect_network_socket): Simplify use of counts.  Unwind
      bind_polling_period a bit earlier, so that a remove_process
      unwind-protect can be added when needed; this is the heart of
      the fix.  Undo the unwind-protect just before returning.
      2dd8044b
  21. 26 Jun, 2016 1 commit
    • Paul Eggert's avatar
      Try other addresses when connecting to multihomed · 2989ad90
      Paul Eggert authored
      Problem reported by Juliusz Chroboczek (Bug#17976)
      and by Artur Malabarba (Bug#23620).
      Patch from a suggestion by Andreas Schwab in:
      http://bugs.gnu.org/17976#39
      This patch is for non-MS-Windows platforms.
      I don't know the situation on MS-Windows.
      * src/process.c (connecting_status):
      New function, for (connect . ADDRINFOS).
      (connect_network_socket, check_for_dns, wait_for_socket_fds)
      (wait_while_connecting, wait_reading_process_output, status_notify):
      Use it.
      (decode_status, Fmake_network_process):
      Support (connect . ADDRINFOS) status.
      (connect_network_socket) [!WINDOWSNT]:
      If the connection failed and there are other addresses to try, do not
      signal an error; instead, loop around to try the next address.
      (wait_reading_process_output): Advance to the next address
      if there are multiple addresses and the first remaining address
      failed.
      * src/process.h (struct Lisp_Process.status): Adjust comment
      to describe (connect . ADDRINFOS).
      2989ad90
  22. 10 Jun, 2016 1 commit
    • Paul Eggert's avatar
      Fix XFASTINT of non-fixnum in process status · 560202f6
      Paul Eggert authored
      * src/process.c (decode_status): 3rd arg is now Lisp_Object *,
      not int *, and is not decoded.  All uses changed.
      (status_message): Do not assume ‘failed’ code is an integer.
      * src/process.h: Document codes better.
      560202f6
  23. 23 May, 2016 1 commit
    • Paul Eggert's avatar
      Don’t use only last protocol from getaddrinfo · 918ef715
      Paul Eggert authored
      Problem reported by Ken Brown in:
      http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00483.html
      * src/process.c (conv_addrinfo_to_lisp): New function.
      (connect_network_socket): Arg is now a list of addrinfos, not
      merely IP addresses.  All uses changed.  Use protocol from
      each addrinfo.
      (Fmake_network_process): Accumulate protocols into addrinfos
      rather than just using the last one found.
      (check_for_dns): Accumulate protocols here, too.
      * src/process.h (struct Lisp_Process): Remove ai_protocol;
      no longer needed.
      918ef715
  24. 10 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  25. 05 Mar, 2016 1 commit
    • Lars Magne Ingebrigtsen's avatar
      Allow making TLS negotiation blocking · 21b509d4
      Lars Magne Ingebrigtsen authored
      * lisp/net/gnutls.el (gnutls-negotiate): Make negotiation blocking.
      
      * src/gnutls.c (Fgnutls_boot): Provide a new keyword,
      :complete-negotiation, to specify that we want complete
      negotiation even if the socket is non-blocking.
      (gnutls_try_handshake): Complete negotiation if given that keyword.
      
      * src/process.h (L): Added gnutls_complete_negotiation_p.
      21b509d4
  26. 25 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Integer overflow cleanups for ports and socklen · c1415cc9
      Paul Eggert authored
      * src/process.c (struct sockaddr_and_len, conv_sockaddr_to_lisp)
      (get_lisp_to_sockaddr_size, Fset_process_datagram_address)
      (connect_network_socket):
      Use ptrdiff_t, not int, for signed object sizes.
      This addresses only a theoretical problem, as in practice these
      object sizes are less than 2**31, but we might as well use the
      same style here as elsewhere in Emacs.
      (string_integer_p): Remove; all uses removed.
      (Fmake_network_process): Check that port number is in range.
      When converting an integer-string service, rely on strtol
      rather than rechecking the string by hand.
      * src/process.h, src/w32.c (conv_sockaddr_to_lisp):
      Adjust prototypes to match.
      c1415cc9
  27. 23 Feb, 2016 1 commit
    • Paul Eggert's avatar
      Minor cleanups for async DNS etc. · 82848cf6
      Paul Eggert authored
      * src/frame.h (FRAME_WINDOW_CONFIGURATION_CHANGED):
      Omit unnecessary parens.
      * src/gnutls.c (gnutls_try_handshake, emacs_gnutls_deinit)
      (gnutls_verify_boot):
      Use bool for boolean.
      (ATTRIBUTE_FORMAT_PRINTF): Add printf attribute.
      * src/process.c (free_dns_request, Fmake_network_process):
      Allocate and free async request control block all in one go.
      (set_network_socket_coding_system, finish_after_tls_connection)
      (connect_network_socket):
      Now static.
      (conv_numerical_to_lisp): 2nd arg is now int, not unsigned.
      (Fmake_network_process): Use list1 for brevity.
      (wait_for_socket_fds): 2nd arg is now const ptr.
      * src/process.h (struct Lisp_Process.dns_request):
      Now struct gaicb *, not struct gaicb **, since there was always
      exactly one.  All uses changed.
      * src/window.c, src/window.h (run_window_configuration_change_hook):
      Now static.
      82848cf6
  28. 01 Feb, 2016 2 commits
  29. 31 Jan, 2016 3 commits
    • Lars Ingebrigtsen's avatar
      Further TLS async work · 4ff81f8f
      Lars Ingebrigtsen authored
      * gnutls.c (boot_error): New function to either signal an
      error or return an error code.
      (Fgnutls_boot): Don't signal errors when running asynchronously.
      
      * process.h (pset_status): Move here from process.c to be
      able to use from gnutls.c.
      
      * process.c (connect_network_socket): Do the TLS boot here
      when running asynchronously.
      (wait_reading_process_output): Rework the dns_processes
      handling for more safety.
      4ff81f8f
    • Lars Ingebrigtsen's avatar
      Rework the mechanisms for async GnuTLS connections · cecf6c9a
      Lars Ingebrigtsen authored
      * lisp/net/gnutls.el (open-gnutls-stream): Compute the
      gnutls-boot parameters and pass them to the process object.
      (gnutls-negotiate): New parameter :return-keywords that won't
      connect to anything, just compute the keywords.
      
      * lisp/url/url-http.el (url-http): Revert async TLS sentinel
      hack, which is no longer necessary.
      
      * src/gnutls.c (Fgnutls_asynchronous_parameters): Rename from
      gnutls-mark-process.
      
      * src/process.c (connect_network_socket): If we're connecting to
      an asynchronous TLS socket, complete the GnuTLS boot sequence here.
      
      * src/process.h: New parameter gnutls_async_parameters.
      cecf6c9a
    • Lars Ingebrigtsen's avatar
      Implement asynchronous GnuTLS connections · 0f47153b
      Lars Ingebrigtsen authored
      * doc/misc/emacs-gnutls.texi (Help For Developers): Mention
      the nowait parameter.
      
      * lisp/net/gnutls.el (open-gnutls-stream): Allow asynchronous
      connections with the new nowait parameter.
      
      * lisp/net/network-stream.el (network-stream-open-tls): Pass
      on :nowait to open-gnutls-stream.
      
      * lisp/url/url-http.el (url-http): Don't overwrite the
      sentinel created by open-gnutls-stream.
      
      * src/gnutls.c (Fgnutls_mark_process): New function.
      
      * src/process.c (send_process): Don't write to GnuTLS sockets that
      haven't been initialised yed.
      
      * src/process.h: New slot gnutls_wait_p.
      0f47153b
  30. 30 Jan, 2016 1 commit
  31. 29 Jan, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Implement asynchronous name resolution · fdfb6869
      Lars Ingebrigtsen authored
      * process.c (Fmake_network_process): Do asynchronous DNS
      lookups if we have getaddrinfo_a and the user requests :nowait.
      (check_for_dns): New function.
      (wait_reading_process_output): Check for pending name
      resolution in the idle loop.
      
      * process.h: Add structure for async DNS.
      fdfb6869
  32. 28 Jan, 2016 1 commit
    • Lars Ingebrigtsen's avatar
      Refactor make_network_process · e09c0972
      Lars Ingebrigtsen authored
      * src/process.c (set_network_socket_coding_system)
      (connect_network_socket): Refactor out of
      make_network_process to allow calling connect_network_socket
      asynchronously.
      (Fmake_network_process): Do nothing but parsing the parameters
      and name resolution, leaving the connection to
      connect_network_socket.
      e09c0972
  33. 01 Jan, 2016 1 commit
  34. 16 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Make src headers idempotent and standalone · 55ba8c02
      Paul Eggert authored
      Redo src/*.h so that each include file is idempotent (that is, can
      be included multiple times with the latter inclusions having no
      effect) and standalone (that is, can be included by itself,
      with no include file other than config.h needed as a prerequisite).
      This is standard practice in GNU programs nowadays.
      * lwlib/lwlib-widget.h, src/buffer.h, src/category.h, src/character.h:
      * src/charset.h, src/coding.h, src/commands.h, src/disptab.h:
      * src/fontset.h, src/gnutls.h, src/indent.h, src/keymap.h, src/macros.h:
      * src/regex.h [emacs]:
      * src/syntax.h, src/systty.h, src/termhooks.h:
      Include lisp.h, for Lisp_Object.
      * src/buffer.h, src/category.h, src/cm.h, src/commands.h, src/disptab.h:
      * src/indent.h, src/intervals.h, src/keyboard.h, src/macros.h:
      * src/process.h, src/puresize.h, src/region-cache.h, src/syntax.h:
      * src/syssignal.h, src/sysstdio.h, src/systty.h, src/termchar.h:
      * src/termopts.h, src/tparam.h, src/unexec.h:
      Protect against multiple inclusion.
      * src/buffer.h: Include character.h, for STRING_CHAR.
      * src/emacsgtkfixed.h (struct frame):
      * src/fontset.h (struct face):
      * src/region-cache.h (struct buffer):
      * src/termhooks.h (struct glyph):
      * src/xsettings.h (struct x_display_info):
      Add possibly-forward decl.
      * src/syntax.h: Include buffer.h, for BVAR.
      * src/sysselect.h: Include lisp.h, for eassume.
      * src/termchar.h: Include <stdio.h>, for FILE.
      * src/widget.h: Include <X11/IntrinsicP.h>, for Widget.
      * src/xsettings.h: Include <X11/Xlib.h>, for XEvent.
      55ba8c02
  35. 08 Sep, 2015 1 commit
  36. 10 Apr, 2015 1 commit
    • Daiki Ueno's avatar
      Add facility to collect stderr of async subprocess · f55ea05b
      Daiki Ueno authored
      * src/w32.h (register_aux_fd): New function declaration.
      * src/w32.c (register_aux_fd): New function.
      * src/process.h (struct Lisp_Process): New member stderrproc.
      * src/process.c (PIPECONN_P): New macro.
      (PIPECONN1_P): New macro.
      (Fdelete_process, Fprocess_status, Fset_process_buffer)
      (Fset_process_filter, Fset_process_sentinel, Fstop_process)
      (Fcontinue_process): Handle pipe process specially.
      (create_process): Respect p->stderrproc.
      (Fmake_pipe_process): New function.
      (Fmake_process): Add new keyword argument :stderr.
      (wait_reading_process_output): Specially handle a pipe process when
      it gets an EOF.
      (syms_of_process): Register Qpipe and Smake_pipe_process.
      
      * doc/lispref/processes.texi (Asynchronous Processes): Document
      `make-pipe-process' and `:stderr' keyword of `make-process'.
      
      * lisp/subr.el (start-process): Suggest to use `make-process' handle
      standard error separately.
      
      * test/automated/process-tests.el (process-test-stderr-buffer)
      (process-test-stderr-filter): New tests.
      
      * etc/NEWS: Mention new process type `pipe' and its usage with the
      `:stderr' keyword of `make-process'.
      f55ea05b
  37. 14 Jan, 2015 1 commit