1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-15 09:47:20 +00:00
Commit Graph

4176 Commits

Author SHA1 Message Date
Michael Albinus
20f9645898 * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process):
Use `tramp--test-windows-nt-p'.
2020-11-25 12:24:08 +01:00
Michael Albinus
e45ad6b08e Merge from origin/emacs-27
6442cdc0e4 Revert extra focus redirection in do_switch_frame (Bug#24803)
fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows
dea3d6aa18 Fix handling of defcustom :local tag
2020-11-25 12:18:23 +01:00
Michael Albinus
fc4379f1ae Minor cleanup of tramp-tests.el on MS Windows
* test/lisp/net/tramp-tests.el (tramp-test29-start-file-process):
Do not test remote pty on MS Windows.
2020-11-25 09:41:11 +01:00
Philipp Stephani
5804ac0b49 Add a (broken) unit test to exemplify Bug#11218.
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-with-demoted-errors): New (broken) unit test.
2020-11-24 18:39:58 +01:00
Basil L. Contovounesios
dea3d6aa18 Fix handling of defcustom :local tag
For discussion, see the following emacs-devel thread:
https://lists.gnu.org/r/emacs-devel/2020-11/msg00734.html

* lisp/custom.el (custom-declare-variable): Delay call to
make-variable-buffer-local until after user option has been
initialized with a value.  Otherwise the user option may be
initialized to nil.
* test/lisp/custom-tests.el (custom--test-local-option)
(custom--test-permanent-option): New :local user options.
(custom-test-local-option): New test for defcustom :local keyword.
2020-11-24 16:50:37 +00:00
Mauro Aranda
cbd24607d7 Fix matching of inline choices for the choice widget
A choice widget should be able to match either no inline values or
inline values, upon request.  (Bug#44579)

* lisp/wid-edit.el (choice): New property, :inline-bubbles-p.  A
predicate that returns non-nil if the choice widget can act as an
inline widget.  Document it.
(widget-choice-inline-bubbles-p): New function, for the
:inline-bubbles-p property of the choice widget.
(widget-inline-p): New function.  Use the :inline-bubbles-p property
of the widget, if any.
(widget-match-inline): Use the above to see if the widget can act like
an inline widget.  Document it.
(widget-choice-value-create): Account for the case of a choice widget
that has inline members.
(widget-checklist-add-item, widget-editable-list-value-create)
(widget-group-value-create): Use widget-inline-p rather than just
checking for a non-nil :inline property, allowing these functions to
pass the complete information to widgets like the choice widget to
create their values.

* test/lisp/wid-edit-tests.el (widget-test-choice-match-no-inline)
(widget-test-choice-match-all-inline)
widget-test-choice-match-some-inline): New tests, to check that choice
widgets can match its choices, inline or not.
(widget-test-inline-p): New test, for the new function
widget-inline-p.
(widget-test-repeat-can-handle-choice)
(widget-test-repeat-can-handle-inlinable-choice)
(widget-test-list-can-handle-choice)
(widget-test-list-can-handle-inlinable-choice)
(widget-test-option-can-handle-choice)
(widget-test-option-can-handle-inlinable-choice): New tests.  This
grouping widgets need to be able to create a choice widget regardless
if it has inline choices or not.
2020-11-24 08:31:18 -03:00
Michael Albinus
e2acb8fef4 Adapt files-x-tests.el according to recent Tramp changes
* test/lisp/files-x-tests.el (tramp-connection-local-default-profile):
Don't declare.
(tramp-connection-local-default-shell-variables)
(tramp-connection-local-default-system-variables): Declare.
(files-x-test-with-connection-local-variables): Use them.
2020-11-23 19:54:09 +01:00
Andrea Corallo
033e96055c Merge remote-tracking branch 'savannah/master' into HEAD 2020-11-22 22:23:16 +01:00
Stefan Kangas
9490f12c4d Test for byte-compiler warning "variable lacks prefix"
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--with-warning-test): New macro.
(bytecomp-warn-wrong-args, bytecomp-warn-wrong-args-subr):
Use above new macro.
(bytecomp-warn-variable-lacks-prefix): New test.
2020-11-22 07:19:11 +01:00
Stefan Kangas
b6339fc19c Test interactive-only spec of with-suppressed-warnings
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Test suppressing warning
with interactive-only.
2020-11-22 03:24:26 +01:00
Stefan Kangas
fb9326b45c Say which command shadows a key binding
* src/keymap.c (describe_vector): Say which command shadows this
binding.  (Bug#9293)
* test/src/keymap-tests.el
(help--describe-vector/bug-9293-one-shadowed-in-range): Adapt
test.
2020-11-22 02:48:53 +01:00
Stefan Kangas
84dd5c9bea Don't shadow bindings by the same command
* src/keymap.c (describe_vector): Do not say binding is shadowed if
the other key binding points to the same command.  (Bug#9293)
* test/src/keymap-tests.el
(help--describe-vector/bug-9293-same-command-does-not-shadow): New
test.
2020-11-22 02:45:03 +01:00
Stefan Kangas
a649034336 Don't show key ranges if shadowed by different commands
* src/keymap.c (describe_vector): Make sure found consecutive keys
are either not shadowed or, if they are, that they are shadowed by
the same command.  (Bug#9293)
* test/src/keymap-tests.el
(help--describe-vector/bug-9293-one-shadowed-in-range): New test.
2020-11-22 02:45:03 +01:00
Mauro Aranda
abd15e088e Use cl-letf instead of unwind-protect in a test
* test/lisp/cus-edit-tests.el (cus-edit-tests-customize-saved/show-obsolete):
Good use case for cl-letf, so use it.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca> in:
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00914.html
2020-11-20 19:28:03 -03:00
Stefan Monnier
ac98bcc906 * test/manual/indent/tcl.tcl: Add string interpolation case 2020-11-20 16:54:06 -05:00
Mauro Aranda
6924320aeb Take care of a FIXME in cus-edit-tests.el
* test/lisp/cus-edit-tests.el (cus-edit-tests-customize-saved/show-obsolete):
Add a fake saved-value property, to be able check that the obsolete
option is present in the Customize buffer.  Expect the test to pass
now.
2020-11-20 18:37:30 -03:00
Stefan Kangas
cf436db285 ; Fix trivial typos 2020-11-20 20:35:44 +01:00
Stefan Kangas
b4b1bd6e03 Hide obsolete options in most customize commands
* lisp/cus-edit.el (custom--filter-obsolete-variables): New defun.
* lisp/cus-edit.el (customize-changed-options)
(customize-apropos, custom-group-value-create): Hide obsolete user
options.  (Bug#44598)
* test/lisp/cus-edit-tests.el: New file.
2020-11-20 14:33:25 +01:00
Stefan Monnier
8fac244464 * src/data.c (set_internal): Fix bug#44733
Set the default value when `set` encounters a PER_BUFFER variable
which has been let-bound globally, to match the behavior seen with
`make-variable-buffer-local`.

* test/src/data-tests.el (binding-test--let-buffer-local):
Add corresponding test.
(data-tests--set-default-per-buffer): Add tentative test for the
performance problem encountered in bug#41029.
2020-11-19 17:13:04 -05:00
Stefan Kangas
75555b5b6b Remove some compat code for old versions and XEmacs
* lisp/ibuf-ext.el (ibuffer-old-saved-filters-warning)
(ibuffer-maybe-save-stuff): Assume customize-save-variable is
bound; it is autoloaded.
* lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* lisp/password-cache.el (password-cache-remove):
* lisp/cedet/semantic/bovine/el.el (semantic-dependency-tag-file):
Remove Emacs 21 compat code.
* lisp/cedet/semantic/sort.el (semantic-string-lessp-ci):
Remove Emacs 20 compat code.
* test/lisp/cedet/semantic-utest.el (semantic-utest-temp-directory):
* lisp/mail/supercite.el (sc-ask): Remove XEmacs compat code.
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/idlwave.el (idlwave-mode): Remove commented out
compat code.
2020-11-19 20:43:51 +01:00
Mattias Engdegård
90aab73f8d More string-search optimisations
All-ASCII strings cannot have substrings with non-ASCII characters in
them; use this fact to avoid searching entirely.

* src/fns.c (Fstring_search): For multibyte non-ASCII needle and
unibyte haystack, don't check if the haystack is all-ASCII; it's a
waste of time. For multibyte non-ASCII needle and multibyte
all-ASCII haystack, fail immediately.
* test/src/fns-tests.el (string-search): Add more test cases.
2020-11-19 14:58:48 +01:00
Alan Mackenzie
ab9a23e029 Enhance syntax-tests.el to test nestable comments (Lisp style)
Also add some tests for braces and parse-partial-sexp amongst Lisp style
comments.

* test/src/syntax-tests.el (\;-in, \;-out): Add syntax for { and }.
(top-level): Add new tests for Lisp style comments.
(\#|-in, \#|-out): New functions.
(top-level): Add new tests for nested Lisp style comments, and mixtures of
nested comments with "ordinary" comments.

* test/src/syntax-resources/syntax-comments.txt (top-level): Add new test
fragments for #|...|#, etc.
2020-11-17 16:51:49 +00:00
Stefan Kangas
27655f9f38 Test that substitute-command-keys preserves text properties
* test/lisp/help-tests.el
(help-substitute-command-keys/preserves-text-properties): New test.
(Bug#17052)
2020-11-17 02:21:17 +01:00
Harald Jörg
f5f9e10097 perl-mode and cperl-mode: Recognize regex after "return"
* lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Add
"return" to the keywords which start a regex.

* lisp/progmodes/perl-mode.el (defconst): Add "return" to
'perl--syntax-exp-intro-keywords' (Bug#26850).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-28650):
New test (bug#26850).
2020-11-17 00:20:26 +01:00
Glenn Morris
4a8c1120f5 Merge from origin/emacs-27
75723ec212 (origin/emacs-27) ; * lisp/emacs-lisp/benchmark.el (benchm...
53e2a612ad ; * lib-src/make-fingerprint.c: Update commentary.
286c632772 Reformat argument commentary in etags.c
4ec740866a Make the invocation of combine-change-calls in comment-reg...
66bcec8838 * lisp/progmodes/cc-langs.el (c-<>-notable-chars-re): Fix ...
03eeab469e ; Update the expected result files in test/manual/etags.
d875a22bc6 Update the various INSTALL files

# Conflicts:
#	INSTALL
2020-11-16 09:05:31 -08:00
Andrea Corallo
898f929215 Fix nativecomp cond-rw pass
* lisp/emacs-lisp/comp.el (comp-mvar-symbol-p): Improve it.
	(comp-cond-rw-func): Fix logic for multiple predecessor on target
	block.
	* test/src/comp-tests.el (comp-test-cond-rw-1): New test.
	* test/src/comp-test-funcs.el (comp-test-cond-rw-1-1-f)
	(comp-test-cond-rw-1-2-f): New functions.
2020-11-16 15:32:52 +01:00
Stefan Kangas
f08e6538dc Run menu-item :filter function before showing binding
* lisp/help.el (describe-map): Fix running `menu-item' :filter
functions.  This fixes a mistake in the previous conversion of this
defun from the old C function describe_map.  See the discussion in
Bug#39149.
* test/src/keymap-tests.el
(keymap---get-keyelt/runs-menu-item-filter)
(describe-buffer-bindings/menu-item-filter-show-binding)
(describe-buffer-bindings/menu-item-filter-hide-binding):
New tests.
(keymap-tests--test-menu-item-filter): New defun.
2020-11-15 00:54:07 +01:00
Andrea Corallo
2a8bf2222d Merge remote-tracking branch 'savannah/master' into dev 2020-11-14 22:07:54 +01:00
Andrea Corallo
f702426780 Add `comp-constraint-to-type-spec' and better handle boolean type spec
* lisp/emacs-lisp/comp.el (comp-constraint-to-type-spec): New
	function splitting out code from comp-ret-type-spec + better
	handle boolean type specifier.
	(comp-ret-type-spec): Rework to leverage
	`comp-constraint-to-type-spec'.
	* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a
	testcase.
