1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-16 09:50:25 +00:00
Commit Graph

3704 Commits

Author SHA1 Message Date
martin rudalics
10696d0ac5 Make delete-pair only delete pairs that are part of insert-pair-alist
* lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that
are part of `insert-pair-alist' (bug#4136).
2020-09-22 16:44:15 +02:00
Mattias Engdegård
3376b08c2e ; * test/lisp/progmodes/ps-mode-tests.el: Add missing backslash 2020-09-22 12:32:12 +02:00
Stefan Kangas
2788557000 Support shellcheck in compilation-mode
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Add shellcheck regexp.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data):
(compile-test-error-regexps): Add test for shellcheck.
* etc/compilation.txt: Add shellcheck example.
* etc/NEWS: Announce the change.

foo
2020-09-22 02:44:47 +02:00
Stefan Kangas
9a3a2a00da Remove some unnecessary compat code
* 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.
2020-09-22 01:00:06 +02:00
Stefan Kangas
9fff5491c3 Convert a manual test for nxml-mode to unit test
* test/manual/indent/nxml.xml: Delete file.
* test/lisp/nxml/nxml-mode-tests.el
(nxml-mode-test-comment-bug-17264): New test based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
b63c3535b0 Convert manual indent test for ruby-mode into unit test
* test/manual/indent/ruby.rb: Move from here...
* test/lisp/progmodes/ruby-mode-resources/ruby.rb: ...to here.

* test/lisp/progmodes/ruby-mode-tests.el
(ruby-mode-tests-data-dir): New variable.
(ruby--indent/converted-from-manual-test): New test.
2020-09-21 18:47:55 +02:00
Stefan Kangas
1d98bed6c3 Convert manual indent test for scheme-mode into unit test
* test/manual/indent/scheme.scm: Delete file.
* test/lisp/progmodes/scheme-tests.el: New file with unit test for
scheme-mode based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
01f7fdb2a0 Convert manual indent test for ps-mode into unit test
* test/manual/indent/ps-mode.ps: Delete file.
* test/lisp/progmodes/ps-mode-tests.el (ps-mode-test-indent):
New unit test based on deleted file.
2020-09-21 18:47:55 +02:00
Stefan Kangas
d5d642eb71 Convert manual indent test for opascal-mode into unit test
* test/manual/indent/opascal.pas: Delete file.
* test/lisp/progmodes/opascal-tests.el: New file with unit test for
oposcal-mode based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
31cb935cd7 Convert manual indent test for lisp-mode into unit test
* test/manual/indent/lisp.lisp: Delete file.
* test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-defun):
New unit test based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
f3e2d3418a Convert manual indent test for elisp-mode into unit test
* test/manual/indent/elisp.el: Delete file.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-indent-basic):
New unit test based on deleted file.
2020-09-21 16:46:21 +02:00
Stefan Kangas
12ca463833 ; * test/lisp/textmodes/css-mode-tests.el: Add TODO. 2020-09-21 16:46:21 +02:00
Stefan Kangas
ebad35e4d9 ; Fix more trivial typos 2020-09-21 15:51:07 +02:00
Stefan Kangas
462dbc1cb2 ; Fix typos 2020-09-21 14:26:42 +02:00
Michael Albinus
63f9d9af81 Add D-Bus tests
* doc/misc/dbus.texi (Type Conversion): Precise basic type values.

* lisp/net/dbus.el (dbus-register-property): Send signal directly.

* src/dbusbind.c (xd_signature): Accept non-nil objects for
DBUS_TYPE_BOOLEAN.

* test/lisp/net/dbus-tests.el (dbus-test01-basic-types)
(dbus-test01-compound-types): New tests.
2020-09-21 13:41:30 +02:00
Glenn Morris
3675993d76 Merge from origin/emacs-27
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
2020-09-20 17:18:16 -07:00
Michael Albinus
f8624fb834 Make D-Bus properties type safe
* doc/misc/dbus.texi (Properties and Annotations):
Precise dbus-get-property and dbus-set-property.
(Type Conversion): Explain :byte and :boolean type conversion.
(Errors and Events): dbus-ignore-errors returns nil when there is
a D-Bus error.  Remove dbus-show-dbus-errors.

* etc/NEWS: Some D-Bus relevant changes.

* lisp/net/dbus.el (dbus-show-dbus-errors): Remove.
(dbus-ignore-errors): Replay implamentation without that variable.
(dbus-check-arguments): New defun.
(dbus-list-activatable-names, dbus-list-names)
(dbus-list-queued-owners, dbus-get-name-owner, dbus-introspect)
(dbus-get-all-properties, dbus-get-all-managed-objects): Don't debug.
(dbus-get-property, dbus-set-property): Propagate errors.
(dbus-register-property): Check for valid VALUE.
(dbus-property-handler): Simplify.

* src/dbusbind.c (Fdbus_message_internal): Adapt docstring.
Handle DBUS_MESSAGE_TYPE_INVALID.

* test/lisp/net/dbus-tests.el (dbus-show-dbus-errors): Don't declare.
(dbus-test06-register-property)
(dbus-test06-register-property-emits-signal): Adapt tests.
2020-09-20 16:44:17 +02:00
Kévin Le Gouguec
f8d8d28bc6 Tweak dired warning about "wildcard" characters
* 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.
2020-09-20 14:16:19 +02:00
dickmao
321bba0c99 Terminate `comint-password-function' tests
* test/lisp/comint-tests.el (comint-test-no-password-function)
(comint-test-password-function-with-value)
(comint-test-password-function-with-nil): refactor
(comint-tests/test-password-function): actually test
`comint-send-invisible' and inhibit inadvertent interactive query
(bug#38825).
2020-09-20 12:43:37 +02:00
Lars Ingebrigtsen
3ec7005315 Tweak a hash table print test 2020-09-20 12:26:29 +02:00
Pip Cet
988f45a75b Fix printing of hash tables with removed elements
* src/print.c (print_vectorlike): Keep track of the actual number
of elements printed rather than attempting to use hash bucket
indices (bug#38892).
2020-09-20 12:24:16 +02:00
Mauro Aranda
1278a9a907 New command: revert-buffer-with-fine-grain
* 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).
2020-09-20 01:04:39 +02:00
Daniel Martín
c9f845a53c Put files in mhtml-mode when they have <!DOCTYPE, case-insensitive
* 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).
2020-09-19 19:15:48 +02:00
Michael Albinus
b23beef3f2 Fix error in D-Bus test
* 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.
2020-09-18 11:17:42 +02:00
Harald Jörg
f7e68759d0 cperl-mode: Add new value "PBP" for 'cperl-set-style'
* 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).
2020-09-17 17:35:11 +02:00
Michael Albinus
6d6ef7b1d0 Work on D-Bus properties etc
* lisp/net/dbus.el (seq, subr-x): Require.
(dbus-error-disconnected, dbus-error-service-unknown): New defconst.
(dbus-set-property, dbus-register-property): Use `keywordp'.  Fix
proper value sending a signal.

