1. 20 Aug, 2018 2 commits
  2. 19 Aug, 2018 9 commits
    • Paul Eggert's avatar
      Fix expt signedness bug --without-wide-int · ecd7a940
      Paul Eggert authored
      Problem reported by Federico in:
      * src/floatfns.c (Fexpt): Use TYPE_RANGED_FIXNUMP, not
      RANGED_FIXNUMP, to fix bug with unsigned comparison on
      platforms built --without-wide-int.
    • Stefan Monnier's avatar
    • Paul Eggert's avatar
      Add bignum support to expt · 47b7a5bd
      Paul Eggert authored
      Problem and initial solution reported by Andy Moreton in:
      * doc/lispref/numbers.texi (Math Functions): expt integer
      overflow no longer causes truncation; it now signals an error
      since bignum overflow is a big deal.
      * src/floatfns.c (Fexpt): Support bignum arguments.
      * test/src/floatfns-tests.el (bignum-expt): New test.
    • Paul Eggert's avatar
      Fix bug with ‘mod’ and float+bignum · 06b5bcd6
      Paul Eggert authored
      Problem reported by Andy Moreton in:
      * src/floatfns.c (fmod_float): Work even if an arg is a bignum.
      * test/src/floatfns-tests.el (bignum-mod): New test.
    • Paul Eggert's avatar
      Update from Gnulib · 35185923
      Paul Eggert authored
      This incorporates:
      2018-08-18 Avoid -Wcast-function-type warnings from casts
      * build-aux/config.sub, lib/gettimeofday.c: Copy from Gnulib.
    • Paul Eggert's avatar
      Tweak integer division · 7ea369e5
      Paul Eggert authored
      * src/data.c (arith_driver): Reorder to remove unnecessary
      FIXNUMP.  Tighten test for whether to convert the divisor from
      fixnum to mpz_t.  Simplify.
    • Paul Eggert's avatar
      Simplify float_arith_driver · a1b79567
      Paul Eggert authored
      * src/data.c (float_arith_driver): Simplify, as we needn’t
      worry about that 30-year-old compiler bug any more.
    • Paul Eggert's avatar
      Minor fixups for intmax_t→mpz_t conversion · b1840206
      Paul Eggert authored
      * src/alloc.c (mpz_set_intmax_slow): Tighten assertion.
      Work even in the unlikely case where libgmp uses nails.
      * src/data.c (FIXNUMS_FIT_IN_LONG): New constant.
      (arith_driver): Use it to tighten compile-time checks.
      * src/lisp.h (mpz_set_intmax): Do not assume that converting
      an out-of-range value to ‘long’ is harmless, as it might raise
      a signal.  Use simpler expression; compiler can optimize.
    • Paul Eggert's avatar
      Improve --with-wide-int mpz_t→fixnum conversion · 6eade1ef
      Paul Eggert authored
      These tuneups and minor simplifications should affect only
      platforms with EMACS_INT wider than ‘long’.
      * src/alloc.c (make_number): If the number fits in long but
      not in fixnum, do not attempt to convert to fixnum again.
      Tighten the compile-time check for whether the second attempt
      is worth trying, from sizeof (long) < sizeof (EMACS_INT) to
      LONG_WIDTH < FIXNUM_BITS.  Do not bother computing the sign of
      the value to tighten the bounds for whether to try the second
      attempt, as it’s not worth the effort.  Do not call mpz_size,
      which is unnecessary since the number of bits is already known
      and the loop can iterate over a shift count instead.  Avoid
      unnecessary casts.  Use + instead of | where either will do,
      as + is typically better for optimization.
      Improve mpz_t to fixnum when --with-wide-int
      * src/alloc.c (make_number): Avoid undefined behavior
      when shifting an EMACS_UINT by more than EMACS_UINT_WIDTH bits.
      Check for integer overflow when shifting.
  3. 18 Aug, 2018 4 commits
    • Paul Eggert's avatar
      Improve bignum comparison (Bug#32463#50) · 1d2df2fd
      Paul Eggert authored
      * src/data.c (isnan): Remove, as we can assume C99.
      (bignumcompare): Remove, folding its functionality
      into arithcompare.
      (arithcompare): Compare bignums directly here.
      Fix bugs when comparing NaNs to bignums.
      When comparing a bignum to a fixnum, just look at the
      bignum’s sign, as that’s all that is needed.
      Decrease scope of locals when this is easy.
      * test/src/data-tests.el (data-tests-bignum): Test bignum vs NaN.
    • Paul Eggert's avatar
      Document that ‘random’ is limited to fixnums · 97d27303
      Paul Eggert authored
      Problem reported by Pip Cet (Bug#32463#20).
      * doc/lispref/numbers.texi (Random Numbers):
      * src/fns.c (Frandom): Adjust doc.
    • Paul Eggert's avatar
      Restore traditional lsh behavior on fixnums · 673b1785
      Paul Eggert authored
      * doc/lispref/numbers.texi (Bitwise Operations): Document that
      the traditional (lsh A B) behavior is for fixnums, and that it
      is an error if A and B are both negative and A is a bignum.
      See Bug#32463.
      * lisp/subr.el (lsh): New function, moved here from src/data.c.
      * src/data.c (ash_lsh_impl): Remove, moving body into Fash
      since it’s the only caller now.
      (Fash): Check for out-of-range counts.  If COUNT is zero,
      return first argument instead of going through libgmp.  Omit
      lsh code since lsh is now done in Lisp.  Add code for shifting
      fixnums right, to avoid a round trip through libgmp.
      (Flsh): Remove; moved to lisp/subr.el.
      * test/lisp/international/ccl-tests.el (shift):
      Test for traditional lsh behavior, instead of assuming
      lsh is like ash when bignums are present.
      * test/src/data-tests.el (data-tests-logand)
      (data-tests-logior, data-tests-logxor, data-tests-ash-lsh):
      New tests.
    • Eli Zaretskii's avatar
      Avoid compilation warning in w32fns.c · 877cd22f
      Eli Zaretskii authored
      * src/w32fns.c (Fw32_read_registry): Avoid compiler warning
      regarding possible use of 'rootkey' without initializing it
      first.  Reported by Andy Moreton <andrewjmoreton@gmail.com>.
  4. 17 Aug, 2018 7 commits
    • Paul Eggert's avatar
      Improve ‘abs’ performance · 33002872
      Paul Eggert authored
      * src/floatfns.c (Fabs): Improve performance by not copying
      the argument if it would eql the result.  As a minor detail,
      don't assume fixnums are two’s complement.
    • Eli Zaretskii's avatar
      Improve documentation of bignums · 9189afc1
      Eli Zaretskii authored
      * etc/NEWS: Enhance the announcement of bignums.
      * doc/lispref/numbers.texi (Integer Basics): Add a missing
      period.  Reported by Basil L. Contovounesios <contovob@tcd.ie>.
    • Andy Moreton's avatar
      Pacify -Wcast-function-type warnings in GCC 8.1 · cc5325b0
      Andy Moreton authored
      * src/image.c: Move attributes into DEF_DLL_FN call.
      * src/dynlib.c (dynlib_addr): Use get_proc_addr.
      * src/w32.h: (get_proc_addr): New function.
      (LOAD_DLL_FN): Use it.
      (DEF_DLL_FN): Allow function attributes after argument
      list.  Add function pointer type used by LOAD_DLL_FN.
      * src/w32.c (open_process_token, get_token_information)
      (lookup_account_sid, get_sid_sub_authority)
      (get_sid_sub_authority_count, get_security_info)
      (get_file_security, set_file_security)
      (get_security_descriptor_owner, get_security_descriptor_group)
      (get_security_descriptor_dacl, is_valid_sid, equal_sid)
      (get_length_sid, copy_sid, get_native_system_info)
      (get_system_times, create_symbolic_link)
      (is_valid_security_descriptor, convert_sd_to_sddl)
      (convert_sddl_to_sd, get_adapters_info, reg_open_key_ex_w)
      (reg_query_value_ex_w, expand_environment_strings_w)
      (init_environment, create_toolhelp32_snapshot)
      (process32_first, process32_next, open_thread_token)
      (impersonate_self, revert_to_self, get_process_memory_info)
      (get_process_working_set_size, global_memory_status)
      (global_memory_status_ex, init_winsock)
      (maybe_load_unicows_dll, globals_of_w32): Use get_proc_addr.
      * src/w32fns.c (setup_w32_kbdhook, Ffile_system_info)
      (get_dll_version, w32_reset_stack_overflow_guard)
      (w32_backtrace, globals_of_w32fns): Use get_proc_addr.
      * src/w32font.c (get_outline_metrics_w, get_text_metrics_w)
      (get_glyph_outline_w, get_char_width_32_w): Use get_proc_addr.
      * src/w32heap.c (init_heap): Use get_proc_addr.
      * src/w32menu.c (globals_of_w32menu): Use get_proc_addr.
      * src/w32proc.c (init_timers, sys_kill, w32_compare_strings):
      Use get_proc_addr.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Use get_proc_addr.
    • Allen Li's avatar
      Don't include text properties when making autoloads · 58e5f10f
      Allen Li authored
      * lisp/emacs-lisp/autoload.el (autoload-generate-file-autoloads):
      Ignore text properties when finding autoload defs.  Otherwise,
      autoload generation is less deterministic, as the exact format of the
      generated autoloads depends on whether the files are visited in
      Emacs.  (Bug#32395)
    • Paul Eggert's avatar
      Fix problems with logxor etc. and fixnums · 64eb9b71
      Paul Eggert authored
      These operations incorrectly treated negative fixnums as
      bignums greater than most-positive-fixnum.
      * src/alloc.c (mpz_set_intmax_slow): Avoid undefined
      behavior if signed unary negation overflows, while
      we’re in the neighborhood.
      (mpz_set_uintmax_slow): Remove.  All uses removed.
      * src/data.c (arith_driver): Treat fixnums as signed, not
      unsigned, even for logical operations.
      * src/lisp.h (mpz_set_uintmax): Remove.  All uses removed.
      * test/src/data-tests.el (data-tests-logand)
      (data-tests-logior, data-tests-logxor): New tests.
    • Paul Eggert's avatar
      Reject outlandishly-wide bignums · 3b9017b5
      Paul Eggert authored
      Do not allow bignums that are so wide that their log base 2
      might not fit into a fixnum, as this will cause problems elsewhere.
      We already have a similar limitation for bool-vectors.
      * src/emacs.c (check_bignum_size, xmalloc_for_gmp): New function.
      (xrealloc_for_gmp): Check for too-large bignum.
      (main): Use xmalloc_for_gmp.
    • Paul Eggert's avatar
      Speed up logcount on bignums · bb7e0338
      Paul Eggert authored
      * src/data.c (Flogcount): Speed up by using the mpz equivalent
      of ~X instead of -X-1.
  5. 16 Aug, 2018 6 commits
    • Michael Albinus's avatar
      Fix Bug#32454 · 44ad4a15
      Michael Albinus authored
      * lisp/files.el (find-alternate-file): Handle the wildcards case.
    • Ken Brown's avatar
      Pacify GCC with -Wunused-but-set-variable · 5f39f203
      Ken Brown authored
      * src/unexcw.c (read_exe_header):
      (unexec): Specify the "unused" attribute for variables that
      are used only in assertions.
    • Thomas Fitzsimmons's avatar
      EUDC: Add more BBDB >= 3 support · decd9839
      Thomas Fitzsimmons authored
      * lisp/net/eudcb-bbdb.el Declare BBDB >= 3 functions.
      (eudc-bbdb-field): Add translation from company to
      (eudc-bbdb-extract-phones, eudc-bbdb-extract-addresses)
      (eudc-bbdb-format-record-as-result): Call BBDB >= 3 functions.
    • Thomas Fitzsimmons's avatar
      EUDC: Remove XEmacs support · af991f15
      Thomas Fitzsimmons authored
      * lisp/net/eudc.el (eudc-mode, eudc-install-menu): Remove
      XEmacs support.
      * lisp/net/eudc-hotlist.el (eudc-hotlist-mode)
      (eudc-hotlist-emacs-menu): Likewise.
      * lisp/net/eudc-bob.el (eudc-bob-toggle-inline-display)
      (eudc-bob-popup-menu, eudc-bob-generic-keymap)
      (eudc-bob-sound-keymap, eudc-bob-url-keymap)
      (eudc-bob-mail-keymap): Likewise.
      * etc/NEWS (EUDC): Mention removal of XEmacs support.
    • Thomas Fitzsimmons's avatar
      EUDC: Shorten eudc-tools-menu autoload · 36d17ef4
      Thomas Fitzsimmons authored
      * lisp/net/eudc.el: Remove XEmacs support from eudc-tools-menu
    • Thomas Fitzsimmons's avatar
      EUDC: Add commentary to eudc-bob.el · 6b178acf
      Thomas Fitzsimmons authored
      * lisp/net/eudc-bob.el: Add commentary.
  6. 15 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      Improve documentation of last change · bcdb2d97
      Eli Zaretskii authored
      * lisp/hi-lock.el (hi-lock-set-pattern, hi-lock-face-buffer):
      Improve the doc strings.  (Bug#32365)
      * etc/NEWS:
      * doc/emacs/display.texi (Highlight Interactively): Clarify
  7. 14 Aug, 2018 11 commits
    • Grégory Mounié's avatar
      Interactive Highlighting: prefix argument to select subexp · cc5a23d4
      Grégory Mounié authored
      * doc/emacs/display.texi (Highlight Interactively):
      * etc/NEWS: Document the change.
      * lisp/hi-lock.el (hi-lock-face-buffer, hi-lock-set-pattern): Use
      the prefix argument to highlight only the corresponding sub-expression
      of the regexp (Bug#32365).
      Copyright-paperwork-exempt: yes
    • Paul Eggert's avatar
      Rename --without-mini-gmp to --with-libgmp · 1164d49b
      Paul Eggert authored
      * configure.ac (HAVE_GMP): Rename ‘configure’ option from
      --without-mini-gmp to --with-libgmp.  All uses changed.
      * doc/lispref/numbers.texi (Predicates on Numbers): Large
      integers are always available.  Clarify how eq works on them.
    • Stephen Berman's avatar
      Fix last todo-edit-mode change · 6d24402d
      Stephen Berman authored
      * lisp/calendar/todo-mode.el (todo-edit-mode): For editing an item
      instead of the whole file, the current todo-file must be set from
      * test/lisp/calendar/todo-mode-tests.el (todo-test-current-file-in-edit-mode):
      New test.
    • Stephen Berman's avatar
    • Stephen Berman's avatar
      Fix exiting from editing todo archive file (bug#32437) · a2ec595e
      Stephen Berman authored
      * lisp/calendar/todo-mode.el (todo-edit-file): Make the warning
      also suitable for Todo Archive mode, and add more space to it.
      (todo-edit-quit): On quitting editing an archive file, return to
      the Todo Archive mode buffer editing was invoked in.
      (todo-check-format): Display a warning instead of a message when
      the categories sexp isn't as expected.
      (todo-mode-external-set): Remove.
      (todo-edit-mode): Set buffer local values of
      todo-current-todo-file and todo-categories from the todo or
      archive file being edited.
      (todo-categories-mode): Set buffer local values of
      todo-current-todo-file and todo-categories as before but directly
      instead of using superfluous todo-mode-external-set function.
      * test/lisp/calendar/todo-mode-tests.el (todo-test-edit-quit): New test.
    • Paul Eggert's avatar
      Remove more traces of misc (Bug#32405) · 11c7c2f7
      Paul Eggert authored
      Remove misc-objects-consed and the misc component of
      memory-use-count, since misc objects no longer exist.
      * doc/lispref/internals.texi, etc/NEWS: Mention this,
      and adjust better to recent removal of misc objects.
      * src/alloc.c (MEM_TYPE_MISC): Remove; no longer used.
      (Fmemory_use_counts): Omit misc count, since miscs
      no longer exist.
      (misc-objects-consed): Remove.
    • Glenn Morris's avatar
      ; Merge from origin/emacs-26 · db6f511e
      Glenn Morris authored
      The following commit was skipped:
      f882de8b (origin/emacs-26) Port better to x86 -fexcess-precision=fast
    • Glenn Morris's avatar
      Merge from origin/emacs-26 · 2eabf4c1
      Glenn Morris authored
      34e75c14 Add comment about floating point test
      e73e6838 Ibuffer: Add toggle ibuffer-do-toggle-lock
      12f71167 Ibuffer: Detect correctly the buffers running a process
    • Glenn Morris's avatar
      ; Merge from origin/emacs-26 · 2e08ca25
      Glenn Morris authored
      The following commit was skipped:
      18422976 Backport fix for Bug#32226
    • Glenn Morris's avatar
      Merge from origin/emacs-26 · d113142a
      Glenn Morris authored
      614cc65f ; * lisp/simple.el (line-move-visual): Fix typo.
      d2ad4ba4 Do not consider external packages to be removable (Bug#27822)
      ec0995c4 * src/alloc.c: Remove obsolete comments.
      ec6f5889 Better support utf-8-with-signature and utf-8-hfs in HTML
      eb026a8d Don't use -Wabi compiler option
    • Paul Eggert's avatar
      Port recent changes to older GCC · 396a33a3
      Paul Eggert authored
      Problem reported by Glenn Morris in:
      * src/lisp.h (make_pointer_integer_unsafe):
      Port to older GCC.