1. 14 Sep, 2020 1 commit
  2. 21 Aug, 2020 1 commit
  3. 03 Aug, 2020 1 commit
    • Derek Zhou's avatar
      Fix problem where TLS connections would sometimes hang · f921fece
      Derek Zhou authored
      * src/process.c (wait_reading_process_output): Before the select,
      check every interesting gnutls stream for available data in the
      buffer.  If some of them hit, and either there is no wait_proc or
      the wait_proc is one of the gnutls streams with new data, set the
      select timeout to 0 after the select, and merge the gnutls buffer
      status into the select returns (bug#40665).  This fixes a problem
      where TLS connections would sometimes hang.
      f921fece
  4. 05 Apr, 2020 1 commit
    • Paul Eggert's avatar
      Improve integer range checking · bec5cfee
      Paul Eggert authored
      * src/bignum.c (check_integer_range, check_uinteger_max)
      (check_int_nonnegative): New functions.
      * src/frame.c (check_frame_pixels): New function.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it.
      * src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER):
      Remove these macros.  Unless otherwise specified, all callers
      replaced by calls to check_integer_range, check_uinteger_range,
      check_int_nonnegative.
      * src/frame.c (gui_set_right_divider_width)
      (gui_set_bottom_divider_width):
      * src/nsfns.m (ns_set_internal_border_width):
      * src/xfns.c (x_set_internal_border_width):
      Using check_int_nonnegative means these functions no longer
      incorrectly reject negative bignums; they treat them as 0,
      just like negative fixnums.
      bec5cfee
  5. 03 Apr, 2020 1 commit
    • Robert Pluim's avatar
      Make make-{network,serial}-process handle :coding nil consistently · d08e81ce
      Robert Pluim authored
      The handling of :coding nil was different between
      make-{network,serial}-process and make-{pipe}process.  Now they all
      handle :coding nil as if :coding had not been specified.
      
      * process.c (Fmake_serial_process)
      (set_network_socket_coding_system): Use plist-get to check if
      :coding has been specified instead of plist-member, to ensure that
      ":coding nil" does not override coding-system-for-{read,write}.
      
      * network-stream-tests.el (check-network-process-coding-system-bind)
      (check-network-process-coding-system-no-override)
      (check-network-process-coding-system-override): New tests.
      
      * etc/NEWS: Describe change in make-network-process and
      make-serial-process :coding behavior.
      d08e81ce
  6. 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
  7. 06 Mar, 2020 1 commit
  8. 01 Jan, 2020 1 commit
  9. 21 Dec, 2019 2 commits
  10. 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
  11. 09 Nov, 2019 1 commit
  12. 08 Nov, 2019 1 commit
    • Robert Pluim's avatar
      Ensure building and running on non-IPv6 capable hosts works · 063277c5
      Robert Pluim authored
      * src/process.c (Fmake_network_process) [AF_INET6]: Only build ::1
      localhost when IPv6 is supported.
      (Fnetwork_lookup_address_info) [AF_INET6]: Move check for Qipv6 inside
      ifdef, since its definition depends on AF_INET6.  Don't return IPv6
      addresses when they're not supported.
      
      * test/src/process-tests.el (lookup-family-specification,
      lookup-google): Only do IPv6 lookup if IPv6 is supported.
      063277c5
  13. 07 Nov, 2019 1 commit
  14. 24 Sep, 2019 2 commits
  15. 23 Sep, 2019 2 commits
    • Lars Ingebrigtsen's avatar
      make-network-process doc clarification · 8c1e0ed7
      Lars Ingebrigtsen authored
      * src/process.c (Fmake_network_process): Further doc clarification
      for listening on "::".
      8c1e0ed7
    • Paul Eggert's avatar
      Update some URLs · 946a56a1
      Paul Eggert authored
      This mostly changes http: to https: in URLs.  It also updates
      some URLs that have moved, removes some URLs that no longer
      work, recommends against using procmail (procmail.org no
      longer works), and removes some mentions of the
      no-longer-existing Gmane, LPF and VTW.
      It doesn't update all URLs, just the ones I had time for.
      * GNUmakefile (help):
      * admin/admin.el (manual-doctype-string):
      * admin/charsets/Makefile.in (${charsetdir}/ALTERNATIVNYJ.map):
      * admin/charsets/mapconv:
      * lisp/net/soap-client.el (soap-create-envelope):
      * lisp/org/org.el (org-doi-server-url):
      * lisp/textmodes/bibtex.el (bibtex-generate-url-list):
      Prefer https: to http: un URLs.
      946a56a1
  16. 21 Sep, 2019 1 commit
  17. 20 Sep, 2019 1 commit
    • Lars Ingebrigtsen's avatar
      Allow `process-contact' not to block · b8e9baac
      Lars Ingebrigtsen authored
      * doc/lispref/processes.texi (Process Information): Document it.
      
      * lisp/simple.el (list-processes--refresh): Don't wait for contact
      information for non-setup processes.
      
      * src/process.c (Fprocess_contact): Take an optional parameter to
      avoid blocking (bug#37408).
      b8e9baac
  18. 23 Aug, 2019 3 commits
    • Eli Zaretskii's avatar
      ; Fix last change. · f38901d4
      Eli Zaretskii authored
      * src/process.c (network_lookup_address_info_1): A better fix for
      compilation on platforms without HAVE_GAI_STRERROR.  (Bug#37158)
      f38901d4
    • Robert Pluim's avatar
      Fix compilation of process.c · cbd536d6
      Robert Pluim authored
      * src/process.c (network_lookup_address_info_1): [!HAVE_GAI_STRERROR]:
      Use make_fixnum instead of make_number.  (Bug#37158).
      cbd536d6
    • Paul Eggert's avatar
      Get the Gnutls code compiling on Fedora 30 · 49a8c850
      Paul Eggert authored
      The recent changes caused the build to fail on Fedora 30 when built
      with --enable-gcc-warnings, among other things with diagnostics that
      gnutls_compression_get and gnutls_compression_get_name are deprecated
      (this started with GnuTLS 3.6).  Fix this by refusing to call these
      obsolescent and now-dummy functions in GnuTLS 3.6 and later.  However,
      this is just a temporary workaround to get the build working; a real
      fix is needed, as network-stream-tests fail.
      * src/gnutls.c (HAVE_GNUTLS_COMPRESSION_GET): New macro.
      (gnutls_compression_get, gnutls_compression_get_name):
      Define only if HAVE_GNUTLS_COMPRESSION_GET.
      (init_gnutls_functions): Load the two functions only if
      HAVE_GNUTLS_COMPRESSION_GET.
      (emacs_gnutls_certificate_export_pem): Use alloca instead of xmalloc.
      (Fgnutls_peer_status): Just return "NULL" if the functions
      are deprecated.
      (Fgnutls_format_certificate): Fix pointer signedness glitches.
      * src/process.c: Fix spacing.
      49a8c850
  19. 07 Aug, 2019 1 commit
  20. 25 Jul, 2019 1 commit
    • Noam Postavsky's avatar
      Fix subproc listening when setting filter to non-t (Bug#36591) · b3e20737
      Noam Postavsky authored
      * src/process.c (Fset_process_filter): Call add_process_read_fd
      according to the state of process filter before it's updated.  This
      restores the correct functioning as it was before 2016-02-16 "Allow
      setting the filter masks later".  Inline the set_process_filter_masks
      call instead of fixing it that function, because it is also called
      from connect_network_socket, and we don't want to change the behavior
      of that function so close to release.
      * test/src/process-tests.el (set-process-filter-t): New test.
      b3e20737
  21. 15 Jul, 2019 1 commit
  22. 07 Jul, 2019 1 commit
    • Paul Eggert's avatar
      Remove printmax_t etc. · 8f522efe
      Paul Eggert authored
      printmax_t etc. were needed only for platforms that lacked
      support for printing intmax_t.  These platforms are now so
      obsolete that they are no longer practical porting targets.
      * src/image.c (gs_load): Fix unlikely buffer overrun
      discovered while making these changes.  It was introduced in
      2011-07-17T00:34:43!eggert@cs.ucla.edu.
      * src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
      Remove.  All uses replaced by their standard counterparts
      intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
      8f522efe
  23. 27 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Clean up use of XFIXNUM etc. · 4893a09c
      Paul Eggert authored
      A few bits of the code were relying on the fact that XFIXNUM,
      XFIXNAT, and XUFIXNUM do something even with arguments that
      are not fixnums/fixnats.  Separate these rare uses out into
      XFIXNUM_RAW and XUFIXNUM_RAW.
      Problem and original patch reported by Pip Cet (Bug#36370).
      * src/ccl.c (Fccl_execute_on_string):
      * src/fileio.c (Finsert_file_contents, a_write)
      (Fdo_auto_save):
      * src/process.c (conv_lisp_to_sockaddr):
      * src/textprop.c (Fnext_single_char_property_change)
      (Fprevious_single_char_property_change)
      (Fnext_property_change, Fnext_single_property_change)
      (Fprevious_property_change)
      (Fprevious_single_property_change):
      Don’t assume fixnums are nonnegative.
      * src/ccl.c (Fccl_execute_on_string):
      Fix range-checking bug if AREF (status, i) is out of int range.
      * src/data.c (arith_driver): Use XFIXNUM_RAW as we want
      efficient garbage if the value is not a fixnum.
      * src/dosfns.c (Fint86, Fdos_memput):
      Check that args are nonnegative.
      * src/image.c (lookup_image): Check that args are in range.
      * src/lisp.h (lisp_h_XHASH): Use XUFIXNUM_RAW, since this
      is for hashing.
      (lisp_h_XFIXNAT, XFIXNAT) [USE_LSB_TAG]: Remove macros.
      (lisp_h_XFIXNUM_RAW, XFIXNUM_RAW) [USE_LSB_TAG]: New macros, with
      the semantics of the old macros without _RAW.
      (XFIXNUM_RAW, XUFIXNUM_RAW): New inline functions, with the
      semantics of the old functions without _RAW.
      (FIXNUMP): Move definition up to avoid forward use.
      (XFIXNUM, XFIXNAT, XUFIXNUM): Use eassume to add a runtime
      check (when debugging) that the argument has the proper form.
      (XFIXNUM, XFIXNAT): Now inline functions only, since they
      refer to their arguments more than once now that they use eassume.
      * src/textprop.c (Fprevious_single_char_property_change):
      Avoid fixnum overflow with invalid input.
      (set_text_properties): Fix unlikely failure
      to validate arguments, by using EQ instead of XFIXNAT.
      * src/w32term.c (w32_draw_glyph_string):
      * src/xterm.c (x_draw_glyph_string):
      Treat negative minimums as 0 rather than as garbage patterns.
      4893a09c
  24. 25 Jun, 2019 1 commit
    • Paul Eggert's avatar
      Avoid some strlen work, primarily via strnlen · d7c68362
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
      * lib-src/etags.c (find_entries):
      * src/emacs.c (main):
      * src/nsmenu.m (parseKeyEquiv:):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/term.c (vfatal):
      Prefer !*X to !strlen (X).
      * lib-src/etags.c (pfnote, add_regex):
      * lib-src/pop.c (pop_open):
      * lib-src/update-game-score.c (main):
      * lwlib/lwlib.c (lw_separator_p):
      * src/doprnt.c (doprnt):
      * src/emacs.c (main):
      * src/inotify.c (inotifyevent_to_event):
      * src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
      * src/sysdep.c (get_current_dir_name_or_unreachable):
      * src/xdisp.c (store_mode_line_string):
      Use strnlen to avoid unnecessary work with strlen.
      * lib-src/etags.c (Prolog_functions, prolog_pr)
      (Erlang_functions, erlang_func):
      Prefer ptrdiff_t to size_t when either will do.
      (prolog_pr, erlang_func): New arg LASTLEN, to avoid
      unnecessary strlen call. All callers changed.
      * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
      * lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
      * lwlib/lwlib.c (lw_separator_p):
      * src/json.c (json_has_prefix):
      Use strncmp to avoid unecessary work with strlen + memcmp.
      * src/process.c (set_socket_option): Use SBYTES instead of strlen.
      d7c68362
  25. 19 Apr, 2019 1 commit
    • Philipp Stephani's avatar
      Remove :stop key from make-process. · 5c5e3095
      Philipp Stephani authored
      This has never worked and caused issues such as Bug#30460.
      
      * src/process.c (Fmake_process): Don't accept :stop key any more.
      (syms_of_process): Define needed symbol 'null'.
      
      * test/src/process-tests.el (make-process/stop): New unit test.
      
      * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
      key from manual.
      5c5e3095
  26. 15 Apr, 2019 1 commit
    • Noam Postavsky's avatar
      Let debugger handle process spawn errors on w32 (Bug#33016) · 9800df69
      Noam Postavsky authored
      Since child_setup() is called between block_input()...unblock_input(),
      when an error is signaled the Lisp debugger is prevented from
      starting.  Therefore, let the callers signal the error instead (which
      they already do for non-w32 platforms, just the error message needs an
      update).
      * src/callproc.c (child_setup) [WINDOWSNT]: Don't call
      report_file_error here.
      (call_process) [WINDOWNT]:
      * src/process.c (create_process) [WINDOWSNT]: Call report_file_errno
      here instead, after the unblock_input() call, same as for !WINDOWSNT.
      * src/lisp.h (CHILD_SETUP_ERROR_DESC): New preprocessor define.  Flip
      the containing ifndef DOS_NT branches so that it's ifdef DOS_NT.
      * src/eval.c (when_entered_debugger): Remove.
      (syms_of_eval) <internal-when-entered-debugger>: Define it as a Lisp
      integer variable instead.
      (maybe_call_debugger): Update comment.
      * test/src/process-tests.el (make-process-w32-debug-spawn-error):
      * test/src/callproc-tests.el (call-process-w32-debug-spawn-error): New
      tests.
      9800df69
  27. 08 Apr, 2019 1 commit
  28. 08 Feb, 2019 1 commit
  29. 04 Feb, 2019 1 commit
    • Robert Pluim's avatar
      Use IPv6 localhost when family is 'ipv6 · 49f62430
      Robert Pluim authored
      This fixes Bug#34193
      
      * src/process.c (Fmake_network_process): Explicitly use ::1 when
      using IPv6 with 'local.  Update docstring.
      
      * test/lisp/net/network-stream-tests.el
      (make-ipv6-tcp-server-with-unspecified-port):
      (make-ipv6-tcp-server-with-specified-port): Test creating ipv6
      local server.
      (make-server): Add optional family argument, default ipv4
      (echo-server-with-local-ipv4): Test connecting to 'local ipv4
      (echo-server-with-local-ipv6): Test connecting to 'local ipv6
      
      * doc/lispref/processes.texi (Network Processes): Describe
      behavior when using 'local.
      
      * etc/NEWS: Document new 'make-network-process' behavior when
      connecting to 'local with ipv6.
      49f62430
  30. 30 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Fix process-contact bug with TCP connections · 9c8412a0
      Paul Eggert authored
      This fixes a regression from Emacs 25.3 (Bug#34134).
      * src/process.c (server_accept_connection):
      Set host correctly, fixing a bug introduced in
      2017-09-16T21:29:18Z!eggert@cs.ucla.edu
      when working around a GCC bug.
      9c8412a0
  31. 16 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Fix unlikely races with GnuTLS, datagrams · e87e6a24
      Paul Eggert authored
      Retry some calls if interrupted at inopportune times.
      These were found by code inspection.
      * src/gnutls.c (gnutls_try_handshake): Simplify by using
      new emacs_gnutls_handle_error API.
      (emacs_gnutls_write): Remove GNUTLS_E_AGAIN hack since
      emacs_gnutls_handle_error now does that.
      Use emacs_gnutls_handle_error only on errors.
      (emacs_gnutls_read): Retry if gnutls_record_recv returns
      GNUTLS_E_INTERRUPTED, to be consistent with emacs_read.
      (emacs_gnutls_handle_error): Return 0 on fatal errors,
      -1 (setting errno) on ordinary errors, to simplify callers.
      Assume that ERR is negative, since it always is now.
      Map non-fatal GnuTLS errors to errno values as best we can.
      * src/process.c (read_process_output) [DATAGRAM_SOCKETS]:
      Retry recvfrom if it is interrupted, to be consistent with
      how things are handled when not a datagram channel.
      (send_process) [DATAGRAM_SOCEKTS]: If sendto is interrupted,
      process pending signals and retry it, to be consistent with
      how things are handled when not a datagram channel.
      e87e6a24
  32. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  33. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  34. 01 Jan, 2019 1 commit
  35. 27 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Improve accept-process-process doc · c9fdd1b4
      Paul Eggert authored
      * doc/lispref/processes.texi (Accepting Output):
      * src/process.c (Faccept_process_output):
      Document that (accept-process-output P) can return non-nil
      even after P has exited, and that it can return nil even if P
      is still running (Bug#33839).
      c9fdd1b4