2020-11-14 22:06:31 +01:00
Andrea Corallo
a467fa5c49 Characterize functions in terms of type specifiers
* lisp/emacs-lisp/comp.el (comp-known-type-specifiers): New const
	in place of `comp-known-ret-types' and `comp-known-ret-ranges'.
	(comp-constraint): New struct to separate the constraint side of
	an mvar.
	(comp-constraint-f): Analogous for functions.
	(comp-mvar): Rework and include `comp-constraint'.
	(comp-type-spec-to-constraint): New function.
	(comp-known-constraints-h): New const.
	(comp-func-ret-typeset, comp-func-ret-range): Rework.
	(comp-fwprop-insn): Fix.
	* test/src/comp-tests.el (destructure-type-spec): New testcase.
2020-11-14 22:06:31 +01:00
Stefan Kangas
61dca6e92a Don't quote lambdas in several places
* lisp/align.el (align-highlight-rule):
* lisp/bookmark.el (bookmark-maybe-sort-alist):
* lisp/emacs-lisp/advice.el (ad-read-advice-name)
(ad-retrieve-args-form, ad-make-hook-form, defadvice)
(ad-with-originals):
* lisp/foldout.el (foldout-inhibit-key-bindings):
* lisp/gnus/gnus-bookmark.el (gnus-bookmark-maybe-sort-alist):
* lisp/mail/rfc822.el (rfc822-addresses-1):
* lisp/net/eudcb-ldap.el (eudc-ldap-cleanup-record-simple):
* lisp/net/net-utils.el (network-connection-to-service):
* lisp/net/socks.el (socks-build-auth-list):
* lisp/org/ox-odt.el (org-odt--image-size):
* lisp/pcomplete.el (pcomplete-command-completion-function)
(pcomplete-default-completion-function, pcomplete-opt):
* lisp/progmodes/cperl-mode.el (cperl-highlight-charclass)
(cperl-tags-hier-init, cperl-tags-treeify)
(cperl-next-interpolated-REx, cperl-time-fontification):
* lisp/shadowfile.el (shadow-copy-files, shadow-shadows-of-1)
(shadow-save-buffers-kill-emacs):
* lisp/strokes.el (strokes-renormalize-to-grid):
* lisp/tempo.el (tempo-insert, tempo-forward-mark)
(tempo-backward-mark):
* lisp/textmodes/artist.el (artist-submit-bug-report):
* lisp/textmodes/ispell.el (ispell-complete-word):
* lisp/url/url-auth.el (url-get-authentication):
* lisp/url/url-cache.el (url-cache-create-filename-human-readable):
* lisp/vcursor.el (vcursor-find-window):
* test/lisp/textmodes/reftex-tests.el
(reftex-parse-bibtex-entry-test): Don't quote lambdas.
2020-11-14 17:04:23 +01:00
Pablo Barbáchano
8700319109 Add an option to preserve ANSI sequences
* lisp/ansi-color.el Add an option to preserve the ANSI sequences
* test/lisp/ansi-color-tests.el: Add tests (bug#44589).
2020-11-14 16:24:38 +01:00
Stefan Kangas
08b1028c1e Use lexical-binding in fortune.el and add tests
* lisp/play/fortune.el: Use lexical-binding.  Remove redundant
:group args.
(fortune-in-buffer): Quote function symbol as such.
* test/lisp/play/fortune-resources/fortunes:
* test/lisp/play/fortune-tests.el: New files.
* .gitignore: Ignore generated file fortunes.dat.
2020-11-14 15:55:08 +01:00
Eli Zaretskii
03eeab469e ; Update the expected result files in test/manual/etags. 2020-11-14 15:59:31 +02:00
Michael Albinus
297f89f7e4 Some minor Tramp fixes, resulting from test campaign
* lisp/net/tramp.el (tramp-handle-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-sh-handle-write-region):
* lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time'
if needed.

* lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping):
(tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is
not trustworthy.

* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for
symlinked files in trash.
(tramp-test20-file-modes): Revert last change, it was a thinko.
2020-11-13 16:55:08 +01:00
Andrea Corallo
9bb2fc1e64 Add copy insn testcase
* test/src/comp-tests.el (copy-insn): New testcase.
	* test/src/comp-test-funcs.el (comp-test-copy-insn-f): New
	function.
2020-11-12 23:58:58 +01:00
Andrea Corallo
c3daee7800 * Add few more type specifier tests
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add three
	tests and uncomment one.
2020-11-12 23:56:53 +01:00
Stefan Kangas
dcd2361801 * test/lisp/help-fns-tests.el: Silence byte-compiler. 2020-11-12 03:27:26 +01:00
Stefan Kangas
3ee56c7e42 * test/lisp/hfy-cmap-resources/rgb.txt: Add comment line. 2020-11-12 03:20:39 +01:00
Andrea Corallo
2435c103a4 * Nativecomp testsuite rework for derived return type specifiers
As we have derived return type specifiers as some test for them.  Also
rewrite some propagation related test using return type specifiers too
as it's way more convenient.

	* test/src/comp-tests.el (fw-prop-1): Nit rename.
	(comp-tests-check-ret-type-spec): New function.
	(comp-tests-type-spec-tests): New variable.
	(comp-tests-cond-rw-0-var) Remove variable.
	(cond-rw-0, cond-rw-1, cond-rw-2, cond-rw-3, cond-rw-4, cond-rw-5)
	Remove tests as now covered by `comp-tests-check-ret-type-spec'.
