1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-18 10:16:51 +00:00
Commit Graph

2642 Commits

Author SHA1 Message Date
Michael Albinus
3abe7bfe30 Handle also port and domain in Tramp proxy definitions
* doc/misc/tramp.texi (Multi-hops): Exclude ports and domains from
pattern expansion.

* lisp/net/tramp-cmds.el (tramp-cleanup-all-connections):
Remove ad-hoc proxies.

* lisp/net/tramp-sh.el (tramp-compute-multi-hops): Handle also
port and domain in the proxy.  Propertize ad-hoc proxies.

* lisp/net/tramp.el (tramp-default-proxies-alist): Adapt docstring.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate): Extend tests.
2018-11-06 15:48:05 +01:00
Michael Heerdegen
049bd5d267 Don't quote self-quoting pcase patterns
* admin/bzrmerge.el:
* lisp/char-fold.el:
* lisp/dired.el:
* lisp/emacs-lisp/derived.el:
* lisp/emacs-lisp/easy-mmode.el:
* lisp/emacs-lisp/easymenu.el:
* lisp/emacs-lisp/eieio-core.el:
* lisp/emacs-lisp/package.el:
* lisp/emacs-lisp/smie.el:
* lisp/faces.el:
* lisp/filesets.el:
* lisp/progmodes/modula2.el:
* lisp/progmodes/octave.el:
* lisp/progmodes/opascal.el:
* lisp/progmodes/perl-mode.el:
* lisp/progmodes/prolog.el:
* lisp/progmodes/ruby-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/server.el:
* lisp/subr.el:
* lisp/textmodes/css-mode.el:
* test/lisp/emacs-lisp/pcase-tests.el: Don't quote self-quoting
'pcase' patterns.
2018-10-30 16:17:45 +01:00
Gemini Lasswell
0e484c66fd Keep a stack reference to bytecode objects being executed (Bug#33014)
* src/eval.c (Ffuncall): Make local variable 'fun' volatile.
* test/src/eval-tests.el
(eval-tests-byte-code-being-evaluated-is-protected-from-gc):
Add regression test for Bug#33014.
(eval-tests-33014-var): New variable.
(eval-tests-33014-func, eval-tests-33014-redefine): New functions.
2018-10-29 11:05:00 -07:00
Paul Eggert
a381285617 Improve rounding in recent timer fix
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Use more-precise arithmetic to handle some boundary cases better
when rounding errors occur (Bug#33071).
* test/lisp/emacs-lisp/timer-tests.el:
(timer-next-integral-multiple-of-time-3):
New test, to test one of the boundary cases.
(timer-next-integral-multiple-of-time-2):
Redo so as to not assume a particular way of rounding 0.01.
2018-10-22 19:34:49 -07:00
Michael Albinus
67d3b40e0c Expand host names in Tramp's ad-hoc multi-hop file names
* doc/misc/tramp.texi (Quick Start Guide): Improve wording.
(Change file name syntax): Say, that `tramp-file-name-regexp' is
not constant.
(Ad-hoc multi-hops): Explain host name expansion.

* etc/NEWS: Mention that host names in Tramp ad-hoc multi-hop file
names must match the previous hop for methods like "su" or "sudo".
Fix typos.

* lisp/net/tramp.el (tramp-find-method, tramp-find-user):
Adapt docstring.
(tramp-find-host): Mark default value.
(tramp-dissect-file-name): Expand host name for hops.
(tramp-dissect-hop-name, tramp-make-tramp-hop-name): New defuns.
(tramp-clear-passwd): Simplify.

* test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect)
(tramp-test02-file-name-dissect-simplified)
(tramp-test02-file-name-dissect-separate)
(tramp-test26-file-name-completion): Extend tests.
2018-10-20 13:38:31 +02:00
Eli Zaretskii
efb214622a Fix 'timer-next-integral-multiple-of-time'
* lisp/emacs-lisp/timer.el
(timer-next-integral-multiple-of-time): Fix recent change for
fractional values of SECS.  (Bug#33071)
* test/lisp/emacs-lisp/timer-tests.el
(timer-next-integral-multiple-of-time-2): New test.
2018-10-20 12:52:52 +03:00
Eli Zaretskii
7356743232 Avoid assertion violation when comparing with main-thread
* src/thread.c (unmark_main_thread): New function.
* src/lisp.h (unmark_main_thread): Prototype it.
* src/alloc.c (garbage_collect_1): Call it after sweeping.
(Bug#33073)

* test/src/thread-tests.el (threads-test-bug33073): New test.
2018-10-17 18:19:47 +03:00
Stefan Monnier
8c68e4afa8 * src/buffer.c (Fmove_overlay): Don't call Fdelete_overlay
... because the data structure is not in a consistent state.

* test/src/buffer-tests.el (overlay-evaporation-after-killed-buffer):
New test.
2018-10-14 16:44:21 -04:00
Eli Zaretskii
95f69e7db2 Improve 'json-insert' so it doesn't cons a string from JSON
* src/json.c (struct json_buffer_and_size): New member
inserted_bytes.
(json_insert): Instead of creating a string and inserting it
into the current buffer, copy the unibyte text into the gap.
(struct json_insert_data): New member inserted_bytes.
(json_insert_callback): Update commentary.  Pass the
inserted_bytes value to json_insert and on its return copy the
updated value back into DATA.
(Fjson_insert): Decode the unibyte text inserted into the gap.
Call before-change-functions and after-change-functions only
once, before and after processing the insertion of the entire
JSON representation.

* test/src/json-tests.el (json-insert/throw): Adapt to the
modified implementation of json-insert: it no longer calls the
modification hooks once for each inserted chunk of JSON
representation.
2018-10-13 10:13:10 +03:00
Michael Albinus
9c231a4470 * test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Add docstring.  Remove `interactive' call.
2018-10-12 13:42:34 +02:00
Allen Li
f5896e2cbf Rework empty abbrev table omitting
There were two problems with the original implementation:

1. It changed the behavior of insert-abbrev-table-description when
READABLE is nil to sometimes insert one Emacs Lisp expression and
sometimes insert nothing.
2. It broke the tests.

This commit reworks this so that insert-abbrev-table-description
always inserts an expressions even if no abbrevs need to be saved and
making only write-abbrev-file check that a table has any abbrevs to
save before calling insert-abbrev-table-description.  This duplicates
the work of filtering the table for savable abbrevs, but the benefit
of keeping the API is worth it.

* doc/lispref/abbrevs.texi (Abbrev Tables): Update documentation.
* lisp/abbrev.el (write-abbrev-file): Skip tables without user abbrevs
(insert-abbrev-table-description): Always insert the define
expression.
(abbrev--table-symbols): New function.
* test/lisp/abbrev-tests.el (abbrev--table-symbols-test):
Add test for abbrev--table-symbols.
2018-10-12 11:44:15 +03:00
Paul Eggert
5bd8cfc14d Fix mishandling of symbols that look like numbers
* src/bignum.c (make_neg_biguint): New function.
* src/lread.c (read1): Do not mishandle an unquoted symbol
with name equal to something like "1\0x", i.e., a string
of numeric form followed by a NUL byte.
Formerly these symbols were misread as numbers.
(string_to_number): Change last argument from an integer flag
to a pointer to the length.  This lets the caller figure out
how much of the prefix was used.  All callers changed.
Add a fast path if the integer (sans sign) fits in uintmax_t.
Update comments and simplify now that bignums are present.
* src/print.c (print_object): Fix quoting of symbols that look
like numbers, by relying on string_to_number for the tricky
cases rather than trying to redo its logic, incorrectly.  For
example, (read (prin1-to-string '\1e+NaN)) formerly returned
"1e+NaN", which was wrong: a backslash is needed in the output
to prevent it from being read as a NaN.  Escape NO_BREAK_SPACE
too, since lread.c treats it like SPACE.
* test/src/print-tests.el (print-read-roundtrip):
Add tests illustrating the abovementioned bugs.
2018-10-10 23:19:42 -07:00
Eli Zaretskii
cd7caee630 Unbreak 'revert-buffer' in Occur buffers
* lisp/replace.el (occur-revert-function): Use the value of
occur-revert-function from the correct buffer.  (Bug#32987)

* test/lisp/replace-tests.el (replace-occur-revert-bug32543)
(replace-occur-revert-bug32987): New tests.
2018-10-09 17:46:31 +03:00
Paul Eggert
3cc452327e Improvements on (TICKS . HZ)
This patch is in response to Eli's review (Bug#32902#10).
* src/systime.c: Doc strings of affected functions now refer
to format-time-string instead of to Lisp manual, and
format-time-string's doc string covers time values.
* test/src/systime-tests.el (format-time-string-with-zone):
Check decode-time too.
(decode-then-encode-time, time-arith-tests): New tests.
2018-10-06 23:31:04 -07:00
Paul Eggert
93fe420942 New (TICKS . HZ) timestamp format
This follows on a suggestion by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00991.html
(Bug#32902).
* doc/lispref/buffers.texi (Modification Time):
* doc/lispref/os.texi (Processor Run Time, Time Calculations)
* doc/lispref/processes.texi (System Processes):
* doc/lispref/text.texi (Undo):
Let the "Time of Day" section cover timestamp format details.
* doc/lispref/os.texi (Time of Day):
Say that timestamp internal format should not be assumed.
Document new (ticks . hz) format.  Omit mention of seconds-to-time
since it is now just an alias for encode-time.
(Time Conversion): Document encode-time extension.
* etc/NEWS: Mention changes.
* lisp/calendar/cal-dst.el (calendar-system-time-basis): Now const.
* lisp/calendar/cal-dst.el (calendar-absolute-from-time)
(calendar-time-from-absolute)
(calendar-next-time-zone-transition):
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Simplify by using bignums, (TICKS . HZ), and new encode-time.
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Simplify by using bignums and new encode-time.
* lisp/calendar/parse-time.el (parse-iso8601-time-string):
Handle DST more accurately, by using new encode-time.
* lisp/calendar/time-date.el (seconds-to-time):
* lisp/calendar/timeclock.el (timeclock-seconds-to-time):
Now just an alias for encode-time.
* lisp/calendar/time-date.el (days-to-time):
* lisp/emacs-lisp/timer.el (timer--time-setter):
* lisp/net/ntlm.el (ntlm-compute-timestamp):
* lisp/obsolete/vc-arch.el (vc-arch-add-tagline):
* lisp/org/org-id.el (org-id-uuid, org-id-time-to-b36):
* lisp/tar-mode (tar-octal-time):
Don't assume timestamps default to list form.
* lisp/tar-mode.el (tar-parse-octal-long-integer):
Now an obsolete alias for tar-parse-octal-integer.
* src/keyboard.c (decode_timer): Adjust to changes to
time decoding functions elsewhere.
* src/timefns.c: Include bignum.h, limits.h.
(FASTER_TIMEFNS): New macro.
(WARN_OBSOLETE_TIMESTAMPS, CURRENT_TIME_LIST)
(timespec_hz, trillion, ztrillion):
New constants.
(make_timeval): Use TIME_T_MAX instead of its definiens.
(check_time_validity, time_add, time_subtract):
Remove.  All uses removed.
(disassemble_lisp_time): Remove; old code now folded into
decode_lisp_time.  All callers changed.
(invalid_hz, s_ns_to_double, ticks_hz_list4, mpz_set_time)
(timespec_mpz, timespec_ticks, time_hz_ticks)
(lisp_time_hz_ticks, lisp_time_seconds)
(time_form_stamp, lisp_time_form_stamp, decode_ticks_hz)
(decode_lisp_time, mpz_time, list4_to_timespec):
New functions.
(decode_float_time, decode_time_components, lisp_to_timespec):
Adjust to new struct lisp_time, which does not lose
information like the old one did.
(enum timeform): New enum.
(decode_time_components): New arg FORM.  All callers changed.
RESULT and DRESULT are now mutually exclusive; no callers need
to change because of this.
(decode_time_components, lisp_time_struct)
(lisp_seconds_argument, time_arith, make_lisp_time, Ffloat_time)
(Fencode_time):
Add support for (TICKS . HZ) form.
(DECODE_SECS_ONLY): New constant.
(lisp_time_struct): 2nd arg is now enum timeform, not int.
All callers changed.
(check_tm_member): Support bignums.m
(Fencode_time): Add new two-arg functionality.
* src/systime.h (struct lisp_time): Now ticks+hz rather than
hi+lo+us+ps, since ticks+hz does not lose info.
* test/src/systime-tests.el (time-equal-p-nil-nil):
New test.
2018-10-06 23:31:04 -07:00
Paul Eggert
b5d08da1e9 Move timestamp-related stuff to timefns.c
This does not change behavior; it’s just long-overdue
refactoring (Bug#32902).
* src/emacs.c (main): Call init_timefns, syms_of_timefns.
* src/timefns.c: New file, containing timestamp-related stuff
from editfns.c and sysdep.c.
* src/Makefile.in (base_obj): Add timefns.o.
* src/editfns.c: Simplify by moving a big chunk to timefns.c.
Do not include systime.h, sys/resource.h, sys/param.h,
strftime.h, coding.h.
(HAVE_TZALLOC_BUG, TM_YEAR_BASE, HAVE_TM_GMTOFF, tzeqlen)
(local_tz, utc_tz, emacs_localtime_rz, emacs_mktime_z)
(invalid_time_zone_specification, xtzfree, tzlookup)
(TIME_T_MIN, TIME_T_MAX, time_overflow, invalid_time)
(check_time_validity, hi_time, lo_time, Fcurrent_time)
(time_add, time_subtract, time_arith, Ftime_add)
(Ftime_subtract, Ftime_less_p, Fget_internal_run_time)
(make_lisp_time, disassemble_lisp_time, decode_float_time)
(lisp_to_timespec, lisp_time_struct, lisp_time_argument)
(lisp_seconds_argument, Ffloat_time, emacs_nmemftime)
(Fformat_time_string, format_time_string, Fdecode_time)
(check_tm_member, Fencode_time, Fcurrent_time_string)
(tm_gmtoff, Fcurrent_time_zone, Fset_time_zone_rule)
(emacs_getenv_TZ, emacs_setenv_TZ): Move to timefns.c.
* src/emacs.c (main): Adjust to initialization changes.
* src/sysdep.c: Include <sys/resource.h> if it's present.
Regularize includes a bit.
(Fget_internal_run_time): Move here from editfns.c.
(init_timefns, syms_of_timefns): New functions.
* src/w32.h (w32_get_internal_run_time): Move decl here
so that it need not be cloned.
* test/src/editfns-tests.el:
* test/src/editfns-tests.el (format-time-string-with-zone)
(format-time-string-with-outlandish-zone)
(editfns-tests--have-leap-seconds)
(format-time-string-with-bignum-on-32-bit):
Move to ...
* test/src/timefns-tests.el: ... this new file.
2018-10-06 23:31:03 -07:00
Michael Albinus
ce0da8a427 Rework time-* functions in Tramp
* doc/misc/emacs-mime.texi (time-date): Add time-equal-p.

* lisp/net/tramp-compat.el (tramp-compat-time-equal-p): New defsubst.

* lisp/net/tramp.el (tramp-file-name-handler): Remove `debug'
error handler.
(tramp-half-a-year): Remove.
(tramp-time-dont-know, tramp-time-doesnt-exist): New defconst.
(tramp-time-diff): Remove compat code.
(tramp-handle-set-visited-file-modtime)
(tramp-handle-verify-visited-file-modtime):
* lisp/net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls)
(tramp-adb-handle-set-file-times):
* lisp/net/tramp-sh.el (tramp-do-file-attributes-with-ls)
(tramp-sh-handle-set-visited-file-modtime)
(tramp-sh-handle-verify-visited-file-modtime)
(tramp-sh-handle-set-file-times)
(tramp-sh-handle-file-newer-than-file-p):
Use `tramp-time-dont-know', `tramp-time-doesnt-exist' and
`tramp-compat-time-equal-p'.
(tramp-sh-handle-verify-visited-file-modtime): Simplify check.

* lisp/net/tramp-smb.el (tramp-smb-handle-file-attributes)
(tramp-smb-read-file-entry): Use `tramp-time-dont-know'.
(tramp-smb-handle-insert-directory): Adapt half-a-year check.

* src/editfns.c (Ftime_equal_p): Adapt docstring.

* test/lisp/net/tramp-tests.el
(tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times): Use `tramp-compat-time-equal-p' and
`tramp-time-dont-know'.
(tramp-test23-visited-file-modtime): Extend test.
2018-09-29 15:33:48 +02:00
Andrew Schwartzmeyer
48ff4c0b2f Support mode aliases in 'provided-mode-derived-p'
* lisp/subr.el (provided-mode-derived-p): Check aliases of
MODES as well as MODES themselves.  (Bug#32795)

* test/lisp/subr-tests.el (provided-mode-derived-p): New test.

Copyright-paperwork-exempt: yes
2018-09-29 09:56:46 +03:00
Paul Eggert
857c2c2710 Rename time-equal to time-equal-p
This is for consistency with time-less-p.
* doc/lispref/os.texi (Time Calculations), etc/NEWS:
* src/editfns.c (Ftime_equal_p, syms_of_editfns):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Rename.
2018-09-28 10:37:53 -07:00
Paul Eggert
06e2814e1f time-equal, and time values of infinity and NaN
* doc/lispref/os.texi (Time Calculations):
Document time-equal, and the behavior on NaNs and infinities of
time-less-p, time-add, time-subtract.
* etc/NEWS: Mention the change.
* src/editfns.c (time_arith): Change last arg from function
to bool.  All callers changed.  Do the right thing with
infinities and NaNs.
(time_cmp): New function, which handlesx infinities and NaNs.
(Ftime_less_p): Use it.
(Ftime_equal): New function.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
Use it.
2018-09-27 18:43:54 -07:00
Paul Eggert
d0c77a1894 Remove some assumptions about timestamp format
These changes remove some assumptions of Lisp code on timestamp
format.  Although we’re not going to change the default format any
time soon, I went looking for code that was too intimate about
details of timestamp format and removed assumptions where this was
easy to do with current Emacs primitives.
* lisp/ido.el (ido-wash-history):
Fix test for zero timestamp.
* lisp/time.el (display-time-event-handler):
Use time-less-p rather than doing it by hand.
(display-time-update): Simplify by using float-time
instead of doing the equivalent by hand.
* lisp/url/url-auth.el (url-digest-auth-make-cnonce):
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
* test/lisp/net/tramp-tests.el:
(tramp-test19-directory-files-and-attributes)
(tramp-test22-file-times, tramp-test23-visited-file-modtime):
Don’t assume detailed format of returned Lisp timestamps.
2018-09-24 19:15:23 -07:00
Paul Eggert
3624317969 Fix ‘make clean’ with a file named ‘-.o’
Problem reported by T.V Raman in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00866.html
* Makefile.in (clean, extraclean):
* doc/emacs/Makefile.in (mostlyclean):
* doc/lispintro/Makefile.in (mostlyclean):
* doc/lispref/Makefile.in (mostlyclean):
* doc/misc/Makefile.in (mostlyclean, clean):
* etc/refcards/Makefile (clean):
* lib-src/Makefile.in (mostlyclean, extraclean):
* lib/Makefile.in (clean):
* lwlib/Makefile.in (clean mostlyclean):
* oldXMenu/Makefile.in (clean mostlyclean):
* src/Makefile.in (mostlyclean, extraclean):
* test/Makefile.in (mostlyclean):
Say ‘rm ./*.o’ instead of ‘rm *.o’ to avoid undesirable failure
when a file name begins with ‘-’.
2018-09-24 10:45:07 -07:00
Paul Eggert
0b36041d2a Round bignums consistently with other integers
* src/bignum.c (mpz_bufsize): New function.
(bignum_bufsize): Use it.
(mpz_get_d_rounded): New function.
(bignum_to_double): Use it.
* src/bignum.c (bignum_to_double):
* src/data.c (bignum_arith_driver):
When converting bignums to double, round instead of
truncating, to be consistent with what happens with fixnums.
* test/src/floatfns-tests.el (bignum-to-float): Test rounding.
2018-09-22 09:01:26 -07:00
Paul Eggert
3727bc7d59 Fix (+ bignum float) bug
* src/data.c (bignum_arith_driver): Fix typo: missing ‘return’.
* test/src/data-tests.el (data-tests-bignum): Test for the typo.
2018-09-21 23:09:08 -07:00
Paul Eggert
0bec064454 Fix ambiguity in nil DST flag
Formerly nil meant both that DST was not in effect and that
the DST flag was unknown, and different functions interpreted
the flag differently.  Now the meaning is consistently nil for
DST not in effect, and -1 for DST flag not known.
* doc/lispref/os.texi (Time Conversion): The DST slot is
now three-valued, not two-.
* doc/misc/emacs-mime.texi (time-date): Adjust to new behavior.
* etc/NEWS: Mention this.
* lisp/calendar/parse-time.el (parse-time-string):
* src/editfns.c (Fdecode_time):
Return -1 for unknown DST flag.
* test/lisp/calendar/parse-time-tests.el (parse-time-tests):
Adjust tests to match new behavior, and add a new
test for nil vs -1.
2018-09-21 14:25:19 -07:00
Philipp Stephani
9f10e1a0ee Support bignums when serializing JSON
* src/json.c (lisp_to_json): Support bignums.
* test/src/json-tests.el (json-serialize/bignum): New test.
2018-09-21 21:50:56 +02:00
Paul Eggert
3937b5b52a Fix icalendar tests to match new behavior
* test/lisp/calendar/icalendar-tests.el (icalendar--create-uid):
Do not intrude into or rely upon undocumented internal
implementation details of icalendar--create-uid.
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2018-09/msg00660.html
2018-09-15 14:11:10 -07:00
Glenn Morris
9e79d59790 Merge from origin/emacs-26
e133b63 (origin/emacs-26) Avoid adverse side effects of fixing bug#21824
cc8f334 Document changes called out in NEWS
20ecc52 ; * etc/NEWS: Document recent change in 'thing-at-point'.
1fc5283 ; INSTALL: Fix a typo in the last commit.
24f240d Tiny doc updates re yum/dnf etc
41c2d25 Remove unused variable
1e3b3fa Fix (thing-at-point 'list) regression (Bug#31772)
219893a Clarify meaning of '*'
41cdda2 * etc/PROBLEMS: Document Ubuntu 16.04 issue.
1c22f03 Increase default value for imenu-auto-rescan-maxout
ee84389 Improve recent change to ELisp manual
ff374e4 * doc/lispref/display.texi (SVG Images): Improve wording.
3a0caf6 * doc/lispref/display.texi (SVG Images): Fix a typo.  (Bug#32...

Conflicts:
	doc/lispref/lists.texi
	etc/NEWS
2018-09-15 09:20:32 -07:00
Eli Zaretskii
e133b63062 Avoid adverse side effects of fixing bug#21824
* test/src/buffer-tests.el
(overlay-modification-hooks-deleted-overlay): New test.

* src/buffer.c (report_overlay_modification): Don't bypass all
the overlay-modification hooks; instead, invoke each function
only if the buffer associated with the overlay is the current
buffer.  (Bug#30823)
2018-09-15 12:21:12 +03:00
Leo Liu
1e3b3fa615 Fix (thing-at-point 'list) regression (Bug#31772)
* lisp/thingatpt.el (thing-at-point-bounds-of-list-at-point): Revert
  to pre 26.1 behavior.  Return whole sexp at point if no enclosing
  list.
  (list-at-point): New optional arg to ignore comments and strings.

* test/lisp/thingatpt-tests.el
  (thing-at-point-bounds-of-list-at-point): Fix and augment tests.
2018-09-14 22:38:58 +08:00
Michael Albinus
383c9a253b ; Instrument autorevert-tests.el 2018-09-14 10:03:27 +02:00
Paul Eggert
c44bc4d370 Fix (floor 54043195528445955 3.0) bug
* src/floatfns.c (rounding_driver): Fix rounding error
that can occur when both args have values exactly
representable as integers but at least one arg is a float.
* test/src/floatfns-tests.el (big-round): New test.
2018-09-13 14:29:58 -07:00
Paul Eggert
038a09041a Fix (round 1e+INF) core dump
* src/bignum.c (double_to_integer): Signal an error
if D cannot be converted, instead of dumping core.
* test/src/floatfns-tests.el (special-round): New test.
2018-09-11 11:34:44 -07:00
Gemini Lasswell
2f5a65a769 Add tests for list-threads and the *Threads* buffer
* test/lisp/thread-tests.el: New file.
2018-09-09 07:41:50 -07:00
Michael Albinus
79d7138c18 * test/lisp/autorevert-tests.el
(auto-revert-test02-auto-revert-deleted-file): Extend test.
2018-09-06 10:12:02 +02:00
Paul Eggert
67475a59e9 Fix timer.el minor rounding error
* lisp/emacs-lisp/timer.el (timer-next-integral-multiple-of-time):
Fix rounding error by using integers rather than floats.
* test/lisp/emacs-lisp/timer-tests.el (timer-test-multiple-of-time):
New test.
2018-09-05 16:21:42 -07:00
Paul Eggert
ccb3891ff5 Fix format-time-string bignum bug
The problem can occur on 32-bit platforms with current timestamps.
* src/editfns.c (disassemble_lisp_time, decode_time_components):
Support seconds counts that are bignums.
* test/src/editfns-tests.el (editfns-tests--have-leap-seconds):
New function.
(format-time-string-with-bignum-on-32-bit): New test.
2018-09-04 19:15:57 -07:00
Paul Eggert
21637d5e5b Fix (round FLOAT BIGNUM) bug
* src/floatfns.c (rounding_driver): Fix bug when one
argument is a float and the other is a bignum.
* test/src/floatfns-tests.el (bignum-round): Test for the bug.
2018-09-04 11:50:54 -07:00
Stephen Berman
40f8ade7c8 Make todo-show work when adding and deleting a new todo file
* lisp/calendar/todo-mode.el (todo-add-file): Since
todo-current-todo-file must be set before calling todo-show, but
the buffer is not yet in todo-mode, which makes it buffer local,
explicitly set it buffer locally (bug#32627).

* test/lisp/calendar/todo-mode-tests.el (todo-test--add-file)
(todo-test--delete-file): New functions.
(todo-test-add-and-delete-file): New test.
2018-09-03 22:40:24 +02:00
Michael Albinus
ee2509bd82 Mark thread-alive-p as obsolete
* etc/NEWS (thread-alive-p):
* lisp/emacs-lisp/thread.el (thread-alive-p): Mark it as obsolete.

* test/src/thread-tests.el (threads-join-error)
(threads-signal-main-thread): Use `thread-live-p'.
2018-08-31 11:45:37 +02:00
Michael Albinus
6f3cf12e4f Merge from origin/emacs-26
ac7936cb8f Rename thread-alive-p to thread-live-p
3d09d533d1 rcirc: Document /reconnect as a built-in command (Bug#29656)
a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test.
2018-08-31 11:15:48 +02:00
Michael Albinus
ac7936cb8f Rename thread-alive-p to thread-live-p
* doc/lispref/threads.texi (Basic Thread Functions): Use thread-live-p.

* etc/NEWS: 'thread-alive-p' has been renamed to 'thread-live-p'.

* src/thread.c (thread_live_p): Rename from thread_alive_p.  Adapt
all callees.
(Fthread_live_p): Rename from Fthread_alive_p.
(syms_of_threads): Make thread-alive-p an alias of thread-live-p.

* test/src/thread-tests.el (all): Replace `thread-alive-p' by
`thread-live-p'.
(threads-live): Rename from `threads-alive'.
2018-08-31 10:47:03 +02:00
Paul Eggert
db2fed3bdf Several fixes for formatting bignums
* src/bignum.c: Include stdlib.h, for abs.
(bignum_bufsize, bignum_to_c_string): New functions.
* src/bignum.c (bignum_to_string):
* src/print.c (print_vectorlike): Use them.
* src/editfns.c (styled_format): Instead of having a separate
buffer for sprintf (which does not work for bignums), just append
to the main buffer.  When formatting bignums, add support for the
standard integer flags -, #, 0, + and space.  Fix some comments.
Capitalize properly when formatting bignums with %X.  Use
functions like c_isdigit rather than reinventing the wheel.
Simplify computation of excess precision.
* src/print.c: Do not include bignum.h; no longer needed.
(print_vectorlike): Avoid recalculating string length.
* test/src/editfns-tests.el (format-bignum):
Test some of the above fixes.
2018-08-31 00:28:58 -07:00
Michael Albinus
54b92132e1 Handle thread-signal towards the main thread (Bug#32502)
* doc/lispref/threads.texi (Basic Thread Functions):
* etc/NEWS: Document thread-signal towards the main thread.

* lisp/emacs-lisp/thread.el: New package.

* src/keyboard.c (read_char): Check for Qthread_event.
(kbd_buffer_get_event, make_lispy_event): Handle THREAD_EVENT.
(syms_of_keyboard): Declare Qthread_event.
(keys_of_keyboard): Add thread-handle-event to special-event-map.

* src/termhooks.h (enum event_kind): Add THREAD_EVENT.

* src/thread.c: Include "keyboard.h".
(poll_suppress_count) Don't declare extern.
(Fthread_signal): Raise event if THREAD is the main thread.  (Bug#32502)

* test/src/thread-tests.el (thread): Require it.
(threads-signal-main-thread): New test.
2018-08-30 21:29:04 +02:00
Noam Postavsky
a1e615618d * test/lisp/calc/calc-tests.el (calc-imaginary-i): New test. 2018-08-29 22:47:00 -04:00
Michael Albinus
c252cd9d20 Improve tramp-convert-file-attributes backward compatibility
* lisp/net/tramp-sh.el (tramp-convert-file-attributes):
Use `seconds-to-time' for {access, modification, status change}
time.  Simplify check for inode.

* test/lisp/net/tramp-tests.el (tramp-test22-file-times):
Use `seconds-to-time'.
2018-08-29 10:05:34 +02:00
Glenn Morris
1afd313334 Merge from origin/emacs-26
54fb383 (origin/emacs-26) Fix detection of freed emacs_values (Bug#32...
769d0cd ; Fix out-of-tree build for mod-test.so
9a1329e Avoid crashes with very wide TTY frames on MS-Windows
9a613d3 Prevent `modify-file-local-variable-prop-line' from adding ex...
624e7dc Update GNOME bugtracker URLs
51ef6d5 Clarify in the Emacs manual that ChangeLog files are not used
6e08019 Recognize codepage 65001 as a valid encoding
1a350d7 ; * etc/NEWS: Fix format of first lines of some entries.
22d1f53 Avoid compilation warning in nt/addpm.c
7bc9ce7 Fix duplicate custom group names in bibtex.el
a9cf938 Fix outdated text in the Calc manual

Conflicts:
	etc/NEWS
	etc/PROBLEMS
	src/emacs-module.c
	src/gtkutil.c
	src/image.c
	src/xterm.c
	test/Makefile.in
2018-08-26 15:10:50 -07:00
Sergey Vinokurov
54fb383af6 Fix detection of freed emacs_values (Bug#32479)
* src/emacs-module.c (module_free_global_ref): Compare a value to be
freed with all entries of the list.

* test/data/emacs-module/mod-test.c (Fmod_test_globref_free): New
function.
(emacs_module_init): Make it accessible from Lisp.
* test/src/emacs-module-tests.el (mod-test-globref-free-test): New
test which uses it.
2018-08-25 18:57:56 -04:00
Noam Postavsky
769d0cdaa9 ; Fix out-of-tree build for mod-test.so
* test/Makefile.in: Don't look for emacs-module.h in $(srcdir), since
it is generated.
2018-08-25 18:57:28 -04:00
Noam Postavsky
161139a42c Detect Chinese sudo password prompts (Bug#31075)
* lisp/comint.el (comint-password-prompt-regexp): Allow text between
the prompt prefix and password equivalent.
* lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): Accept some
unicode alternatives to ":".
* test/lisp/comint-tests.el (comint-testsuite-password-strings): Add
test case.
2018-08-23 22:50:15 -04:00