* lisp/calendar/solar.el (solar-moment): Use initial values for binary
search that won't end the loop prematurely and yield incorrect
answers.
* test/lisp/calendar/solar-tests.el: New file.
Since ntlm.el is distributed as a separate package in GNU ELPA and
should be able to run on older Emacs versions without bignums,
we cannot make use of them here. See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg01665.html.
Instead, we add a small poor man's bignum implementation.
* lisp/net/ntlm.el (ntlm--bignat-of-int, ntlm--bignat-add)
(ntlm--bignat-shift-left, ntlm--bignat-mul-byte, ntlm--bignat-mul)
(ntlm--bignat-of-string, ntlm--bignat-of-digits)
(ntlm--bignat-to-int64): New.
(ntlm--time-to-timestamp): Use the ntlm--bignat- functions instead
of Lisp integers.
* test/lisp/net/ntlm-tests.el: New file.
* doc/lispref/modes.texi (Defining Minor Modes): Describe the new
:predicate keyword (bug#44232).
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Allow a new :predicate keyword.
(easy-mmode--globalized-predicate-p): New function.
* lisp/emacs-lisp/comp.el (comp-emit-set-call-subr): Rework based
on the fact that the subr can now be redefined.
* test/src/comp-tests.el (primitive-redefine-compile-44221):
New testcase.
XRef supports Emacs versions back to Emacs 26.3, so it can’t use newer
functions such as ‘ert-resource-directory’.
* test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don’t use
‘ert-resource-directory’
Flymake supports all Emacs versions back to 26.1, so it can’t use
‘ert-resource-file’.
* test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory):
Recreate.
(flymake-tests--call-with-fixture): Stop using ‘ert-resource-file’.
* test/lisp/faces-tests.el (ert-x): Require.
(faces--test-data-dir): Remove variable.
(faces--test-extend-with-themes): Use ert-resource-directory.
* test/lisp/faces-resources/*: Moved from test/data/themes/*.
* test/lisp/epg-tests.el (ert-x): Require.
(epg-tests-data-directory): Remove variable.
(with-epg-tests): Use ert-resource-file.
* test/lisp/epg-resources/*: Moved from test/data/epg/.
* test/lisp/gnus/mml-sec-tests.el (ert-x): Require.
(mml-secure-test-fixture, mml-sec-test--kill-gpg-agent):
Use ert-resource-directory.
* test/lisp/gnus/mml-sec-resources/*: Moved from test/data/mml-sec/.
* .gitignore: Update location of moved file "random_seed".
* test/lisp/calendar/icalendar-tests.el (ert-x): Required for
'ert-resource-file'.
(icalendar-tests--data-dir): Removed.
(icalendar-tests--get-file-contents): Use 'ert-resource-file' for
finding test data files.
* test/data/icalendar/*: Moved to test/lisp/calendar/icalendar-resources/.
* test/lisp/calendar/icalendar-resources/*: Moved from test/data/icalendar.
* test/lisp/emacs-lisp/bindat-tests.el
(bindat-test-pack/multibyte-string-fails)
(bindat-test-unpack/multibyte-string-fails): Don't use
decode-coding-string.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
* test/lisp/calendar/icalendar-tests.el
(icalendar-tests--data-dir, icalendar-tests--get-file-contents):
New.
(icalendar-tests--test-import, icalendar-tests--do-test-import):
Read input and expected results from files.
(icalendar-import-non-recurring, icalendar-import-rrule)
(icalendar-import-duration, icalendar-import-bug-6766)
(icalendar-import-bug-24199, icalendar-import-bug-33277)
(icalendar-import-multiple-vcalendars, icalendar-import-with-uid)
(icalendar-import-with-timezone, icalendar-real-world): Move test
data (input and expected result) to separate files.
* test/calendar/icalendar/*
New files containing test data for icalendar tests.
* lisp/calendar/time-date.el: Use lexical-binding.
* test/lisp/calendar/time-date-tests.el
(test-obsolete-with-decoded-time-value)
(test-obsolete-encode-time-value, test-format-seconds)
(test-days-to-time, test-seconds-to-string): New tests.
(test-days-in-month, test-time-since, test-time-decoded-period):
Expand test with a few more values.
* etc/NEWS (Widget): Announce the feature (bug#6419).
* lisp/wid-edit.el (widget-editable-list-delete-at): Save into a new
widget property, :last-deleted, the WIDGET to be deleted. Add
docstring.
(widget-editable-list-insert-before): If there is a recently deleted
child for the editable list, insert that one, instead of a new default
widget. Add docstring.
(insert-button widget): Make :help-echo a function to avoid the
help-echo string become too long.
(delete-button widget): Tweak the :help-echo string, to document this
behavior.
* test/lisp/wid-edit-tests.el (widget-test-moving-editable-list-item):
Test the feature.
* test/lisp/autorevert-tests.el (auto-revert--timeout): Make into
defun and shorten timeout by a factor 10.
(auto-revert--wait-for-revert): Cut timeouts in half.
(with-auto-revert-test): New macro to set timeout to 0.1.
(auto-revert-tests--write-file): New defun.
(auto-revert-test00-auto-revert-mode)
(auto-revert-test01-auto-revert-several-files)
(auto-revert-test02-auto-revert-deleted-file)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired)
(auto-revert-test05-global-notify)
(auto-revert-test06-write-file): Adapt test to run faster. Remove
:expensive-test marks.
This was discussed in:
https://lists.gnu.org/r/emacs-devel/2020-10/msg01233.html
When matching messages in compilation-mode, keep track of the rule
employed for each match. This facilitates debugging and allows us to
verify that each test case really exercises the rule that we expect it
to.
Naturally this uncovered several test cases that didn't check what the
author thought they did; the rules affixed to
compile-tests--test-regexps-data are those actually used, so that the
tests still pass.
* lisp/progmodes/compile.el (compilation--message): Add 'rule' slot.
(compilation-directory-properties, compilation-error-properties)
(compilation-internal-error-properties, compilation-parse-errors)
(compilation--compat-parse-errors): Set the rule slot.
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data)
(compile-tests--grep-regexp-testcases)
(compile-tests--grep-regexp-tricky-testcases): Add rules to test cases.
(compile--test-error-line): Check that the rule matches what we expect.
(compile-test-grep-regexps): Adapt to test case format.
Remove now superfluous ert-info.
* lisp/ffap.el (ffap-gopher-at-point): Stop when we get to the end
of the buffer.
* test/lisp/ffap-tests.el (ffap-test-no-newlines): Ensure
termination for corner case (bug#44048).
* lisp/progmodes/cperl-mode.el: Delete a comment which explains a
bug which has been fixed a long time ago (bug#44073).
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-fontify-punct-vars): Add regression tests to verify
that fontification of punctuation variables doesn't start strings.
Third step in converting substitute-command-keys to Lisp.
* lisp/help.el (describe-map): New Lisp version of describe_map.
(help--describe-map-compare, help--describe-translation)
(help--describe-command, help--shadow-lookup): New helper
functions for describe-map.
(help--keymaps-seen, help--previous-description-column): New
variables.
* src/keymap.c
(Fkeymap__get_keyelt): New defun to expose get_keyelt to Lisp.
(Fdescribe_map_tree_old, Fdescribe_map): Remove defuns.
(Fdescribe_vector_internal): New defun to expose describe_vector to
Lisp in a way usable by describe-map.
(syms_of_keymap): New defsubrs for Fkeymap__get_keyelt and
Fdescribe_vector_internal. Remove defsubrs for Fdescribe_map_tree_old
and Fdescribe_map. Remove 'help--keymaps-seen'.
* test/lisp/help-tests.el
(help-tests-substitute-command-keys/shadow): Extend test.
(help-tests-substitute-command-keys/test-mode)
(help-tests-substitute-command-keys/compare-all)
(help-tests-describe-map-tree/no-menu-t)
(help-tests-describe-map-tree/no-menu-nil)
(help-tests-describe-map-tree/mention-shadow-t)
(help-tests-describe-map-tree/mention-shadow-nil)
(help-tests-describe-map-tree/partial-t)
(help-tests-describe-map-tree/partial-nil): New tests.
This is only the first step towards a full Lisp implementation, and
does not remove the old C code. On the contrary, it is partly based
on using the old C code, which is to be replaced in steps. This also
makes it easy to test that it produces the same output as the old.
* src/doc.c (Fsubstitute_command_keys_old): Rename from
Fsubstitute_command_keys.
(Fget_quoting_style): New defun to expose text_quoting_style to Lisp.
(syms_of_doc): Expose above symbols.
* lisp/help.el (substitute-command-keys): New Lisp version of
substitute-command-keys. (Bug#8951)
* src/keymap.c
(Fdescribe_map_tree): New defun to expose describe_map_tree to Lisp.
(syms_of_keymap): New defsubr for Fdescribe_map_tree.
* src/keyboard.c (help_echo_substitute_command_keys):
* src/doc.c (Fdocumentation, Fdocumentation_property):
* src/print.c (print_error_message):
* src/syntax.c (Finternal_describe_syntax_value): Fix calls to use new
Lisp implementation of substitute-command-keys.
* test/src/doc-tests.el: Remove file.
* test/lisp/help-tests.el: Add tests for substitute-command-keys
copied from above file.
Test not only that the indentation engine is idempotent but that it
will indent a file to the expected shape from scratch.
* test/lisp/progmodes/js-tests.el (js-tests--remove-indentation): New.
(js-deftest-indent): Extend test.
Rewriting bookmark-bmenu-mode to be based on 'tabulated-list-mode'
allows us to greatly simplify the code in several cases. In addition,
we get some features for free, such as sorting by column.
The only functional step backwards is that we no longer support the
optional "inline" header line, a bookmark.el-specific feature to have
a header without using 'header-line-format'. This feature is believed
to be not very useful or widely used.
* lisp/bookmark.el (tabulated-list): Require.
(bookmark-bmenu-mode): Inherit from 'tabulated-list-mode' instead of
'special-mode' and make the necessary changes to support that.
(bookmark-bmenu-mode-map): Inherit from 'tabulated-list-mode-map'
instead of 'special-mode-map'. Remove now duplicate key bindings.
(bookmark-bmenu--revert): New function to show the bookmark list using
'tabulated-list-mode'.
(bookmark-bmenu-list): Simplify by using above new function.
(bookmark-bmenu-bookmark): Adapt to 'tabulated-list-mode'.
(bookmark-bmenu--name-predicate)
(bookmark-bmenu--file-predicate): New functions used by
'tabulated-list-mode' to sort.
(bookmark-bmenu-set-header): Redefine as obsolete function alias for
'tabulated-list-init-header'.
(bookmark-bmenu-toggle-filenames, bookmark-bmenu-show-filenames)
(bookmark-bmenu-hide-filenames, bookmark-bmenu-mark)
(bookmark-bmenu-mark-all, bookmark-bmenu-unmark-all)
(bookmark-bmenu-delete-all, bookmark-bmenu-unmark)
(bookmark-bmenu-delete, bookmark-bmenu-delete-backwards): Simplify now
that we can depend on 'tabulated-list-mode' to do more work.
(bookmark-bmenu-use-header-line)
(bookmark-bmenu-inline-header-height): Declare variables relating to
the now unsupported "inline" header obsolete.
(bookmark-bmenu-ensure-position)
(bookmark-bmenu-execute-deletions): Remove code to handle "inline" header.
* test/lisp/bookmark-tests.el
(bookmark-test-bmenu-edit-annotation/show-annotation)
(bookmark-test-bmenu-unmark, bookmark-test-bmenu-mark): Update tests
for minor changes when using 'tabulated-list-mode'.
* test/lisp/saveplace-tests.el
(saveplace-test-forget-unreadable-files): Use file-truename, to
avoid false negatives when file names are not 'equal' as strings,
but point to the same file.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env)
(edebug-tests-run-macro):
* test/lisp/emacs-lisp/testcover-tests.el
(testcover-tests-markup-region, testcover-tests-run-test-case):
Bind find-file-suppress-same-file-warnings to a non-nil value, to
avoid warnings about "same-file-names", at least on MS-Windows,
due to 8+3 aliases.
* test/lisp/help-fns-tests.el (help-fns-test-lisp-macro)
(help-fns-test-lisp-defsubst):
* test/lisp/emacs-lisp/cl-generic-tests.el
(cl-generic-tests--method-files--finds-methods): Adjust test so
that they work in a symlinked environment (bug#43004).
(cl-generic-tests--method-files--finds-methods): Use file-truename
so that this works in a symlinked environment (bug#43004).
* lisp/button.el (button--help-echo): Pass resulting string through
substitute-command-keys for consistency with show-help-function.
* test/lisp/button-tests.el (button-tests--map): New test keymap.
(button--help-echo-string, button--help-echo-form)
(button--help-echo-function): Use it to test command key
substitution in help-echo strings (bug#43070).
* lisp/gnus/gnus-fun.el (gnus-convert-face-to-png): Do it.
* lisp/gnus/gnus-util.el (gnus-base64-repad): Allow not checking
anything, but just repadding.
* lisp/emacs-lisp/comp.el (native-compile): Return the compiled
function when the input is a symbol or a form.
* test/src/comp-tests.el (free-fun, tco, fw-prop): Update tests
for new `native-compile' interface.
Setting the word size ("b w") to 0 removes the word size clipping for
all bit operations (effectively as if a word size of -∞ had been set).
Rotation is disallowed; logical and arithmetic shifts behave
identically.
After a suggestion by Vincent Belaïche.
* lisp/calc/calc-bin.el (calc-word-size, math-binary-arg)
(math-binary-modulo-args, calcFunc-lsh, calcFunc-ash, calcFunc-rot)
(math-clip, math-format-twos-complement): Allow a word size of 0,
meaning -∞.
* test/lisp/calc/calc-tests.el
(calc-tests--not, calc-tests--and, calc-tests--or, calc-tests--xor)
(calc-tests--diff): New functions.
(calc-tests--clip, calc-tests--rot, calc-shift-binary): Extend to
cover word size 0.
(calc-bit-ops): New test.
* doc/misc/calc.texi (Binary Functions): Update manual.
* etc/NEWS: Announce the change.
Make the '/' precedence higher than that of '+' and '-' again,
partially reverting fda9b316f8 (bug#43902).
* lisp/calc/calc-lang.el (tex): Change precedence of '/'.
* test/lisp/calc/calc-tests.el (calc-latex-input): New test.
* doc/lispref/internals.texi (Module Values): Document
make_unibyte_string (bug#34873).
* src/emacs-module.c (module_make_unibyte_string): New function.
(initialize_environment): Export it.
* src/module-env-25.h: Define it.
* test/data/emacs-module/mod-test.c (Fmod_test_return_unibyte):
Test it.
* test/src/emacs-module-tests.el (module/unibyte): Test it.
c00606171f (origin/emacs-27) A better fix for bug#43886
3196fd44c3 Avoid crashes when a theme is loaded with one frame suspended
0407b15500 Removed an incorrectly placed extra word in the semantic docs
040dcbe53e Fix current-line hscrolling when overlays change
c56eeba2ce Extend tests for shell-command-dont-erase-buffer
Arithmetic right shift didn't compute the bit to shift in correctly.
For example, #x600000000 right-shifted 8 steps (with 32 bit word size)
resulted in #xff000000 rather than 0. (Bug#43764)
* lisp/calc/calc-bin.el (calcFunc-ash): Fix condition.
* test/lisp/calc/calc-tests.el (calc-tests--clip, calc-tests--lsh)
(calc-tests--rsh, calc-tests--ash, calc-tests--rash, calc-tests--rot):
New.
(calc-shift-binary): New test.
* lisp/comint.el (comint-password-prompt-regexp): match OpenBSD doas
password prompt. OpenBSD 5.8 replaced sudo with doas in the base
install.
* test/lisp/comint-tests.el (comint-testsuite-password-strings): test
that the doas password prompt is matched (bug#43846).
Copyright-paperwork-exempt: yes
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-indent-exp): Make sure that cperl-mode is active
for testing 'cperl-indent-exp', also skip this test under
perl-mode.
* test/lisp/progmodes/cperl-mode-resources/cperl-indent-exp.pl:
Eliminate dependency on unrelated customizable variables (bug#10483).
This makes it possible to run most of the redisplay code (tho not the
actual drawing since there's nowhere to draw) even when there's no
real frame at hand, as is the case in batch mode.
This makes `xdisp-tests--minibuffer-resizing` work even in batch.
(redisplay_internal): Obey it.
(init_xdisp): Set `echo_area_window` even in noninteractive mode.
* src/dispnew.c (update_frame): Skip the initial frame.
* src/frame.c (make_frame): Use 80x25 as the default initial size.
* test/src/xdisp-tests.el (xdisp-tests--minibuffer-resizing):
Use the new var and fix use of `executing-kbd-macro`.
This now tests the interface between parse-partial-sexp and the low level
comment function in syntax.c
* test/src/syntax-tests.el (syntax-comments-midpoint): New function.
(syntax-pps-comments): New macro.
(top level): Two new syntax-br-comments tests and five new syntax-pps-comments
tests.
* test/data/syntax-comments.txt (top level): Amend some test fragments and add
some more.
The number of days from epoch to Jan 1, 1970 that was used in parsing
and formatting Unix time was incorrect. The previous fix
(in e368697ce3) was incomplete.
Reported by Vincent Belaïche.
* lisp/calc/calc-forms.el (math-unix-epoch): New constant.
(math-format-date-part, math-parse-standard-date, calcFunc-unixtime):
Use math-unix-epoch instead of a constant that is sometimes wrong.
* test/lisp/calc/calc-tests.el (calc-unix-date): New test.
This now tests the interface between scan_lists and the comment functions.
* test/src/syntax-tests.el (syntax-br-comments): New macro.
({-in, ;-in, /*-in): Set parse-sexp-ignore-comments to t.
(top level): Add 15 tests for comments inside brace lists.
* test/data/syntax-comments.txt (top level): Amend some test fragments.
The calculation of business days was broken in 2012 (probably
310e60d945 or thereabouts) when the date representation changed
epoch so that Jan 1, 1 AD became day number 1 instead of 0. Repair
this, along with an unrelated bug that prevented arbitrary holiday
weekdays from working.
Reported by Aaron Zeng.
* lisp/calc/calc-forms.el (math-to-business-day)
(math-from-business-day): Correct calculation of weekdays using Calc's
current (Rata Die) chronology. Modify loop condition to cope with odd
sets of holiday weekdays.
* test/lisp/calc/calc-tests.el (calc-business-days): New test.
Tag all native compiler tests and skip them in vanilla builds
* test/Makefile.in (SELECTOR_DEFAULT, SELECTOR_EXPENSIVE)
(SELECTOR_ALL): Define selectors for vanilla or nativecomp builds.
* test/src/comp-tests.el: Do not native compile test files on
vanilla.
(comp-deftest): New macro to define tests tagging as :nativecomp.
* doc/lispref/loading.texi (Autoload): Document change of name
(bug#39823).
* lisp/emacs-lisp/autoload.el (autoload-find-generated-file): Pass
the file name in.
(autoload-generated-file): Ditto.
(autoload-file-load-name): Ditto.
(generate-file-autoloads): Ditto.
(autoload--setup-output): Ditto.
(autoload-generate-file-autoloads): Ditto, and alter doc string to
reflect when `generated-autoload-file' is heeded.
(update-file-autoloads): Pass outfile in to functions.
(autoload-find-destination): Ditto.
(update-directory-autoloads): Make into an obsolete shim around
`make-directory-autoloads'.
(make-directory-autoloads): Renamed from
`update-directory-autoloads' with new semantics.
(batch-update-autoloads): Adjust caller.
* lisp/emacs-lisp/package.el (package-generate-autoloads): Adjust
caller.
* test/src/syntax-tests: Add a new section testing some aspects of comment
handling in syntax.c. This needs further enhancement. It uses ....
* test/data/syntax-comments.txt: A new test file.
* lisp/progmodes/sql.el (sql-add-product): Re-correct argument
spec. Previous change was due to my mistake; I have
resolved back to the prior behavior (Bug#39960).
* test/lisp/progmodes/sql-tests.el (sql-test-add-product): Added
test to insure I don't make the same mistake again.
* lisp/gnus/mml-sec.el (mml-secure-sender-sign-query): New
function (bug#40118).
(mml-secure-epg-sign): Use it to determine the signer (bug#40118).
* lisp/gnus/mml-sec.el
(mml-secure-allow-signing-with-unknown-recipient): Remove.
* src/indent.c (scan_for_column): Accept 2 more arguments, and
report through them the position corresponding to PREVCOL. All
callers changed.
(Fmove_to_column): Use the prev_col's position to test for a TAB
instead of assuming that the TAB is just before point (which is
false when there's invisible text around). (Bug#43587)
* test/src/indent-tests.el: New file.
* test/lisp/net/dbus-tests.el (dbus--tests-dir): Make it a defconst.
(dbus--test-method-reentry-handler): Mark args as unused.
(dbus-test04-method-reentry): Tag it :expensive-test. Fix typo.
(dbus-test06-property-types): Remove duplicate test.
(dbus--test-introspect): Use `insert-file-contents-literally'.
(dbus--test-validate-property): Mark expected-annotations as unused.
(dbus--test-validate-m-or-s): Remove superfluous le-clause.
* lisp/net/dbus.el (dbus-annotation-deprecated): New defconst.
* test/lisp/net/dbus-tests.el (dbus--tests-dir): New defvar.
(dbus--test-introspect, dbus--test-validate-interface)
(dbus--test-validate-annotations, dbus--test-validate-property)
(dbus--test-validate-m-or-s, dbus--test-validate-signal)
(dbus--test-validate-method): New defuns.
(dbus-test07-introspection): New test.
* test/lisp/net/dbus-resources/org.gnu.Emacs.TestDBus.xml:
New test data.
* lisp/gnus/gnus-icalendar.el
(gnus-icalendar-event:recurring-interval): Fix parsing of weekly
recurring events (bug#43669).
Example: in the absence of explicit INTERVAL value in the calendar
event, a weekly event with occurrences scheduled for Mondays and
Wednesdays should receive the default recurring interval of "1" and the
org mode timestamp repeater should be "+1w".
Due to a bug in the current code we receive "WEEKLY" and "+WEEKLYw"
instead. The patch fixes the issue.
* src/fns.c (Fstring_search): Perform cheap all-ASCII checks before more
expensive ones. Use a faster loop when searching for non-ASCII
non-raw bytes.
* test/src/fns-tests.el (string-search): Add more test cases.
* doc/lispref/searching.texi (Search and Replace): Update.
* lisp/bindings.el (mode-line-position): Update callers.
* lisp/subr.el (string-replace): Rename from replace-in-string
since that clashes with XEmacs' replace-in-string which is
equivalent to the Emacs replace-regexp-in-string (bug#43598).
* test/src/xml-tests.el (libxml-tests): Move half this test for the
recently obsoleted fourth argument to libxml-parse-xml-region...
* test/lisp/xml-tests.el (xml-tests--remove-comments): ...to a new
test here for xml-remove-comments.
* test/src/xml-tests.el (libxml-tests--data-comments-discarded):
Move test data from here...
* test/lisp/xml-tests.el (xml-tests--data-with-comments): ...to here.
Problem reported by Koki Fukuda in:
https://lists.gnu.org/r/emacs-devel/2020-07/msg00169.html
* test/Makefile.in (MODULE_CFLAGS):
Include from the same directories included from in ../src.
* test/src/emacs-module-tests.el (module/describe-function-1):
Strip path to source directory.
(cherry picked from commit c86f3fe0d0)
* test/lisp/textmodes/css-mode-tests.el:
* test/lisp/progmodes/ruby-mode-tests.el: Remove TODO to convert test
files into unit tests. The files are still useful for debugging.
Ref: https://lists.gnu.org/r/emacs-devel/2020-09/msg01906.html
* lisp/wid-edit.el (widget-specify-field): Extend check for adding the
boundary overlay. Plus, a minor comment indentation fix.
(character widget): Tweak the valid-regexp to allow the newline
character.
* test/lisp/wid-edit-tests.el (widget-test-character-widget-value)
(widget-test-editable-field-widget-value): New tests (bug#15925).
* test/lisp/emacs-lisp/ert-x-tests.el (ert-test-describe-test):
* test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01):
Remove unnecessary compat code; these tests should never need to run
on older versions of Emacs.
df04f3e755 Fix a rare segfault in syntax.c
fd1fe1e1ec Add doc to syntax-propertize-function saying it must do a ...
fcd599bbea Minor copyedits of doc of 'with-silent-modifications'
759399cdb1 Improve documentation of 'max-mini-window-height'
3223302aa2 Use modern constant names for the NS pasteboard
985703d380 Fix doc string of 'toggle-menu-bar-mode-from-frame'
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)
# Conflicts:
# lisp/emacs-lisp/syntax.el
# src/syntax.c
* lisp/dired-aux.el (dired-isolated-string-re): Use explicitly
numbered groups.
(dired--star-or-qmark-p): Add START parameter. Make sure to
return the first isolated match.
(dired--need-confirm-positions, dired--mark-positions)
(dired--highlight-no-subst-chars, dired--no-subst-explain)
(dired--no-subst-ask, dired--no-subst-confirm): New functions.
(dired-do-shell-command): Use them (bug#28969, bug#35564).
* test/lisp/dired-aux-tests.el (dired-test-bug27496): Adapt to
new prompt.
(dired-test--check-highlighting): New test helper.
(dired-test-highlight-metachar): New tests.
* doc/emacs/files.texi (Reverting): Document the new command and the
new variable.
* etc/NEWS: Mention the new command and the new variable.
* lisp/files.el (revert-buffer-with-fine-grain): New command. Revert
a buffer trying to be non-destructive, by using replace-buffer-contents.
(revert-buffer-insert-file-contents-delicately): New function, alternative
to revert-buffer-insert-file-contents-function--default-function.
(revert-buffer-with-fine-grain-max-seconds): New variable. Passed as
argument MAX-SECS of replace-buffer-contents.
* test/lisp/files-tests.el (files-tests-lao files-tests-tzu): Helper
variables, taken from diffutils manual, to test reverting a buffer.
(files-tests-revert-buffer)
(files-tests-revert-buffer-with-fine-grain): New tests (bug#18).
* lisp/files.el (magic-fallback-mode-alist): Match "DOCTYPE" in a
case-insensitive way before putting files in mhtml-mode. See
https://html.spec.whatwg.org/multipage/syntax.html#the-doctype for the
standard reference.
* test/lisp/files-tests.el (files-test-magic-mode-alist-doctype): Add
a test (bug#43511).
* test/lisp/net/dbus-tests.el (dbus-test04-register-method):
Do not check for error message text.
(dbus--test-signal-handler): Fix docstring.
(dbus--test-timeout-handler): New defun.
(dbus-test05-register-signal)
(dbus-test06-register-property-emits-signal): Use it.
* lisp/progmodes/cperl-mode.el (cperl-style-alist)
(cperl-set-style): Add indentation style recommended by Damian Conway's
book "Perl Best Practices".
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-indent-styles): Add a test to verify indentation
and unraveling of conditionals (bug#43457).
Add a command 'lossage-size' to set the maximum
number or recorded keystrokes (Bug#38796).
* src/keyboard.c (lossage_limit):
Static variable with the current lossage size limit.
(MIN_NUM_RECENT_KEYS): Renamed from NUM_RECENT_KEYS.
Set it as 100 and use it as the minimum value for lossage_limit.
Keep the same default for the vector size as before (300).
(lossage-size): New command.
(update_recent_keys): Helper function.
(command_loop_1)
(record_char)
(recent-keys)
(syms_of_keyboard): Use lossage_limit as the vector size.
* lisp/help.el (view-lossage): Mention the new command in the docstring.
* etc/NEWS (Changes in Emacs 28.1): Announce this change.
* doc/emacs/help.texi (Misc Help): Update manual.
* test/src/keyboard-tests.el (keyboard-lossage-size): Add test.
* lisp/emacs-lisp/ert-x.el (ert-simulate-keys): New macro.
* test/lisp/international/mule-tests.el
(mule-cmds--test-universal-coding-system-argument): Use it and enable
the test also in batch mode.
For some values outside integers 0≤k≤n, (n choose k) gave wrong
results, entered infinite recursion or used unreasonably amounts of
stack space. This change fixes that and extends the function to all
integer arguments using the definitions from M. J. Kronenburg
(https://arxiv.org/abs/1105.3689).
* lisp/calc/calc-comb.el (calcFunc-choose):
Fix sign error to prevent infinite recursion and extend function to
handle all integer arguments.
(math-choose-iter, math-choose-float-iter): Rewrite in iterative form;
no TCO in elisp yet.
* test/lisp/calc/calc-tests.el (calc-tests--fac, calc-tests--choose)
(calc-tests--check-choose, calc-tests--explain-choose)
(calc-tests--calc-to-number): New helper functions.
(calc-choose): New test.
* src/module-env-28.h: Add field for 'make_interactive' function.
* src/emacs-module.c (Lisp_Module_Function): Add new field holding the
interactive form.
(allocate_module_function): Adapt to structure layout change.
(module_make_interactive, module_function_interactive_form): New
functions.
(initialize_environment): Use them.
* src/eval.c (Fcommandp):
* src/data.c (Finteractive_form): Also handle interactive module
functions.
* test/data/emacs-module/mod-test.c (Fmod_test_identity): New test
function.
(emacs_module_init): Create two interactive module test functions.
* test/src/emacs-module-tests.el (module/interactive/return-t)
(module/interactive/return-t-int, module/interactive/identity):
New unit tests.
* doc/lispref/internals.texi (Module Functions): Document new
function. Rework paragraph about wrapping module functions, as the
example no longer applies.
* etc/NEWS: Document new facility.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test-file-archive-hexlified): New defun.
(tramp-archive-test02-file-name-dissect): Use it. (Bug#43353)
* test/Makefile.in (TEST_LOCALE): Remove.
(emacs): Don't force LC_ALL=C, since it causes problems with
non-ascii directories. This mirrors a 7-year old lisp/Makefile change.
* test/lisp/subr-tests.el (subr-test-version-parsing):
* test/lisp/emacs-lisp/gv-tests.el (gv-dont-define-expander-other-file):
* test/src/callint-tests.el (call-interactively/incomplete-multibyte-sequence):
* test/src/emacs-module-tests.el (module/describe-function-1):
Don't fail if curly quotes are in use, as they can be if LC_ALL != C.
* doc/misc/dbus.texi (Errors and Events):
* etc/NEWS: Mention dbus-show-dbus-errors.
* lisp/net/dbus.el (dbus-compound-types): New defconst.
(dbus): New defgroup.
(dbus-show-dbus-errors): New defcustom.
(dbus-ignore-errors): Use it.
(dbus-set-property): Simplify.
(dbus-property-handler): Implement other compound types of properties.
* test/lisp/net/dbus-tests.el (dbus--test-register-service)
(dbus-test05-register-property): Extend tests.