2020-11-12 00:58:56 +01:00
Andrea Corallo
175efec073 Add a nativecomp testcase
Having this while re-debugging the boostrap would have saved few hours
of debug so let's add it.

	* test/src/comp-tests.el (and-3): Add test.
	* test/src/comp-test-funcs.el (comp-test-and-3-var): New var.
	(comp-test-and-3-f): New function.
2020-11-12 00:55:36 +01:00
Andrea Corallo
e96cd4e82c Add initial nativecomp typeset and range propagation support
This commit add an initial support for a better type propagation and
integer range propagation.

Each mvar can be now characterized by a set of types, a set of values
and an integral range.

	* lisp/emacs-lisp/comp.el (comp-known-ret-types): Store into
	typeset and remove fixnum.
	(comp-known-ret-ranges, comp-type-predicates): New variables.
	(comp-ctxt): Remove supertype-memoize slot and add
	union-typesets-mem.
	(comp-mvar): Remove const-vld, constant, type slots. Add typeset,
	valset, range slots.
	(comp-mvar-value-vld-p, comp-mvar-value, comp-mvar-fixnum-p)
	(comp-mvar-symbol-p, comp-mvar-cons-p)
	(comp-mvar-type-hint-match-p, comp-func-ret-typeset)
	(comp-func-ret-range): New functions.
	(make-comp-mvar, make-comp-ssa-mvar): Update logic.
	(comp--typeof-types): New variable.
	(comp-supertypes, comp-common-supertype): Logic update.
	(comp-subtype-p, comp-union-typesets, comp-range-1+)
	(comp-range-1-, comp-range-<, comp-range-union)
	(comp-range-intersection): New functions.
	(comp-fwprop-prologue, comp-mvar-propagate)
	(comp-function-foldable-p, comp-function-call-maybe-fold)
	(comp-fwprop-insn, comp-call-optim-func, comp-finalize-relocs):
	Logic update.

	* src/comp.c (emit_mvar_rval, emit_call_with_type_hint)
	(emit_call2_with_type_hint): Logic update.

	* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Undo the add
	of fixnum and bignum as unnecessary.

	* test/src/comp-tests.el
	(comp-tests-mentioned-p-1, comp-tests-cond-rw-checker-val)
	(comp-tests-cond-rw-checker-type, cond-rw-1, cond-rw-2)
	(cond-rw-3, cond-rw-4, cond-rw-5): Update for new type interface.
	(range-simple-union, range-simple-intersection): New integer range
	tests.
	(union-types): New union type test.
