1. 23 Feb, 2019 2 commits
    • Paul Eggert's avatar
      Don’t assume timersub and gettimeofday · 975893b2
      Paul Eggert authored
      POSIX does not specify timersub, and marks gettimeofday as
      obsolescent.  Avoid porting problems by using timespec.h
      functions instead.
      * src/editfns.c: Include systime.h instead of sys/time.h.
      (EXTRA_CONTEXT_FIELDS): Replace start and max_secs with
      time_limit.  All uses changed.  This removes the need to call
      gettimeofday or timersub.
      * src/term.c (timeval_to_Time): Remove.  Replace all uses with ...
      (current_Time): ... this new function, removing the need to
      call gettimeofday.
      975893b2
    • Tassilo Horn's avatar
      Improve replace-buffer-contents/replace-region-contents · e96923c1
      Tassilo Horn authored
      * src/editfns.c (Freplace_buffer_contents): Add two optional arguments
        for mitigating performance issues.
      * lisp/emacs-lisp/subr-x.el (replace-region-contents): Move from
        subr.el.  Add the same two arguments as for replace-buffer-contents.
      * lisp/json.el (json-pretty-print-max-secs): New variable holding the
        default MAX-SECS value json-pretty-print passes to
        replace-buffer-contents.
        (json-pretty-print): Use it.
      * doc/lispref/text.texi (Replacing): Add documentation for
        replace-buffer-contents two new optional arguments.  Document
        replace-region-contents.
      e96923c1
  2. 19 Feb, 2019 2 commits
  3. 18 Feb, 2019 3 commits
    • Paul Eggert's avatar
      Minor profiler improvements · 5d468624
      Paul Eggert authored
      * src/profiler.c (evict_lower_half, record_backtrace)
      (setup_cpu_timer, cmpfn_profiler, hashfn_profiler):
      Assume C99.  Use bool for boolean.
      (timer_getoverrun): Remove; simplify use to not need it.
      (Fprofiler_cpu_start): Any negative return from setup_cpu_timer fails.
      (Fprofiler_cpu_stop): Simplify initialization.
      5d468624
    • Ken Brown's avatar
      Use 'timer_getoverrun' on Cygwin when possible · eccfdaff
      Ken Brown authored
      * configure.ac: Add a check for the 'timer_getoverrun' function.
      
      * src/profiler.c [CYGWIN] : Define 'timer_getoverrun' as a
      macro only on versions of Cygwin where it is not already
      defined as a function.
      eccfdaff
    • Paul Eggert's avatar
      * src/fns.c: Fix comment. · 287dd6ba
      Paul Eggert authored
      287dd6ba
  4. 16 Feb, 2019 1 commit
  5. 15 Feb, 2019 2 commits
  6. 13 Feb, 2019 2 commits
    • Eli Zaretskii's avatar
      Avoid crashes upon C-g in nested invocations of 'read_char' · 6d89120b
      Eli Zaretskii authored
      * src/keyboard.c (read_char, read_event_from_main_queue):
      Ensure the global value of getcjmp is restored when the stack
      is unwound by the likes of 'throw', by calling
      record_unwind_protect_ptr instead of restoring the value
      manually.  (Bug#34394)
      (restore_getcjmp): Argument is now 'void *', to match the
      signature of record_unwind_protect_ptr.
      
      (cherry picked from commit 10527fca)
      6d89120b
    • Eli Zaretskii's avatar
      Avoid crashes upon C-g in nested invocations of 'read_char' · 10527fca
      Eli Zaretskii authored
      * src/keyboard.c (read_char, read_event_from_main_queue):
      Ensure the global value of getcjmp is restored when the stack
      is unwound by the likes of 'throw', by calling
      record_unwind_protect_ptr instead of restoring the value
      manually.  (Bug#34394)
      (restore_getcjmp): Argument is now 'void *', to match the
      signature of record_unwind_protect_ptr.
      10527fca
  7. 12 Feb, 2019 1 commit
  8. 10 Feb, 2019 1 commit
    • Eli Zaretskii's avatar
      Unbreak the Cygw32 build · 24695e89
      Eli Zaretskii authored
      * src/emacs.c (main) [HAVE_NTGUI]: Remove code that is only
      for WINDOWSNT or condition it on WINDOWSNT.  (Bug#34409)
      24695e89
  9. 08 Feb, 2019 4 commits
    • Tassilo Horn's avatar
      Add new function replace-buffer-contents · 61748cd7
      Tassilo Horn authored
      * src/editfns.c (Freplace_buffer_contents): Use lower value of
        too_expensive and enable heuristic.
      * lisp/subr.el (replace-region-contents): New convenient wrapper
        function around replace-buffer-contents.
      61748cd7
    • Eli Zaretskii's avatar
      Minor improvements to do strings in callproc.c · 0cd7b526
      Eli Zaretskii authored
      * src/callproc.c (Fcall_process, Fcall_process_region): Minor
      fixes to doc strings.  Suggested by Nicholas Drozd
      <nicholasdrozd@gmail.com>.  (Bug#34274)
      0cd7b526
    • Robert Pluim's avatar
      Unify three font info structures · 9e0d69b5
      Robert Pluim authored
      * src/ftfont.h (struct font_info): New type, unifies similar types
      from ftcrfont.c, ftfont.c and xftfont.c
      * src/xftfont.c (struct xftfont_info): Remove, replace with struct
      font_info.  Adjust all uses.
      * src/ftcrfont.c (struct ftcrfont_info): Likewise.
      * src/ftfont.c (struct ftfont_info): Likewise.
      9e0d69b5
    • Robert Pluim's avatar
      Fix process-thread docstring · 8e22025f
      Robert Pluim authored
      * src/process.c (Fprocess_thread): Correct docstring.
      8e22025f
  10. 07 Feb, 2019 3 commits
  11. 06 Feb, 2019 3 commits
  12. 04 Feb, 2019 3 commits
    • Eli Zaretskii's avatar
      Avoid segfaults due to image cache being cleared during redisplay · ef17247f
      Eli Zaretskii authored
      * src/xdisp.c (redisplay_internal): Set the
      inhibit_clear_image_cache flag of a frame while its windows
      are being redisplayed, and reset the flag after the call top
      update_frame returns.
      * src/image.c (clear_image_cache): Do nothing if the frame's
      inhibit_clear_image_cache flag is set.  (Bug#34256)
      * src/frame.h (struct frame): New flag inhibit_clear_image_cache.
      ef17247f
    • Eli Zaretskii's avatar
      Support (locale-info 'paper) on MS-Windows · f37000ae
      Eli Zaretskii authored
      * src/w32proc.c (LOCALE_IPAPERSIZE): Define if undefined.
      (nl_langinfo): Support _NL_PAPER_WIDTH and _NL_PAPER_HEIGHT
      like glibc does.
      * src/fns.c (Flocale_info): Update the doc string.
      
      * nt/inc/langinfo.h: Add _NL_PAPER_WIDTH and _NL_PAPER_HEIGHT
      to the enumeration.
      (_NL_PAPER_WIDTH, _NL_PAPER_HEIGHT): Define namesake macros.
      * nt/mingw-cfg.site (emacs_cv_langinfo__nl_paper_width): Set
      to 'yes'.
      
      * doc/lispref/nonascii.texi (Locales): Update the
      documentation of 'locale-info' for the argument of 'paper'.
      
      * etc/NEWS: Update the locale-info entry.
      f37000ae
    • 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
  13. 02 Feb, 2019 4 commits
  14. 01 Feb, 2019 1 commit
    • Paul Eggert's avatar
      Rename CANNOT_DUMP to HAVE_UNEXEC · 3b69e02a
      Paul Eggert authored
      * configure.ac (CANNOT_DUMP): Remove.  All uses removed,
      or changed to the negative of with_unexec.
      (HAVE_UNEXEC): New macro.  All uses of CANNOT_DUMP changed
      to the negative of this macro.
      3b69e02a
  15. 31 Jan, 2019 3 commits
    • Paul Eggert's avatar
      Prefer static to extern where either will do · 47679e63
      Paul Eggert authored
      * src/charset.c (charset_table_size):
      * src/pdumper.c (dump_private):
      * src/sysdep.c (init_sigsegv):
      * src/window.c (old_selected_window):
      Now static.
      * src/charset.c (charset_table_size):
      Now int, since the value always fits in int.
      * src/gtkutil.c (xg_gtk_initialized): Now present only if
      HAVE_XWIDGETS, to make it clearer that this is an xwidgets
      hack.  All uses changed.
      * src/lread.c (ndefsubr): Remove; unused.
      * src/pdumper.h: Use usual GNU indenting style for functions,
      since my static-vs-extern checking hack relies on it.
      (dump_public): Always declare; simpler and doesn’t hurt.
      (pdumper_handle_page_fault): Remove unused decl.
      47679e63
    • Paul Eggert's avatar
      Widen modiff counts to avoid wraparound · 05d2fc71
      Paul Eggert authored
      Widen modification counts to at least 64 bits, to make
      wraparound practically impossible.
      * doc/lispref/buffers.texi (Buffer Modification):
      Don’t say the modification-count can wrap around.
      * src/buffer.c (Frestore_buffer_modified_p, Fbuffer_swap_text)
      (modify_overlay):
      * src/insdel.c (insert_1_both, insert_from_string_1)
      (insert_from_gap, insert_from_buffer_1)
      (adjust_after_replace, replace_range, replace_range_2)
      (del_range_2, modify_text):
      * src/textprop.c (modify_text_properties):
      Use modiff_incr instead of incrementing	directly.
      (Fbuffer_modified_tick, Fbuffer_chars_modified_tick):
      Don’t assume modification counts fit into fixnums.
      * src/buffer.h (struct buffer_text, struct buffer):
      * src/cmds.c (internal_self_insert):
      * src/fileio.c (Finsert_file_contents):
      * src/indent.c (last_known_column_modified):
      * src/keyboard.c (command_loop_1):
      * src/marker.c (cached_modiff):
      * src/syntax.c (find_start_modiff, parse_sexp_propertize)
      (find_defun_start):
      * src/window.h (struct window):
      Use modiff_count for modification counts.
      * src/editfns.c (Fsubst_char_in_region):
      Copy instead of incrementing modification counts,
      since integer overflow checking is not needed here.
      * src/lisp.h (modiff_count): New type.
      (modiff_incr, modiff_to_integer): New inline functions.
      * src/pdumper.c (dump_buffer): Update hash.
      05d2fc71
    • Paul Eggert's avatar
      Minor pdumper simplification · a68eee50
      Paul Eggert authored
      * src/pdumper.c (dump_roots, pdumper_load): Simplify initialization.
      (dump_bitset_init, pdumper_load): Omit unnecessary assignments.
      (dump_bitset_destroy): Remove; never called.  All callers removed.
      (dump_do_dump_relocation, pdumper_load): Add FIXME comment.
      (pdumper_load): Simplify by assuming C99.  Remove unused local.
      a68eee50
  16. 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
  17. 28 Jan, 2019 3 commits
  18. 27 Jan, 2019 1 commit
    • Paul Eggert's avatar
      forward-line now works with bignums · cc1c46e4
      Paul Eggert authored
      * src/cmds.c (Fforward_line): Support bignum arg.
      (scan_newline): Return void since no caller was using the
      return value.
      * src/search.c (find_newline, scan_newline_from_point)
      (find_newline1): Return the number of newlines counted, not
      the count shortage, so that the return value always fits in
      ptrdiff_t even if the original count was a bignum.  All
      callers changed.
      * test/src/cmds-tests.el (forward-line-with-bignum): New test.
      cc1c46e4