* test/src/casefiddle-tests.el (casefiddle-tests-char-casing):
(upcase ?ß) now returns ?ẞ (U+7838), partly for technical reasons but
the previous behaviour was arbitrary and arguably less useful.
Correct upcasing of ß is normally SS, which is what Fupcase returns if
given a string, or (for special purposes) ẞ.
ß was incorrectly treated as a caseless character and thus not matched
by the regexp [[:lower:]] (or, in case-folding mode, [[:upper:]]).
The reason is that the upcase table maps it to itself, which can be
remedied by mapping it to ẞ (U+7838) instead. Doing so does not
affect upcasing since the special-uppercase property maps it to SS.
* lisp/international/characters.el (tbl): Map ß to ẞ in the upcase
table.
* test/src/regex-emacs-tests.el (regexp-eszett): Uncomment previously
failing tests. Add checks to make sure that case transformations
remain valid.
* src/regex-emacs.c (execute_charset): Add canon_table argument to
allow expression of a correct predicate for [:upper:] and [:lower:].
(mutually_exclusive_p, re_match_2_internal): Pass extra argument.
* test/src/regex-emacs-tests.el (regexp-case-fold, regexp-eszett):
New tests. Parts of regexp-eszett still fail and are commented out.
* lisp/net/rcirc.el (rcirc-server-parameters): New variable (bug#6795).
(rcirc-connect): Set it.
(rcirc-handler-433): Use the length from the server.
(rcirc-handler-005): Collect server data.
(rcirc-server-parameter-value): New utility function.
(rcirc--make-new-nick): New function.
The debugger needs to receive a list of the error symbol and data;
cf. the documentation of the `debugger' variable. This bug manifested
itself in ERT forms such as (should (integerp (ert-fail "Boo"))),
which resulted in an incorrect condition object. Note that forms such
as (should (ert-fail "Boo")) weren't affected because they wouldn't
use the `ert--should-signal-hook'.
* test/emacs-lisp/ert.el (ert--should-signal-hook): Call debugger with
the right arguments.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Add
unit test.
* src/eval.c (syms_of_eval): Define new variable
'backtrace-on-error-noninteractive' to selectively enable backtrace
printing in batch mode.
(signal_or_quit): Use it.
* etc/NEWS: Document new variable.
* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode/inhibit):
New unit test.
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-union-1-no-mem):
Generalize disjoint pos types vs neg values conditions.
(comp-cstr-union-1-no-mem): Do not propagate ranges when we are
already returning integer as generic type.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add corresponding tests.
* src/eval.c (signal_or_quit): Print a backtrace in batch mode if no
error handler was found.
* test/src/eval-tests.el (eval-tests/backtrace-in-batch-mode)
(eval-tests/backtrace-in-batch-mode/demoted-errors): New unit tests.
* etc/NEWS: Document change.
* lisp/emacs-lisp/comp-cstr.el (comp-range-negation): New
function.
(comp-cstr-union-homogeneous-no-range): Rename from
`comp-cstr-union-no-range'.
(comp-cstr-union-homogeneous): Rename from `comp-cstr-union'.
(comp-cstr-union-1): New function.
(comp-cstr-union-no-range, comp-cstr-union): Rewrite in function
of `comp-cstr-union-1'.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add a bunch of tests.
(perl-syntax-propertize-function): Don't put a syntax-property
on regexp-op delimiters if they're already handled correctly
by the normal syntax tables.
(perl-syntax-propertize-special-constructs): Mark the middle
quote of s'foo'bar' as punctuation.
* test/manual/indent/perl.perl: Add new test cases.
* lisp/htmlfontify.el:
* lisp/term/ns-win.el:
* lisp/term/w32-win.el:
* lisp/term/x-win.el:
* test/lisp/faces-tests.el: Don't require 'faces'; it is preloaded
since version 19.34.
* test/lisp/autorevert-tests.el (auto-revert--wait-for-revert):
Handle `auto-revert--messages' being nil.
(auto-revert-test07-auto-revert-several-buffers): New test.
* lisp/emacs-lisp/comp.el (comp-mvar-symbol-p): As all slots into
a `comp-cstr' are in or fix this logic.
(comp-mvar-cons-p): Likewise.
* test/src/comp-tests.el (bug-44968): New testcase.
* test/src/comp-test-funcs.el (comp-test-44968-f): New test
function.
* test/lisp/net/tramp-tests.el (tramp-test-vec): Check for remote
`tramp-test-temporary-file-directory'.
(tramp-test11-copy-file, tramp-test12-rename-file):
Do not skip for tramp-gvfs.el.
(tramp--test-sh-p): Use `tramp-test-vec'.
We used to store module runtime and environment pointers in the static
lists Vmodule_runtimes and Vmodule_environments. However, this is
incorrect because these objects have to be kept per-thread. With this
naive approach, interleaving module function calls in separate threads
leads to environments being removed in the wrong order, which in turn
can cause local module values to be incorrectly garbage-collected.
The fix isn't completely trivial: specbinding the lists wouldn't work
either, because then the garbage collector wouldn't find the
environments in other threads than the current ones, again leading to
objects being garbage-collected incorrectly. While introducing custom
pseudovector types would fix this, it's simpler to put the runtime and
environment pointers into the specbinding list as new specbinding
kinds. This works since we need to unwind them anyway, and we only
ever treat the lists as a stack. The thread switching machinery
ensures that the specbinding lists are thread-local, and that all
elements of the specbinding lists in all threads are marked during
garbage collection.
Module assertions now have to walk the specbinding list for the
current thread, which is more correct since they now only find
environments for the current thread. As a result, we can now remove
the faulty Vmodule_runtimes and Vmodule_environments variables
entirely.
Also add a unit test that exemplifies the problem. It interleaves two
module calls in two threads so that the first call ends while the
second one is still active. Without this change, this test triggers
an assertion failure.
* src/lisp.h (enum specbind_tag): Add new tags for module runtimes and
environments.
* src/eval.c (record_unwind_protect_module): New function to record a
module object in the specpdl list.
(do_one_unbind): Unwind module objects.
(backtrace_eval_unrewind, default_toplevel_binding, lexbound_p)
(Fbacktrace__locals): Deal with new specbinding types.
(mark_specpdl): Mark module environments as needed.
* src/alloc.c (garbage_collect): Remove call to 'mark-modules'.
Garbage collection of module values is now handled as part of marking
the specpdl of each thread.
* src/emacs-module.c (Fmodule_load, funcall_module): Use specpdl to
record module runtimes and environments.
(module_assert_runtime, module_assert_env, value_to_lisp): Walk
through specpdl list instead of list variables.
(mark_module_environment): Rename from 'mark_modules'. Don't attempt
to walk though current thread's environments only, since that would
miss other threads.
(initialize_environment, finalize_environment): Don't change
Vmodule_environments variable; environments are now in the specpdl
list.
(finalize_environment_unwind, finalize_runtime_unwind): Make 'extern'
since do_one_unbind now calls them.
(finalize_runtime_unwind): Don't change Vmodule_runtimes variable;
runtimes are now in the specpdl list.
(syms_of_module): Remove Vmodule_runtimes and Vmodule_environments.
* test/data/emacs-module/mod-test.c (Fmod_test_funcall): New test
function.
(emacs_module_init): Bind it.
* test/src/emacs-module-tests.el (emacs-module-tests--variable): New
helper type to guard access to state in a thread-safe way.
(emacs-module-tests--wait-for-variable)
(emacs-module-tests--change-variable): New helper functions.
(emacs-module-tests/interleaved-threads): New unit test.
When 'omake' is included in compilation-error-regexp-alist, which it
still is by default, then all other rules are modified to match with
an extra leading 6 spaces as well. The 'cucumber' pattern relied on
this in order to work as intended.
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
Extend the 'cucumber' pattern so that it works even when 'omake'
is not included. Move it below the 'gnu' rule so that it doesn't
match anything else.
As the constraint logic of the compiler is not trivial and largely
independent from the rest of the code move it into comp-cstr.el to
ease separation and maintainability.
This commit improve the conversion type
specifier -> constraint for generality.
Lastly this should help with bootstrap time as comp.el compilation
unit is slimmed down.
* lisp/emacs-lisp/comp-cstr.el: New file.
(comp--typeof-types, comp--all-builtin-types): Move from comp.el.
(comp-cstr, comp-cstr-f): Same + rename.
(comp-cstr-ctxt): New struct.
(comp-supertypes, comp-common-supertype-2)
(comp-common-supertype, comp-subtype-p, comp-union-typesets)
(comp-range-1+, comp-range-1-, comp-range-<, comp-range-union)
(comp-range-intersection): Move from comp.el.
(comp-cstr-union-no-range, comp-cstr-union): Move from comp.el and
rename.
(comp-cstr-union-make): New function.
(comp-type-spec-to-cstr, comp-cstr-to-type-spec): Move from
comp.el, rename it and rework it.
* lisp/emacs-lisp/comp.el (comp-known-func-cstr-h): Rework.
(comp-ctxt): Remove two fields and include `comp-cstr-ctxt'.
(comp-mvar, comp-fwprop-call): Update for `comp-cstr' being
renamed.
(comp-fwprop-insn): Use `comp-cstr-union-no-range' or
`comp-cstr-union'.
(comp-ret-type-spec): Use `comp-cstr-union' and rework.
* test/lisp/emacs-lisp/comp-cstr-tests.el: New file.
(comp-cstr-test-ts, comp-cstr-typespec-test): New functions.
(comp-cstr-typespec-tests-alist): New defconst to generate tests
on.
(comp-cstr-generate-tests): New macro.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Update.
(ret-type-spec): Initialize constraint context.
For certain patterns, re-matching the same regexp on the matched
substring does not produce correctly translated match data
(bug#15107 and bug#44861).
Using a new builtin function also improves performance since the
number of calls to string-match is halved.
Reported by Kevin Ryde and Shigeru Fukaya.
* lisp/subr.el (replace-regexp-in-string): Translate the match data
using match-data--translate instead of trusting a call to string-match
on the matched string to do the job.
* test/lisp/subr-tests.el (subr-replace-regexp-in-string):
Add test cases.
* src/search.c (Fmatch_data__translate): New internal function.
(syms_of_search): Register it as a subroutine.