2020-11-12 00:55:36 +01:00
Michael Albinus
658952a57a Some minor changes to Tramp, do not merge with master
* lisp/net/tramp.el (tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes):
* lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add _COUNT.
Make the functions forward compatible.

* lisp/net/tramp-gvfs.el (tramp-gvfs-enabled):
Increase `max-specpdl-size' temporarily.

* test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun.
(tramp-test05-expand-file-name-relative): Use it.
2020-11-11 13:24:50 +01:00
Harald Jörg
9038890ae2 Cleanup of the test file for cperl-mode
* test/lisp/progmodes/cperl-mode-tests.el
(cperl--run-test-cases): New macro, factored out from various
indentation / rewriting tests.  Contains documentation of the
format used by the cperl-mode-resources files.
(cperl-test-bug-19709): Replace 'next-line' by 'forward-line'.
(cperl-test-indent-exp),
(cperl-test-indent-styles),
(cperl-test-bug-30393): Use the new macro.
(cperl-test-bug-19709): Make fit for Emacs 26.
(cperl-test-indent-styles): Skip for Perl mode (bug#44561).
2020-11-11 10:42:44 +01:00
Stefan Kangas
8ece715af6 Add test for substitute-command-keys with command remap
* test/lisp/help-tests.el (help-tests-remap-map): New variable.
(help-tests-substitute-command-keys/remap): New test.
(help-tests-substitute-command-keys/keymaps)
(help-tests-substitute-command-keys/undefined-map): Fix indentation.
2020-11-09 21:43:53 +01:00
Mattias Engdegård
d8a31b0c03 Better warning suppression in rx-tests
* test/lisp/emacs-lisp/rx-tests.el (rx-compat): Use with-no-warnings
instead of with-suppressed-warnings which complains when running
the test interactively.
2020-11-09 18:05:08 +01:00
Mattias Engdegård
78e1646bf7 Fix pcase rx form snag with '?' and '??' (bug#44532)
This is a regression from Emacs 26.
Reported by Phillip Stephani.

* lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case.

(cherry picked from commit 575b0681d9)
2020-11-09 18:59:24 +02:00
Mattias Engdegård
575b0681d9 Fix pcase rx form snag with '?' and '??' (bug#44532)
This is a regression from Emacs 26.
Reported by Phillip Stephani.

* lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly.
* test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case.
2020-11-09 17:28:37 +01:00
Harald Jörg
8dc237270f cperl-mode: Indentation of ')' follows customisation
* lisp/progmodes/cperl-mode.el (cperl-style-alist): Add
cperl-close-paren-offset to the settings for PBP style.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug19709):
New test to verify correct indentation of closing parentheses (Bug#19709).

* test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl:
New test case with code from the bug report.

* test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl:
Add a new test clause for cperl-close-paren-offset.
2020-11-09 15:25:47 +01:00
Stefan Kangas
3289b96abd Remove test for return value of set-keymap-parent
* test/src/keymap-tests.el
(keymap-keymap-set-parent/returns-parent): Remove test for the return
value of set-keymap-parent.  It is not clear that returning the value
is a very good idea.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
2020-11-09 11:48:56 +01:00
Andrea Corallo
75e8ee728f Merge remote-tracking branch 'savannah/master' into HEAD 2020-11-07 16:21:36 +01:00
Mauro Aranda
423b6b6229 Add test for recent change in enable-theme
* test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings):
Enabling a theme should not change the theme settings, so test for
that.  See
https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html
2020-11-07 09:53:21 -03:00
Stefan Kangas
6df06148e5 Add some more tests for keymap.c
* test/src/keymap-tests.el (keymap-make-keymap)
(keymap-make-sparse-keymap, keymap-keymapp)
(keymap-keymap-parent, keymap-keymap-set-parent/returns-parent)
(keymap-copy-keymap/is-equal, keymap-copy-keymap/is-not-eq)
(keymap-lookup-key, keymap-apropos-internal)
(keymap-apropos-internal/predicate): New tests.
(keymap-tests--make-keymap-test): New defun.
2020-11-07 07:55:50 +01:00
Mattias Engdegård
6e9564f09a Fix javac message parsing column number off-by-one
* lisp/progmodes/compile.el (compilation-error-regexp-alist-alist):
'javac': Column numbers are 1-based by default; remove subtraction and
η-reduce.  Translate regexp to rx (mechanised).
* test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data):
Adapt 'javac' test cases to the change.
2020-11-06 17:16:00 +01:00
Mattias Engdegård
093a6bec52 Update gdb-mi-tests
* test/lisp/progmodes/gdb-mi-tests.el (gdb-mi-parse-value):
Make test pass after the change in gdb-mi-decode-strings default value.
2020-11-06 15:37:17 +01:00
Mattias Engdegård
0c5eb1c7e7 Reduce integer-output-format to print-integers-as-characters
The variable now only controls whether characters are printed, not
the radix.  Control chars are printed in human-readable syntax
only when special escapes such as ?\n are available.  Spaces,
formatting and combining chars are excluded (bug#44155).
Done in collaboration with Juri Linkov.

* src/character.c (graphic_base_p):
* src/print.c (named_escape): New functions.
(print_object): Change semantics as described above.
(syms_of_print): Rename integer-output-format.  Update doc string.
* doc/lispref/streams.texi (Output Variables):
* etc/NEWS:
* test/src/print-tests.el (print-integers-as-characters):
Rename and update according to new semantics.  The test now passes.
2020-11-06 13:55:32 +01:00
Stefan Kangas
1efcec2717 Add more tests for where-is-internal
* test/src/keymap-tests.el (keymap-where-is-internal)
(keymap-where-is-internal/firstonly-t)
(keymap-where-is-internal/menu-item)
(keymap-where-is-internal/advertised-binding)
(keymap-where-is-internal/advertised-binding-respect-remap)
(keymap-where-is-internal/remap)
(keymap-where-is-internal/shadowed): New tests.
(keymap-where-is-internal/preferred-modifier-is-a-string):
Rename from keymap-where-is-internal-test.
2020-11-06 04:59:37 +01:00
Stefan Kangas
38a109e58c ; Silence byte-compiler warnings in tests
* test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--minor-mode):
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393):
Silence byte-compiler.
2020-11-05 18:25:40 +01:00
Michael Albinus
334e2ab440 Still fixes for Tramp directory-files-*
* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Fix COUNT.

* lisp/net/tramp-crypt.el (tramp-crypt-handle-directory-files):
Implement COUNT.

* lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string):
* lisp/net/tramp-integration.el (tramp-eshell-directory-change):
Use `nbutlast'.

