Tom Tromey
45eb3b3513
Use fixnump rather than integerp in some spots
...
* src/buffer.c (syms_of_buffer): Use Qfixnump, not Qintegerp.
* src/data.c (syms_of_data): Define fixnump symbol.
* src/lisp.h (lisp_h_CHECK_FIXNUM): Use Qfixnump.
(struct Lisp_Buffer_Objfwd): Update comment.
2018-07-12 22:12:28 -06:00
Tom Tromey
27980e3604
Make ash and lsh handle bignums
...
* src/data.c (ash_lsh_impl): Handle bignums.
* test/src/data-tests.el (data-tests-ash-lsh): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
cca0e79ea8
Make logb handle bignums
...
* src/floatfns.c (Flogb): Handle bignums.
* test/src/floatfns-tests.el (bignum-logb): New test.
2018-07-12 22:12:28 -06:00
Tom Tromey
3dea8f8f53
Make % and mod handle bignums
...
* src/data.c (Frem, Fmod): Handle bignums.
* src/lisp.h (CHECK_INTEGER_COERCE_MARKER): New macro.
* test/src/data-tests.el (data-tests-check-sign)
(data-tests-%-mod): New tests.
2018-07-12 22:12:28 -06:00
Tom Tromey
d0fac17abd
Let C modules access bignum values
...
* src/emacs-module.c (module_extract_integer, module_make_integer):
Handle bignums.
2018-07-12 22:12:28 -06:00
Tom Tromey
8fb995b9e3
Make min and max handle bignums
...
* src/data.c (minmax_driver): Handle bignums.
* test/src/data-tests.el (data-tests-minmax): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
a770fb4428
Make logcount handle bignums
...
* src/data.c (Flogcount): Handle bignums.
* test/src/data-tests.el (data-tests-logcount): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
c7e393bc41
Make lognot handle bignums
...
* src/data.c (Flognot): Handle bignums.
2018-07-12 22:12:27 -06:00
Tom Tromey
0d868917ef
Make 1+ and 1- handle bignums
...
* src/data.c (Fadd1, Fsub1): Handle bignums.
* test/src/data-tests.el (data-tests-1+, data-tests-1-): New tests.
2018-07-12 22:12:27 -06:00
Tom Tromey
025adce2cf
Make abs handle bignums
...
* src/floatfns.c (Fabs): Handle bignums.
* test/src/floatfns-tests.el (bignum-abs): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
872faabbd8
Allow conversion of bignums to floats
...
* src/floatfns.c (extract_float, Ffloat): Handle bignums.
* src/lisp.h (XFLOATINT): Handle bignums.
* test/src/floatfns-tests.el (bignum-to-float): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
d14808cd27
Make format handle bignums
...
* src/editfns.c (styled_format): Handle bignums.
* test/src/editfns-tests.el (read-large-integer): Update.
(format-bignum): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
23eab9a6a6
Make number-to-string work for bignums
...
* src/data.c (Fnumber_to_string): Handle bignum.
* test/src/data-tests.el (data-tests-number-to-string): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
6d4bf2ceda
Add some bignum tests
...
* test/src/data-tests.el (data-tests-bignum, data-tests-+)
(data-tests-/, data-tests-number-predicates): New tests.
* test/src/fns-tests (test-bignum-eql): New test.
* test/src/lread-tests (lread-long-hex-integer): Expect bignum.
* test/src/print-tests (print-bignum): New test.
2018-07-12 22:12:27 -06:00
Tom Tromey
5875fbaa2d
Make arithmetic work with bignums
...
* src/data.c (free_mpz_value): New function.
(arith_driver): Rewrite.
(float_arith_driver): Handle bignums.
2018-07-12 22:12:27 -06:00
Tom Tromey
eefa65e903
Make comparison operators handle bignums
...
* sc/data.c (bignumcompare): New function.
(arithcompare): Handle bignums.
2018-07-12 22:12:27 -06:00
Tom Tromey
1e8ae6ca23
Make the reader accept bignums
...
* src/data.c (Fstring_to_number): Update.
* src/lisp.h (S2N_OVERFLOW_TO_FLOAT): Remove.
* src/lread.c (free_contents): New function.
(read_integer): Handle bignums.
(read1): Update.
(string_to_number): Handle bignums.
(syms_of_lread): Remove read-integer-overflow-as-float.
* src/process.c (Fsignal_process): Update.
2018-07-12 22:12:27 -06:00
Tom Tromey
580d173b9a
Make eql work for bignums
...
* src/fns.c (Feql, internal_equal): Handle bignums.
2018-07-12 22:12:27 -06:00
Tom Tromey
b2f3f4ee29
Provide new functions to create bignums
...
* src/alloc.c (make_bignum_str, make_number): New functions.
* src/lisp.h (make_bignum_str, make_number): Declare.
2018-07-12 22:12:27 -06:00
Tom Tromey
a0f2adbfc9
Introduce the bignum type
...
* src/alloc.c (mark_object): Handle Lisp_Misc_Bignum.
(sweep_misc): Call mpz_clear for Lisp_Misc_Bignum.
* src/data.c (Ftype_of): Handle Lisp_Misc_Bignum.
(Fintegerp, Finteger_or_marker_p, Fnatnump, Fnumberp)
(Fnumber_or_marker_p): Update for bignum.
(Ffixnump, Fbignump): New defuns.
(syms_of_data): Update.
* src/emacs.c (xrealloc_for_gmp, xfree_for_gmp): New functions.
(main): Call mp_set_memory_functions.
* src/lisp.h (enum Lisp_Misc_Type) <Lisp_Misc_Bignum>: New constant.
(struct Lisp_Bignum): New.
(union Lisp_Misc): Add u_bignum.
(BIGNUMP, XBIGNUM, INTEGERP, NATNUMP, NUMBERP, CHECK_NUMBER)
(CHECK_INTEGER, CHECK_NUMBER_COERCE_MARKER): New functions.
* src/print.c (print_object): Handle Lisp_Misc_Bignum.
2018-07-12 22:12:27 -06:00
Tom Tromey
7cb45cd25e
Add configury for GMP library
...
* configure.ac (GMP_LIB, GMP_OBJ): New substs.
* src/Makefile.in (GMP_OBJ, GMP_OBJ): New variables.
(base_obj): Add GMP_OBJ.
(LIBES): Add GMP_LIB.
* src/mini-gmp.h: New file.
* src/mini-gmp.c: New file.
2018-07-12 22:12:27 -06:00
Tom Tromey
42fe787b0f
Rename integerp->fixnum, etc, in preparation for bignums
...
* src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
src/process.c, src/profiler.c, src/search.c, src/sound.c,
src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
2018-07-12 22:12:27 -06:00
Noam Postavsky
01dbf2a347
Speed up smerge-refine-regions by avoiding fsync
...
* lisp/vc/smerge-mode.el (smerge-refine-regions): Bind
write-region-inhibit-fsync to t. This was reported in
https://github.com/magit/magit/pull/2834 to give a noticable speedup.
2018-07-12 21:45:31 -04:00
Noam Postavsky
1222ff5275
Don't skip epg-tests even with gpg 2.0 (Bug#23561)
...
* test/lisp/epg-tests.el (epg-tests--config-program-alist): New
constant, which allows gpg2 version 2.0+.
(epg-tests-find-usable-gpg-configuration): Pass it to
epg-find-configuration.
2018-07-12 21:45:30 -04:00
Stefan Monnier
aeefbc41be
Fix the bootstrap differently, so zerop can be where it belongs
...
Suggested by Robert Pluim <rpluim@gmail.com>.
* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Avoid cadr/cddr.
* lisp/subr.el (zerop): Un-revert 2018-07-10T23:08:58-07:00!contovob@tcd.ie.
2018-07-12 10:29:28 -04:00
Basil L. Contovounesios
84e5986902
; Add commentary on location of zerop
...
* lisp/subr.el (zerop): Add commentary explaining why moving the
function's location within the file broke bootstrap in
2018-07-10T23:08:58-07:00!contovob@tcd.ie.
2018-07-11 10:31:49 -07:00
Glenn Morris
78125f3744
Unbreak bootstrap
...
* lisp/subr.el (zerop): Revert previous change, which caused
bootstrap to fail with void function cadr.
2018-07-11 08:27:14 -07:00
Basil L. Contovounesios
babe0d4508
; Rearrange definition of zerop in subr.el
...
* lisp/subr.el (zerop): Move from under 'List functions' heading to
under 'Basic Lisp functions' heading.
2018-07-10 23:08:58 -07:00
Stefan Monnier
f8b1e40fb6
* lisp/vc/diff-mode.el: Perform hunk refinement from font-lock
...
Remove redundant :group arguments.
(diff-font-lock-refine): New var.
(diff--refine-hunk): New function, extracted from diff-refine-hunk.
(diff-refine-hunk): Use it.
(diff--font-lock-refine--refresh): New function.
(diff--font-lock-refined): New function.
(diff-font-lock-keywords): Use it.
2018-07-10 22:52:21 -04:00
Filipp Gunbin
1d7151e98e
Fix Bug#32107
...
* lisp/progmodes/sql.el (sql-buffer-live-p): Fix handling of optional
connection argument. (Bug#32107)
2018-07-11 05:30:10 +03:00
Jonathan Kyle Mitchell
39489f782e
Fix infinite recursion in eshell/clear (Bug#31326)
...
* lisp/eshell/esh-mode.el (eshell/clear): Bind
eshell-input-filter-functions to nil to prevent entries like
eshell-smart-display-setup from causing infinite recursion.
2018-07-10 21:22:52 -04:00
Noam Postavsky
c249e17324
* lisp/indent.el (indent-line-to): Fix dedenting of tabs.
2018-07-10 12:07:01 -04:00
Paul Eggert
cc74539a19
* lisp/format.el (format-annotate-single-property-change): Simplify.
2018-07-09 19:00:43 -07:00
Basil L. Contovounesios
2fde6275b6
Add predicate proper-list-p
...
For discussion, see emacs-devel thread starting at
https://lists.gnu.org/archive/html/emacs-devel/2018-04/msg00460.html .
* lisp/subr.el (proper-list-p): New function.
Implementation suggested by Paul Eggert <eggert@cs.ucla.edu> in
https://lists.gnu.org/archive/html/emacs-devel/2018-06/msg00138.html .
* doc/lispref/lists.texi (List Elements):
* etc/NEWS: Document proper-list-p.
* lisp/org/ob-core.el (org-babel-insert-result):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-if):
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Use proper-list-p.
* lisp/emacs-lisp/ert.el (ert--proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(ert--explain-equal-rec): Use proper-list-length.
* lisp/format.el (format-proper-list-p): Remove.
Replaced by proper-list-p in lisp/subr.el.
(format-annotate-single-property-change): Use proper-list-p.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-proper-list-p):
Move from here...
* test/lisp/subr-tests.el (subr-tests--proper-list-length):
...to here, mutatis mutandis.
2018-07-09 19:00:43 -07:00
Noam Postavsky
e4ad2d1a8f
Respect field boundaries in indent-line-to (Bug#32014)
...
* lisp/indent.el (indent-line-to): Use the back-to-indentation point
as the end-point of whitespace removal, rather than
backward-to-indentation which doesn't respect field boundaries.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Don't expect to fail.
2018-07-09 20:08:13 -04:00
Noam Postavsky
737481cc62
; Merge from emacs-26
...
The following commit was skipped:
8f7d35cabd
Stop using indent-line-to in lisp-indent-line (Bug#32014)
2018-07-09 20:06:29 -04:00
Noam Postavsky
6b8349a902
Merge from emacs-26
...
db3f779780
; Test for Bug#32014
90d95b000c
Explicitly reject :server and :nowait (Bug#31903)
917158f8c9
Fix Bug#32090
# Conflicts:
# src/process.c
2018-07-09 20:06:27 -04:00
Noam Postavsky
6de90fb41b
; Merge from emacs-26
...
The following commit was skipped:
848f0f73e9
Fix floating point exceptions on Alpha (Bug#32086)
2018-07-09 20:03:30 -04:00
Noam Postavsky
7bcb697e19
Merge from emacs-26
...
65889a6d12
Fix bootstrap infloop in GNU/Linux alpha
48efd1c98b
Minor fix of a recent documentation change
3302b7cd7f
Mention the NSM in the gnutls variable doc strings
40c2ce743b
Remove test code from last commit
e02d8e29c6
Fix Bug#32084
da5d6dbe39
Fix (length NON-SEQUENCE) documentation
2018-07-09 20:03:30 -04:00
Noam Postavsky
8f7d35cabd
Stop using indent-line-to in lisp-indent-line (Bug#32014)
...
This is partial revert of "Remove ignored argument from
lisp-indent-line", because `indent-line-to' doesn't respect field
boundaries.
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-line): Use delete-region
and indent-to instead of `indent-line-to'.
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): Expect to pass.
Don't merge to master, we will fix indent-line-to there instead.
2018-07-09 19:39:03 -04:00
Noam Postavsky
db3f779780
; Test for Bug#32014
...
* test/lisp/emacs-lisp/lisp-mode-tests.el
(lisp-indent-with-read-only-field): New test.
2018-07-09 19:39:03 -04:00
Noam Postavsky
90d95b000c
Explicitly reject :server and :nowait (Bug#31903)
...
* src/process.c (Fmake_network_process): Explicitly check for and
signal an error when passed both :server and :nowait non-nil. In
Emacs 25, :nowait would be ignored in this case, but as of Emacs 26.1
this gives an error, albeit an unclear one. Also remove obsolete
comment regarding configurations lacking non-blocking mode, the
corresponding code was removed in 2012-11-17 "Assume POSIX 1003.1-1988
or later for fcntl.h."
2018-07-09 19:39:03 -04:00
Michael Albinus
917158f8c9
Fix Bug#32090
...
* lisp/files-x.el (connection-local-normalize-criteria): Do not
use PROPERTIES anymore.
(connection-local-get-profiles): Rewrite, in order to accept any
property as optional. (Bug#32090)
(connection-local-set-profiles):
Adapt ´connection-local-normalize-criteria' call.
* test/lisp/files-x-tests.el
(files-x-test-connection-local-set-profiles)
(files-x-test-hack-connection-local-variables-apply): Extend tests.
2018-07-09 16:03:49 +02:00
Sam Steingold
3307353e13
dired-do-find-regexp: Use rgrep-find-ignored-directories.
2018-07-09 09:29:23 -04:00
Paul Eggert
848f0f73e9
Fix floating point exceptions on Alpha (Bug#32086)
...
Backport from master.
* admin/merge-gnulib (GNULIB_MODULES): Add fpieee.
* m4/fpieee.m4: New file, copied from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
2018-07-08 10:52:12 -07:00
Paul Eggert
9d09ced1d5
Fix etc/HELLO searching in grep.el
...
* lisp/progmodes/grep.el (grep-compute-defaults):
Search for "^Copyright", not "^English", as the latter is no
longer present in etc/HELLO and the former is more likely to
survive future changes to etc/HELLO (Bug#32093).
2018-07-08 10:01:33 -07:00
Paul Eggert
0c3e283c76
Fix floating point exceptions on Alpha (Bug#32086)
...
* admin/merge-gnulib (GNULIB_MODULES): Add fpieee.
* m4/fpieee.m4: New file, copied from Gnulib.
* m4/gnulib-comp.m4: Regenerate.
2018-07-08 09:26:22 -07:00
Paul Eggert
65889a6d12
Fix bootstrap infloop in GNU/Linux alpha
...
* src/emacs.c (main): Do not re-exec if EMACS_HEAP_EXEC
is already set (Bug#32083).
2018-07-08 09:04:51 -07:00
Eli Zaretskii
48efd1c98b
Minor fix of a recent documentation change
...
* lisp/net/gnutls.el (gnutls-algorithm-priority): Clarify the doc
string.
2018-07-08 18:22:51 +03:00
Eli Zaretskii
9c985a3d7a
Minor improvements in recent NSM documentation changes
...
* doc/emacs/misc.texi (Network Security): Improve wording and
markup of last change.
* src/gnutls.c (Fgnutls_peer_status): Doc fix.
* etc/NEWS: Improve wording of last change.
2018-07-08 17:46:32 +03:00