* test/lisp/net/dbus-tests.el (dbus-test04-register-method):
Extend test.
(dbus--test-signal-received): New defvar.
(dbus--test-signal-handler): New defun.
(dbus-test05-register-signal)
(dbus-test06-register-property-emits-signal): New tests.
(dbus-test06-register-property)
(dbus-test06-register-property-several-paths): Rename tests.
2020-09-17 17:13:55 +02:00
Tino Calancha
23a3333b3e Give Lisp control on the lossage size
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.
2020-09-17 16:32:18 +02:00
Lars Ingebrigtsen
0a7152e095 Fix up previous replace-in-string commit
* lisp/subr.el (replace-in-string): Fix thinko in implementation.
2020-09-15 17:36:36 +02:00
Lars Ingebrigtsen
caf64ae08b Add new, simple `replace-in-string' function
* lisp/subr.el (replace-in-string): New, side-effect-free function.

* doc/lispref/searching.texi (Search and Replace): Document it.
2020-09-15 17:15:59 +02:00
Stefan Monnier
e408f2fab2 * test/lisp/emacs-lisp/find-func-tests.el: New file (for bug#43393)
* 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.
2020-09-14 16:04:22 -04:00
Mattias Engdegård
0e00f199cd Calc: fix binomial coefficients for negative arguments (bug#16999)
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.
2020-09-14 11:19:22 +02:00
Philipp Stephani
da0e75e741 Add facility to make module functions interactive (Bug#23486).
* 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.
2020-09-13 20:26:47 +02:00
Lars Ingebrigtsen
c2dea983e8 Kill gpg-agents started by mml-sec-tests (bug#43358) 2020-09-13 16:05:25 +02:00
Michael Albinus
a6321fd799 Fix a conversion failure in tramp-archive-tests (Bug#43353)
* 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)
2020-09-13 13:25:52 +02:00
Glenn Morris
18f390af8f Don't force LC_ALL=C upon make check (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.
2020-09-12 20:22:37 -07:00
Glenn Morris
5e7733694e Mark some diff tests as failing in nonascii directories
* test/lisp/vc/diff-mode-tests.el (diff-mode-test-font-lock)
(diff-mode-test-font-lock-syntax-one-line):
Expect failure in non-ascii directories.

; * lisp/vc/diff-mode.el (diff-hunk-file-names): Comment.
2020-09-12 19:47:29 -07:00
Glenn Morris
3e073520b3 Adapt some tests for Emacs's excitingly variable quoting format
* 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.
2020-09-12 11:57:42 -07:00
Glenn Morris
6818867a2e ; Fix copyright years 2020-09-12 10:56:04 -07:00
Michael Albinus
2fca3015dd Cleanup in dbus.el, dbus-tests.el
* lisp/net/dbus.el (dbus-error-no-reply): New defconst.
(dbus-call-method): Use it.
(dbus-call-method-asynchronously, dbus-register-signal): Fix docstring.
(dbus-unregister-object): Obey :serial entries in
`dbus-registered-objects-table'.