* lisp/net/tramp-rclone.el (tramp-rclone-handle-delete-directory)
(tramp-rclone-handle-delete-file): Reorder cache flushing.
(tramp-rclone-handle-directory-files):
Use `tramp-compat-directory-files'.

* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
Fix NOSORT and COUNT.

* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Fix NOSORT.

* test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun.
(tramp-test05-expand-file-name-relative): Use it.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Strengthen test.
(tramp-test20-file-modes): Simplify check.
2020-11-05 17:36:04 +01:00
Stefan Kangas
37c0208aaa ; Silence byte-compiler warning in xdisp-tests.el
* test/src/xdisp-tests.el (xdisp-tests--minibuffer-scroll): Silence
byte-compiler.
2020-11-05 15:44:17 +01:00
Eric Abrahamsen
7fad12c59b New gnus-search library
This library provides a fundamental reworking of the search
functionality previously found in nnir.el.  It uses class-based search
engines to interface with external searching facilities, and a parsed
search query syntax that can search multiple engines.

* lisp/gnus/gnus-search.el: New library containing search
functionality for Gnus.
* doc/misc/gnus.texi: Document.
* lisp/gnus/gnus-group.el (gnus-group-make-search-group,
gnus-group-read-ephemeral-search-group): Remove references to nnir,
change meaning of prefix argument, change values of nnselect-function
and nnselect-args.
* lisp/gnus/nnselect.el: Replace references to nnir
(nnselect-request-article): Use gnus-search functions, and search
criteria.
(nnselect-request-thread, nnselect-search-thread): Use gnus-search
thread search.
(gnus-summary-make-search-group): Switch to use gnus-search function
and arguments.
* test/lisp/gnus/search-tests.el: Tests for new functionality.
2020-11-03 21:20:17 -08:00
Michael Albinus
2fffc1dfdf Some Tramp fixes for directory-files-* and delete-*
* lisp/files.el (delete-directory): Simplify check for trash.

* lisp/net/ange-ftp.el (ange-ftp-delete-file): Implement TRASH.

* lisp/net/tramp-compat.el (tramp-compat-directory-files)
(tramp-compat-directory-files-and-attributes)
(tramp-compat-directory-empty-p): New defaliases.

* lisp/net/tramp.el (tramp-handle-directory-files-and-attributes)
(tramp-skeleton-delete-directory):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Use them.

* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
Implement COUNT.

* test/lisp/net/tramp-tests.el (tramp-test14-delete-directory):
Do not run trash test for ange-ftp.
(tramp-test16-directory-files)
(tramp-test19-directory-files-and-attributes): Check COUNT argument.
2020-11-03 18:47:32 +01:00
Harald Jörg
84f74136d3 cperl-mode: Fix indentation for Emacs 26
* lisp/progmodes/cperl-mode.el (cperl-mode): Add a fix
which is only required for Emacs versions older than 27.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393):
Add a test to verify correct indentation (bug#30393).
2020-11-03 15:28:40 +01:00
Harald Jörg
2800513af5 cperl-mode: Skip a test for older Emacsen (preparing for ELPA)
* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Skip this test for older Emacsen.  The bug has been fixed
in Emacs, but outside of CPerl mode, and therefore will not
be available for older versions via ELPA.
2020-11-03 00:11:12 +01:00
Michael Albinus
e654b41c6f Fix some glitches in recent directory-files-* changes
* doc/lispref/files.texi (Contents of Directories):
Fix description of directory-files, directory-empty-p and
directory-files-and-attributes.

* etc/NEWS: Fix entry for directory-files-and-attributes.  Fix typos.

* lisp/dired.el (directory-empty-p): Move function from here ...

* lisp/files.el (directory-empty-p): ... to here.

* lisp/net/ange-ftp.el (ange-ftp-directory-files): Call `nreverse' later.

