1. 19 Aug, 2018 4 commits
    • 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.
      7ea369e5
    • 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.
      a1b79567
    • 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.
      b1840206
    • 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.
      6eade1ef
  2. 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.
      1d2df2fd
    • 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.
      97d27303
    • 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.
      673b1785
    • 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>.
      877cd22f
  3. 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.
      33002872
    • 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>.
      9189afc1
    • 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)
      (set_named_security_info)
      (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.
      cc5325b0
    • 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)
      58e5f10f
    • 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.
      64eb9b71
    • 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.
      3b9017b5
    • 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.
      bb7e0338
  4. 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.
      (Bug#32454)
      44ad4a15
    • Ken Brown's avatar
      Pacify GCC with -Wunused-but-set-variable · 5f39f203
      Ken Brown authored
      * src/unexcw.c (read_exe_header):
      (fixup_executable):
      (unexec): Specify the "unused" attribute for variables that
      are used only in assertions.
      5f39f203
    • 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
      organization.
      (eudc-bbdb-extract-phones, eudc-bbdb-extract-addresses)
      (eudc-bbdb-format-record-as-result): Call BBDB >= 3 functions.
      decd9839
    • 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.
      af991f15
    • 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
      autoload.
      36d17ef4
    • Thomas Fitzsimmons's avatar
      EUDC: Add commentary to eudc-bob.el · 6b178acf
      Thomas Fitzsimmons authored
      * lisp/net/eudc-bob.el: Add commentary.
      6b178acf
  5. 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
      wording.
      bcdb2d97
  6. 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
      cc5a23d4
    • 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.
      1164d49b
    • 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
      todo-global-current-todo-file.
      
      * test/lisp/calendar/todo-mode-tests.el (todo-test-current-file-in-edit-mode):
      New test.
      6d24402d
    • 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.
      a2ec595e
    • 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.
      11c7c2f7
    • 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
      db6f511e
    • 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
      2eabf4c1
    • Glenn Morris's avatar
      ; Merge from origin/emacs-26 · 2e08ca25
      Glenn Morris authored
      The following commit was skipped:
      
      18422976 Backport fix for Bug#32226
      2e08ca25
    • 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
      d113142a
    • Paul Eggert's avatar
      Port recent changes to older GCC · 396a33a3
      Paul Eggert authored
      Problem reported by Glenn Morris in:
      https://lists.gnu.org/r/emacs-devel/2018-08/msg00446.html
      * src/lisp.h (make_pointer_integer_unsafe):
      Port to older GCC.
      396a33a3
  7. 13 Aug, 2018 7 commits
    • Paul Eggert's avatar
      Update doc strings for fixnum constants · dc18a091
      Paul Eggert authored
      * src/data.c (most-positive-fixnum, most-negative-fixnum):
      Update doc strings in the light of fixnums.
      dc18a091
    • Paul Eggert's avatar
      Fix check for unsafe watch descriptor · 76101698
      Paul Eggert authored
      * src/lisp.h (make_pointer_integer_unsafe): New function.
      (make_pointer_integer): Use it.
      * src/gfilenotify.c (dir_monitor_callback): Omit redundant eassert.
      (Fgfile_add_watch): Signal an error instead of failing an
      assertion if the pointer does not work.
      76101698
    • Paul Eggert's avatar
      Port better to x86 -fexcess-precision=fast · f882de8b
      Paul Eggert authored
      Problem reported by Eli Zaretskii in:
      https://lists.gnu.org/r/emacs-devel/2018-08/msg00380.html
      * src/data.c (arithcompare): Work around incompatibility
      between gcc -fexcess-precision=fast and the C standard on x86,
      by capturing the results of floating-point comparisons before
      the excess precision spontaneously decays.  Although this fix
      might not work in general, it does work here and is probably
      good enough for the platforms we care about.
      
      (cherry picked from commit a84cef90)
      f882de8b
    • Paul Eggert's avatar
      Add comment about floating point test · 34e75c14
      Paul Eggert authored
      * test/src/data-tests.el (data-tests--float-greater-than-fixnums):
      New constant.
      (data-tests-=, data-tests-<, data-tests->, data-tests-<=)
      (data-tests->=, data-tests-min): Use it.
      34e75c14
    • Raimon Grau's avatar
      Add uuid as allowed thingatpt symbol (Bug#32372) · eb787d74
      Raimon Grau authored
      * etc/NEWS: Mention changes in thingatpt.el.
      * lisp/thingatpt.el (thing-at-point-uuid-regexp): Add regexp for uuid.
      (top-level): Add 'bounds-of-thing-at-point' operation for 'uuid'.
      * test/lisp/thingatpt-tests.el: Add tests for uuid at point.
      eb787d74
    • Tino Calancha's avatar
      Ibuffer: Add toggle ibuffer-do-toggle-lock · e73e6838
      Tino Calancha authored
      Toggle the locked status in marked buffers or the buffer
      at point (Bug#32421).
      * lisp/ibuffer.el (ibuffer-do-toggle-lock): New command.
      (ibuffer-mode-map): Bind it to 'L'.
      (ibuffer-mode-operate-map): Add entries for
      `ibuffer-do-toggle-read-only' and `ibuffer-do-toggle-lock'.
      * etc/NEWS (Changes in Specialized Modes and Packages in Emacs 26.2):
      Announce the change.
      e73e6838
    • Tino Calancha's avatar
      Ibuffer: Detect correctly the buffers running a process · 12f71167
      Tino Calancha authored
      * lisp/ibuffer.el (filename-and-process): Store the process buffer
      as a text property; check for such property to detect a buffer
      with a process (Bug#32420).
      12f71167