* test/lisp/net/dbus-tests.el (dbus-test04-register-method)
(dbus-test05-register-property): Extend tests.
2020-09-12 19:33:44 +02:00
Glenn Morris
184a4977c7 Make vc-bzr tests work with brz 3.1 (bug#43314)
* test/lisp/vc/vc-bzr-tests.el (vc-bzr-test-bug9726)
(vc-bzr-test-bug9781, vc-bzr-test-faulty-bzr-autoloads):
Make them work with brz 3.1.
2020-09-12 09:51:32 -07:00
Stefan Kangas
7d30ca7f66 Move dired-jump from dired-x to dired (Bug#21981)
* lisp/dired-x.el (dired-bind-jump): Change into defvar and make
obsolete.
(dired-extra-startup): Doc fix.
(dired-jump, dired-jump-other-window): Move from here...
* lisp/dired.el (dired-jump, dired-jump-other-window): ...to here.

* lisp/bindings.el (ctl-x-map, ctl-x-4-map): Bind 'C-j' to
'dired-jump' and 'dired-jump-other-window'.

* doc/misc/dired-x.texi (Features, Installation)
(Miscellaneous Commands): Remove documentation of 'dired-jump'.
* doc/emacs/dired.texi (Dired Enter): Document 'dired-jump' and
dired-jump-other-window.
* etc/NEWS: Announce the above changes.

* test/lisp/dired-tests.el (dired-autoload): Adjust test.
2020-09-12 03:42:37 +02:00
Michael Albinus
dbd8994e0d D-Bus: Implement other compound types of properties
* 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.
2020-09-11 15:34:33 +02:00
Mattias Engdegård
c0eee8cb2c Calc: regularise test names
* test/lisp/calc/calc-tests.el (calc-remove-units, calc-extract-units)
(calc-convert-units, calc-bug-23889, calc-trig, calc-format-radix)
(calc-calendar, calc-solve-linear-system):
Use a uniform naming convention (calc- prefix) to simplify test running.
2020-09-11 13:11:43 +02:00
Stefan Kangas
4ba71eee8d Convert indent test for css-mode into automatic test
* test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): New
test.
(css-mode-tests-data-dir): New variable.
* test/manual/indent/css-mode.css: Move from here...
* test/lisp/textmodes/css-mode-resources/test-indent.css: ...to here.
2020-09-10 20:40:34 +02:00
Stefan Kangas
498773447a ; * test/manual/indent/elisp.el: Use lexical-binding. 2020-09-10 20:31:42 +02:00
Stefan Kangas
262d0c6acf Mark some tests as expensive
* test/lisp/autorevert-tests.el
(auto-revert-test00-auto-revert-mode)
(auto-revert-test03-auto-revert-tail-mode)
(auto-revert-test04-auto-revert-mode-dired):
* test/lisp/cedet/semantic-utest-c.el
(semantic-test-c-preprocessor-simulation):
* test/lisp/cedet/srecode-utest-getset.el
(srecode-utest-getset-output):
* test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-test-bug24264):
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives-async):
* test/lisp/filenotify-tests.el (file-notify-test03-events)
(file-notify-test04-autorevert)
(file-notify-test05-file-validity, file-notify-test08-backup):
* test/lisp/net/gnutls-tests.el (test-gnutls-005-aead-ciphers):
* test/lisp/shadowfile-tests.el (shadow-test00-clusters)
(shadow-test09-shadow-copy-files):
2020-09-10 20:25:19 +02:00
Stefan Kangas
be4c4a7389 Use lexical-binding in mml-sec-tests.el
* test/lisp/gnus/mml-sec-tests.el: Use lexical-binding.
(mml-secure-test-mail-fixture)
(mml-secure-test-en-decrypt-with-passphrase): Fix warnings.
2020-09-10 19:32:53 +02:00
Stefan Kangas
ba3e2b80c0 * test/lisp/org/org-tests.el: Use lexical-binding. 2020-09-10 19:32:53 +02:00
Stefan Kangas
d32cf354b0 Use lexical-binding in url-future-tests.el
* test/lisp/url/url-future-tests.el: Use lexical-binding.
(url-future-tests--saver): New variable.
(url-future-tests): Use new variable.
2020-09-10 19:32:53 +02:00
Stefan Kangas
88a25960ec Use lexical-binding in semantic-utest-c.el
* test/lisp/cedet/semantic-utest-c.el: Use lexical-binding.
(semantic-test-gcc-output-parser): Fix warning.
2020-09-10 19:32:53 +02:00