* lisp/net/tramp.el (tramp-handle-directory-files):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes): Do not call
`nreverse'.

* src/dired.c (Fdirectory_files)
(Fdirectory_files_and_attributes): Fix docstrings.

* test/src/dired-tests.el: Removed.  Tests moved to
test/lisp/dired-tests.el.

* test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable.
(dired-test-directory-files)
(dired-test-directory-files-and-attributes): New tests.
2020-11-02 17:56:06 +01:00
Michael Albinus
554495006e Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into master 2020-11-02 17:53:00 +01:00
Arthur Miller
0806075520 Add directory-empty-p and new argument COUNT for directory-files-*
* doc/lispref/files.texi (Contents of Directories): Mention COUNT
argument of directory-files.  Add directory-empty-p.

* etc/NEWS: Mention directory-empty-p and directory-files changes.

* lisp/dired.el (directory-empty-p): New defun.

* lisp/net/ange-ftp.el (ange-ftp-directory-files)
(ange-ftp-directory-files-and-attributes):
* lisp/net/tramp.el (tramp-handle-directory-files)
(tramp-handle-directory-files-and-attributes):
* lisp/net/tramp-adb.el
(tramp-adb-handle-directory-files-and-attributes):
* lisp/net/tramp-rclone.el (tramp-rclone-handle-directory-files):
* lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes):
* lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Add new COUNT
argument.

* src/dired.c (directory_files_internal): Implement new
RETURN_COUNT argument.
(Fdirectory_files, Fdirectory_files_and_attributes): Add new COUNT
argument.

* src/lisp.h (directory_files_internal): Add RETURN_COUNT to declaration.

* src/sysdep.c (list_system_processes): Add Qnil to
directory_files_internal call.

* test/src/dired-tests.el (directory-files-and-attributes-tests):
New file.
2020-11-02 12:38:27 +01:00
Lars Ingebrigtsen
5cea77af41 Partially revert previous define-minor-mode change
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Only document the values we want to support, not the ones we
actually support.
(define-minor-mode): Partially revert to previous behaviour.
2020-11-02 10:17:08 +01:00
Stefan Kangas
8ad9932f11 Don't bind standard-output in substitute-command-keys
This fixes a regression with regards to the old C version of
substitute-command-keys.

* lisp/help.el (substitute-command-keys): Don't bind standard-output.
See Bug#39149.
* test/lisp/help-tests.el
(help-tests--was-in-buffer): New variable.
(help-substitute-command-keys/menu-filter-in-correct-buffer): New
test.
2020-11-01 18:58:12 +01:00
Stefan Kangas
ce1856ec09 Insert describe-map-tree header into original buffer
* lisp/help.el (describe-map-tree): Insert header into the original
buffer, not in standard-output.
* test/src/keymap-tests.el
(describe-buffer-bindings/header-in-current-buffer)
(describe-buffer-bindings/returns-nil): New tests.
Ref: https://debbugs.gnu.org/39149#31
2020-11-01 15:53:43 +01:00
Andrea Corallo
933fd76f8f * test/src/comp-tests.el (compile-forms): Fix missing lexical binding. 2020-11-01 15:17:00 +01:00
Andrea Corallo
e1a168f9a7 * Add some 'cond-rw' pass related tests
* test/src/comp-tests.el (comp-tests-cond-rw-checked-function):
	Declare var.
	(comp-tests-cond-rw-checker-val): New function.
	(comp-tests-cond-rw-checker-type): Declare var.
	(comp-tests-cond-rw-checker-type): New function.
	(comp-tests-cond-rw-0-var): Declare var.
	(comp-tests-cond-rw-0, comp-tests-cond-rw-1, comp-tests-cond-rw-2)
	(comp-tests-cond-rw-3, comp-tests-cond-rw-4)
	(comp-tests-cond-rw-5): New testcases.
2020-11-01 15:17:00 +01:00
Lars Ingebrigtsen
2a4b0da28c Make minor mode ARG work as documented
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring):
Clarify when minor modes are switched on/off when called from lisp
(bug#44341).
(define-minor-mode): Make calls from Lisp switch the mode on/off
as documented.
2020-11-01 15:00:44 +01:00
Andrea Corallo
047fe3292d * Rework some native compiler test infrastructure
* test/src/comp-tests.el (comp-tests-map-checker): New function
	returning a list holding checker results.
	(comp-tests-tco-checker, comp-tests-fw-prop-checker-1)
	(comp-tests-pure-checker-1, comp-tests-pure-checker-2): Make use
	of `comp-tests-map-checker'.
2020-11-01 14:27:42 +01:00
Michael Albinus
06585bb939 Trash remote files to local trash (Bug#44216)
* doc/misc/tramp.texi (Frequently Asked Questions): Add trashing.

* lisp/net/tramp-adb.el (tramp-adb-handle-delete-directory)
(tramp-adb-handle-delete-file):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory)
(tramp-gvfs-handle-delete-file):
* lisp/net/tramp-sh.el (tramp-sh-handle-delete-directory)
(tramp-sh-handle-delete-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory)
(tramp-smb-handle-delete-file):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-delete-directory)
(tramp-sudoedit-handle-delete-file): Implement local trash.  (Bug#44216)

* lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-directory)
(tramp-crypt-handle-delete-file): Do not trash.

* lisp/net/tramp.el (tramp-skeleton-delete-directory): New defmacro.

* test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p)
(tramp-test14-delete-directory): Add trashing.
2020-11-01 12:42:29 +01:00
Juri Linkov
5d9e456c3e New variable integer-output-format to print integers as characters (bug#44155)
* doc/lispref/streams.texi (Output Variables): Add integer-output-format.

* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.

* test/src/print-tests.el (print-integer-output-format): New test.
2020-10-31 22:11:02 +02:00
Stefan Kangas
f9cac26dc1 * test/README: Document TEST_BACKTRACE_LINE_LENGTH. 2020-10-31 20:27:39 +01:00
Andrea Corallo
f7f5d59ab4 Merge remote-tracking branch 'savannah/master' into HEAD 2020-10-31 15:00:00 +00:00
Mattias Engdegård
0cbcc6223a 'assoc' is not side-effect-free; constprop its pure subset
Since a supplied test function can do anything, assoc is not
side-effect-free (bug#44018).  However, with only two arguments it is
pure and should be optimised accordingly.

* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'.
(byte-optimize-assoc): Constant-propagate through 2-arg assoc calls.
* test/lisp/emacs-lisp/bytecomp-tests.el
(byte-opt-testsuite-arith-data): Add test cases.
2020-10-31 14:31:43 +01:00
Stefan Monnier
7103192cd2 * src/xdisp.c (syms_of_xdisp) <"scroll-minibuffer-conservatively">: New var
Fix bug#44070, which causes the minibuffer display to jump upon minor edit

(redisplay_window): Obey it.
* lisp/simple.el (end-of-buffer): Obey it.

* test/src/xdisp-tests.el (xdisp-tests--in-minibuffer): New macro,
extracted from `xdisp-tests--minibuffer-resizing`.
(xdisp-tests--minibuffer-resizing): Use it.
(xdisp-tests--minibuffer-scroll): New test.
2020-10-31 09:07:53 -04:00
Mattias Engdegård
c3a20804a8 Trim and explain set of safe forms for 'unsafep' (bug#44018)
* lisp/emacs-lisp/unsafep.el:
Add comment explaining the policy for which forms can be considered
'safe' in the sense of unsafep.  Remove ones that didn't make the cut:

 play-sound-file (large attack surface)
 catch, throw (alter program flow, inject data)
 replace-regexp-in-string (execute arbitary code)
 error, signal (deceptive messages)

* test/lisp/emacs-lisp/unsafep-tests.el (unsafep-tests--unsafe):
Add test cases.
* etc/NEWS: Announce the change.
2020-10-31 13:42:07 +01:00
Mattias Engdegård
a78c6141bc Parse GDB/MI results directly instead of going via JSON (bug#44173)
Translating GDB/MI into JSON is an unnecessary and fragile detour
that made it hard to deal with octal escapes in strings correctly.
Parse GDB/MI directly instead.

* lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Adjust doc string.
(gdb-mi-decode, gud-gdbmi-marker-filter): Remove gdb-mi-decode.
(gdb-jsonify-buffer): Remove.
(gdb-mi--parse-tuple-or-list, gdb-mi--parse-c-string)
(gdb-mi--parse-value, gdb-mi--parse-result-or-value)
(gdb-mi--parse-results, gdb-mi--fix-key, gdb-mi--extend-fullname)
(gdb-mi--c-string-from-string): New functions.
(gdb-json-read-buffer, gdb-json-string, gdb-json-partial-output):
Rename to gdb-mi--read-buffer, gdb-mi--from-string and
gdb-mi--partial-output respectively.  Remove useless FIX-LIST
argument.  FIX-KEY is now a symbol, not a string. All callers updated.
(gdb-tooltip-print, gdbmi-bnf-log-stream-output, gdb-internals)
(gdb-console, gdb-done-or-error, gdb-get-source-file-list)
(gdb-get-prompt, gdb-get-source-file):
Use gdb-mi--c-string-from-string instead of 'read'.
* test/lisp/progmodes/gdb-mi-tests.el: New file.
2020-10-31 13:42:07 +01:00
Jared Finder
2a6337a6c4 Fix unit tests broken by changes to xt-mouse.el
* test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic)
(xt-mouse-tracking-utf-8): Update expected escape sequence.
2020-10-31 09:57:00 +02:00
Eli Zaretskii
8800d8c640 Revert "Temporarily mark two failing tests"
This reverts commit a8426f4672.
A proper fix for the test is about to be installed shortly.
2020-10-31 09:56:14 +02:00
Stefan Monnier
7500abaa8e * lisp/simple.el (blink-matching-open): Fix bug#37127
Don't call `syntax-propertize` from within narrowing

* lisp/progmodes/cperl-mode.el (cperl-forward-re): Revert last patch,
since it is now redundant.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Remove unused var; fix test so it really catches the previous bug;
tweak the code to use mode-agnostic commands so it also works in `perl-mode`.
2020-10-30 18:10:06 -04:00
Lars Ingebrigtsen
bb60887b0d Revert "Adjust python tests after fix for bug#39398"
This reverts commit c6fb23873a.

The code is tweaked to be more backwards-compatible.
2020-10-30 16:10:57 +01:00
Stefan Kangas
0f1f795fc8 ; Fix typo in my last commit
* test/lisp/emacs-lisp/text-property-search-tests.el
(text-property-search--pos-test): Fix typo.
2020-10-30 14:16:25 +01:00
Harald Jörg
101a3b7830 Suppress a misleading message when closing a paren in a regex
* lisp/progmodes/cperl-mode.el (cperl-forward-re): Suppress an
error message about "End of string/RE not found" when we are
at the end of a narrowed buffer where the end of a RE is
temporarily unavailable (Bug#37127).

* test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127):
Add a test to verify that the message is suppressed when
inappropriate, but appears when the RE *is* incomplete.
2020-10-30 13:24:01 +01:00
Stefan Kangas
b295174210 Clarify point position after text-property-search
* lisp/emacs-lisp/text-property-search.el
(text-property-search-forward, text-property-search-backward): Doc fix
to clarify placement of point after search.
* test/lisp/emacs-lisp/text-property-search-tests.el
(text-property-search--pos-test): New defun.
(text-property-search-forward-point-at-beginning)
(text-property-search-backward-point-at-end): New test.
2020-10-30 13:23:31 +01:00
Lars Ingebrigtsen
617f70bc7d `format-time' can now do sub-second times
* doc/lispref/os.texi (Time Parsing): Document it.

* lisp/calendar/time-date.el (format-seconds): Allow formatting
sub-second times.
2020-10-30 12:10:53 +01:00
Hugh Daschbach
4f6b7a0149 * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Expand test. 2020-10-30 08:59:11 +01:00
Harald Jörg
96e371b44a cperl-mode: Make timeout test more robust
* test/lisp/progmodes/cperl-mode-tests.el
(cperl-mode-test-bug-10483): Increase the timeout to 2 seconds
and mark the test as expensive.  Also, suppress it for Emacs
versions below 28, where the test times out though the function
works in manual tests.  (Bug#44317)
2020-10-29 22:44:47 +01:00
Stefan Monnier
7b02d9ba48 * lisp/progmodes/tcl.el: Better match Tcl string formation rules (bug#39277)
(tcl--word-delimiters): New const.
(tcl--syntax-of-quote): New function.
(tcl-syntax-propertize-function): Use them.
(tcl-mode): Enable `syntax-propertize-multiline`.

* test/manual/indent/tcl.tcl: New file.
2020-10-29 13:38:59 -04:00
Michael Albinus
372739b406 Handle several children of PATH in dbus-managed-objects-handler
* lisp/net/dbus.el (dbus-managed-objects-handler): Handle several
children of PATH.  (Bug#44298)

* src/dbusbind.c (xd_signature, xd_append_arg): Check object path.

* test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects):
Tag it :expensive-test.  Remove superfluous check.
2020-10-29 16:56:40 +01:00
Hugh Daschbach
1fb85fb138 * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): New test. 2020-10-29 12:16:45 +01:00
Lars Ingebrigtsen
63b8f25b88 Disable mml-sec-tests on MacOS
* test/lisp/gnus/mml-sec-tests.el (test-conf): Disable tests on
MacOS (bug#44259).
2020-10-28 11:54:53 +01:00
Lars Ingebrigtsen
c6fb23873a Adjust python tests after fix for bug#39398 2020-10-28 09:13:53 +01:00
Stefan Kangas
94ddb1987e ; Fix license statement in several files
Add the line "This file is part of GNU Emacs."
2020-10-28 03:41:55 +01:00
Stefan Kangas
039ffaf69f Use lexical-binding in netrc.el and add tests
* lisp/net/netrc.el: Use lexical-binding.
(netrc-file): Remove redundant :group arg.
* test/lisp/net/netrc-resources/authinfo:
* test/lisp/net/netrc-resources/services:
* test/lisp/net/netrc-tests.el: New files.
2020-10-28 03:24:18 +01:00
Glenn Morris
a8426f4672 Temporarily mark two failing tests
; Persistently failing tests can cause problems for automated builds,
; and make it harder to spot new failures.

* test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic)
(xt-mouse-tracking-utf-8): Currently failing.
2020-10-27 08:35:10 -07:00