1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00
Commit Graph

4942 Commits

Author SHA1 Message Date
Michael Albinus
ea3656191d ; More instrumentation in autorevert-tests.el 2021-09-25 12:20:46 +02:00
akater
38037e04cb Indent bodies of local function definitions properly in elisp-mode
* lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for
local defforms (`cl-flet' and `cl-labels').
(lisp--local-defform-body): New auxiliary function (bug#9622).
2021-09-25 03:34:37 +02:00
Stefan Kangas
f17fb37c51 Fix recently introduced bug in checkdoc
* lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Fix
recently introduced bug where some abbreviations weren't recognized.
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests-in-abbrevation-p/basic-case): Extend test.
2021-09-24 23:00:57 +02:00
Stefan Kangas
2ee5c80ff5 Revert change to use seq-random-elt in Tramp test
* test/lisp/net/tramp-tests.el (tramp-test44-asynchronous-requests):
Revert change to use seq-random-elt, as Tramp needs to be compatible
with Emacs 25, and the function was only added in 26.1.
2021-09-24 22:19:22 +02:00
Stefan Kangas
35d0675467 Prefer seq-random-elt to nth+random
* lisp/emacs-lisp/seq.el (seq-random-elt): Autoload.
* lisp/avoid.el (mouse-avoidance-random-shape):
* lisp/epa-ks.el (epa-ks--query-url):
* lisp/erc/erc-networks.el (erc-server-select):
* lisp/gnus/gnus-fun.el (gnus--random-face-with-type)
(gnus-fun-ppm-change-string):
* lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type):
* lisp/obsolete/landmark.el (landmark-random-move):
* lisp/play/mpuz.el (mpuz-build-random-perm):
* lisp/play/zone.el (zone-pgm-stress):
* lisp/vc/add-log.el (add-change-log-entry):
* test/lisp/net/tramp-tests.el
(tramp-test44-asynchronous-requests): Prefer seq-random-elt to
nth+random.
2021-09-24 19:41:03 +02:00
Michael Albinus
8fbf816ccd Fix auto-revert-test05-global-notify
* test/lisp/autorevert-tests.el (auto-revert-test05-global-notify):
Adapt test for killed buffer.
2021-09-24 18:09:49 +02:00
Michael Albinus
01e17fd4e9 ; Instrument autorevert-tests.el 2021-09-24 09:56:02 +02:00
Basil L. Contovounesios
4c891b2a05 Pacify recent warnings in ansi-color-tests.el
* test/lisp/ansi-color-tests.el: Remove invalid package keyword
'ansi', and unused dependency on cl-lib.
(yellow, bright-yellow): Replace prefix-less dynvars with
corresponding local lexvars.
(test-strings): Rename prefix-less dynvar...
(ansi-color-tests--strings): ...to this.  All users updated.
(ansi-color-apply-on-region-test)
(ansi-color-apply-on-region-bold-is-bright-test): Simplify.
(ansi-color-apply-on-region-preserving-test): Reindent.
2021-09-24 00:30:06 +01:00
Jim Porter
d4a6e42e92 Add support for "bright" ANSI colors in term-mode
* list/term.el (ansi-term-color-vector): Add new faces.
(term-color-black, term-color-red, term-color-green, term-color-yellow)
(term-color-blue, term-color-magenta, term-color-cyan, term-color-white):
Inherit from 'ansi-color-COLOR'.
(term-color-bright-black, term-color-bright-red, term-color-bright-green)
(term-color-bright-yellow, term-color-bright-blue)
(term-color-bright-magenta, term-color-bright-cyan)
(term-color-bright-white): New faces.
(term--maybe-brighten-color): New function.
(term-handle-colors-array): Handle bright colors.
* test/lisp/term-tests.el (term-colors, term-colors-bold-is-bright):
New functions.
2021-09-23 22:57:53 +02:00
Jim Porter
ceb9da3b71 Add support for "bright" ANSI colors in ansi-color
* lisp/ansi-color.el (ansi-color-bold, ansi-color-faint, ansi-color-italic)
(ansi-color-underline, ansi-color-slow-blink, ansi-color-fast-blink)
(ansi-color-inverse, ansi-color-red, ansi-color-green, ansi-color-yellow)
(ansi-color-blue, ansi-color-magenta, ansi-color-cyan, ansi-color-white)
(ansi-color-bright-red, ansi-color-bright-green, ansi-color-bright-yellow)
(ansi-color-bright-blue, ansi-color-bright-magenta, ansi-color-bright-cyan)
(ansi-color-bright-white): New faces.
(ansi-color-basic-faces-vector, ansi-color-normal-colors-vector)
(ansi-color-bright-colors-vector): New constants.
(ansi-color-faces-vector, ansi-color-names-vector): Make obsolete.
(ansi-color-bold-is-bright): New defcustom.
(ansi-color--find-face): Sort ANSI codes and check
'ansi-color-bold-is-bright'.
(ansi-color-apply-sequence): Support bright ANSI colors.
(ansi-color-make-color-map, ansi-color-map, ansi-color-map-update):
Make obsolete.
(ansi-color-get-face-1): Add BRIGHT parameter.
* lisp/man.el (Man-ansi-color-basic-faces-vector): New variable.
(Man-ansi-color-map): Make obsolete.
(Man-fontify-manpage): Use 'Man-ansi-color-basic-faces-vector' here.
* test/lisp/ansi-color-tests.el
(ansi-color-apply-on-region-bold-is-bright-test): New function.
2021-09-23 22:57:53 +02:00
Stefan Kangas
55083d90a3 Avoid jumping too far in checkdoc-in-abbreviation-p
* lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use
'forward-ward' instead of 'forward-sexp' to avoid jumping too far in
some situations.  (Bug#50731)

* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests--abbrev-test): New helper function.
(checkdoc-tests-in-abbrevation-p/basic-case): Rename from
'checkdoc-tests-in-abbrevation-p'.
(checkdoc-tests-in-abbrevation-p/with-parens)
(checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new
helper function.
(checkdoc-tests-in-abbrevation-p/single-char)
(checkdoc-tests-in-abbrevation-p/with-em-dash)
(checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.
2021-09-23 22:35:40 +02:00
Philip Kaludercic
c44190ca5b Fix string-distance for two empty strings
* fns.c (Fstring_distance): Avoid using uninitialized memory.
* test/src/fns-tests.el (test-string-distance): Add test cases.
2021-09-23 19:10:38 +02:00
Michael Albinus
de7b9e31c4 * test/infra/Dockerfile.emba: Do not run 'make -j4 bootstrap'. 2021-09-23 16:04:35 +02:00
Mattias Engdegård
6ad77d36fd Don't rely on lexical-binding being nil in tests
* test/lisp/button-tests.el (button--help-echo-form):
* test/lisp/files-tests.el (files-tests-permanent-local-variables):
Remove assumption that `with-temp-buffer` creates a buffer
where `lexical-binding` is nil.
2021-09-22 15:42:41 +02:00
Stephen Gildea
7ce721bdac Migrate MH-E functional tests from SourceForge
* test/lisp/mh-e/mh-limit-tests.el:
* test/lisp/mh-e/mh-utils-tests.el:
* test/lisp/mh-e/mh-xface-tests.el:
Import the functional tests from src/mh-unit.el.

mh-unit.el is from the old SourceForge mh-e repository, last changed
in 2017.  To this are applied unmerged patches Mike Kupfer wrote in
2018 ("Refactor mh-unit into functional and release tests" and
"Fix the functional tests").

All tests have been converted to run under Emacs's ERT framework.

Some tests for mh-utils use MH programs to examine mail folders.
These tests require an MH variant to be installed on the system; for
these, added both a mock harness that pretends the needed files and MH
programs do exist, and a wrapper that creates the necessary mail files.

New function 'mh-test-utils-setup-with-variant' bears some resemblance
to 'mh-test-folders-set-up' from the original tests.  New function
'mh-test-utils-setup-with-mocks' is new functionality for these tests.
2021-09-21 22:03:08 -07:00
Lars Ingebrigtsen
2a73673809 Change how thread-first/thread-last indent the first argument
* lisp/doc-view.el (doc-view--current-cache-dir): Reindent.

* lisp/emacs-lisp/subr-x.el (thread-first):
(thread-last): Change indentation to match examples.
(internal--build-binding): Reindent.

* test/lisp/emacs-lisp/subr-x-tests.el
(subr-x-test-thread-first-function-names-are-threaded):
(subr-x-test-thread-first-examples):
(subr-x-test-thread-last-function-names-are-threaded):
(subr-x-test-thread-last-examples): Reindent.
2021-09-22 05:57:48 +02:00
Lars Ingebrigtsen
85e9e5f616 Don't quote nil and t in doc strings and comments
* test/src/minibuf-tests.el (test-try-completion-ignore-case):
* test/lisp/url/url-auth-tests.el
(url-auth-test-digest-auth-retrieve-cache):
* test/lisp/subr-tests.el (subr-tests-add-hook-depth):
* test/lisp/so-long-tests/so-long-tests.el
(so-long-tests-invisible-buffer-function):
* test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort):
* src/xfaces.c:
* src/process.c (Finterrupt_process):
(syms_of_process):
* src/minibuf.c (Fread_from_minibuffer):
(Fcompleting_read):
(syms_of_minibuf):
* src/dispnew.c (syms_of_display):
* src/data.c:
* lisp/so-long.el (so-long--hack-local-variables):
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
(elisp--xref-find-definitions):
* lisp/org/ox-html.el (org-html-htmlize-output-type):
* lisp/org/org-agenda.el (org-agenda-do-in-region):
* lisp/net/tramp.el:
* lisp/minibuffer.el (set-minibuffer-message):
* lisp/isearch.el (isearch-wrap-pause):
(isearch-repeat-on-direction-change):
* lisp/emacs-lisp/timer.el (timer):
* lisp/emacs-lisp/package.el (package-read-archive-contents):
* lisp/emacs-lisp/faceup.el (faceup-next-property-change):
* lisp/emacs-lisp/comp.el (comp-func):
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p):
* lisp/emacs-lisp/cl-macs.el (cl-do):
(cl-do*):
(cl--self-tco):
* lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions):
(byte-compile-cond-jump-table): Don't quote t and nil.
2021-09-21 22:11:43 +02:00
Lars Ingebrigtsen
be4f858498 Add new function `ensure-list'
* doc/lispref/lists.texi (Building Lists): Document it.

* lisp/subr.el (ensure-list): New function.

* lisp/emacs-lisp/shortdoc.el (list): Mention it.
2021-09-21 20:31:05 +02:00
Lars Ingebrigtsen
bd6fe44a57 Revert "Make dired-compress-file query for a directory to uncompress to"
This reverts commit 7e395a59b0.

The behaviour change isn't good for the majority of tar files.
2021-09-21 19:05:49 +02:00
Lars Ingebrigtsen
ff714466e7 Revert "Make recent dired tests check for external executables"
This reverts commit 98a17f30b8.

Reverting parent commit.
2021-09-21 19:05:49 +02:00
Glenn Morris
98a17f30b8 Make recent dired tests check for external executables
* test/lisp/dired-aux-tests.el (dired-test-bug47058-tar)
(dired-test-bug47058-zip): Add skip conditions.
2021-09-21 08:15:02 -07:00
Basil L. Contovounesios
14495e33af Consistently test alist keys with equal in map.el
* etc/NEWS: Announce new default behavior of map-elt and map-delete
on alists.

* lisp/emacs-lisp/map.el: Bump to version 3.2.
(map-elt): Test alist keys with equal by default.  Betray a little
bit more information in the docstring on which functions are used
for which map types.  (Bug#47368)
(map-put): Update docstring accordingly.
(map--plist-delete): Consistently test plist keys with eq.
(map-delete): Consistently test alist keys with equal.

* test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn): Update
for new map-elt behavior.
(test-map-put!-alist, test-map-delete-alist): New tests.
2021-09-21 13:32:49 +01:00
Robert Pluim
0493dd36dc Silence byte-compiler warning for network-stream-tests.el
The api specifically requires a symbol here, so we can't just replace
nowait with nil.

* test/lisp/net/network-stream-tests.el
(open-gnutls-stream-old-api-wait): Add explicit value for nowait
to silence byte-compiler warning due to Bug#47080.
2021-09-21 13:56:34 +02:00
João Távora
0646c68171 Make syntax-ppss more accurate for Python triple quotes (bug#49518)
By putting delimiter syntax on the last character of Python
triple-quoted strings, this makes syntax-ppss be more accurate.

Previously:

    emacs -Q something.py
    type two single quotes
    M-: (nth 3 (syntax-ppss))
    notice how the return value says you're outside a string, correctly
    type another quote
    M-: (nth 3 (syntax-ppss))
    notice how the return value says you're inside a string, correctly
    backspace the quote just entered
    M-: (nth 3 (syntax-ppss))
    notice how the return value says you're inside a string, incorrectly

With this patch the last step is corrected.  This helps things like
electric-pair-mode.  Also, the test
python-syntax-after-python-backspace now passes, again.

* lisp/progmodes/python.el (python-syntax-stringify): Put
delimiter syntax in "inner" of the surrouding triple quotes.

* test/lisp/progmodes/python-tests.el
(python-syntax-after-python-backspace): Passes again.
2021-09-21 10:56:27 +01:00
João Távora
9ad962e118 Expand and improve electric-pair-mode and Python testing (bug#49518)
In python-tests.el, the triple-quote pairing tests are passing
incorrectly, i.e. the auto-pairing functionality they purport to guard
isn't really working for users trying it interactively.  Added a new
failing test, soon to be fixed.

In electric-tests.el, added tests for Python, too.

* test/lisp/electric-tests.el (define-electric-pair-test): Also run
main tests for python-mode.  (pair-some-quotes-skip-others): Test
another slightly different pairing.

* test/lisp/progmodes/python-tests.el
(python-triple-double-quote-pairing): Rename from
python-triple-quote-pairing.
(python-triple-single-quote-pairing): New test.
2021-09-21 10:54:19 +01:00
João Távora
7f169fbe32 Speed up test/lisp/electric-tests.el when run interactively
'blink-paren-function' and its timers could sometimes interfere with
the tests and slow them down significantly.

* test/lisp/electric-tests.el (call-with-saved-electric-modes):
Bind blink-paren-function to nil.
2021-09-21 10:53:37 +01:00
Michalis V
7e395a59b0 Make dired-compress-file query for a directory to uncompress to
* lisp/dired-aux.el (dired-compress-file-suffixes): Specify the
directory in the tar targets.
(dired-uncompress-file): New function (bug#47058).  This asks what
directory to uncompress to.
(dired-compress-file): Use it.
2021-09-21 06:30:58 +02:00
Lars Ingebrigtsen
0619da0d82 Clear netrc cache in auth-source test
* test/lisp/auth-source-tests.el
(auth-source-test-netrc-create-secret): Clear the netrc cache, too.
2021-09-21 05:59:11 +02:00
Lars Ingebrigtsen
bbef979ae1 Only search netrc in the netrc tests
* test/lisp/auth-source-tests.el
(auth-source-test-netrc-create-secret): Only search netrc.
2021-09-21 05:28:45 +02:00
Michael Albinus
4ec00b0ff0 Remove superfluous skip in auth-source-tests.el
* test/lisp/auth-source-tests.el
(auth-source-test-netrc-create-secret): Remove superfluous skip.
2021-09-20 10:21:30 +02:00
Michael Albinus
788a65862e Do not save empty passwords in auth-source-search
* lisp/auth-source.el (auth-source-netrc-create)
(auth-source-secrets-create): Set :save-function only for non
empty passwords.

* lisp/net/tramp.el (tramp-read-passwd): Don't save empty passwords.

* test/lisp/auth-source-tests.el
(auth-source-test-secrets-create-secret): Adapt test.
(auth-source-test-netrc-create-secret): New test.
2021-09-19 19:59:05 +02:00
Eli Zaretskii
11d6d6c3ea Fix performance degradation in commands that describe key bindings
* src/keymap.c (syms_of_keymap)
<describe-bindings-check-shadowing-in-ranges>: New variable.
(describe_vector): Check shadowing of consecutive keys only if
'describe-bindings-check-shadowing-in-ranges' is non-nil.  Remove
redundant second loop when VECTOR is a char-table.  Improve
comments.  Patch by Stefan Kangas <stefan@marxist.se>.  (Bug#45379)

* test/src/keymap-tests.el
(help--describe-vector/bug-9293-one-shadowed-in-range): Adapt the
test case for the new variable.
2021-09-18 13:23:48 +03:00
Michael Albinus
2557c009bb Skip "fast" tests on emba CI
* test/infra/gitlab-ci.yml (stages): Comment "fast" stage out.
(test-fast-inotify): Comment out.
2021-09-18 10:23:32 +02:00
Federico Tedin
4e21c5f451 Check for null bytes in filenames in 'expand-file-name' (bug#49723)
* src/fileio.c (expand-file-name): Check for null bytes for both
NAME and DEFAULT-DIRECTORY arguments.  Also check for null bytes
in buffer-local default-directory, assuming it is used.
* src/coding.c (encode_file_name): Use CHECK_STRING_NULL_BYTES.
* src/lisp.h (CHECK_STRING_NULL_BYTES): Add function for checking
for null bytes in Lisp strings.
* test/src/fileio-tests.el (fileio-test--expand-file-name-null-bytes):
Add test for new changes to expand-file-name.
* etc/NEWS: Announce changes.
2021-09-18 09:36:26 +03:00
Stefan Kangas
b6bff3ba79 checkdoc: 'y-or-n-p' no longer needs space
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine):
Change 'y-or-n-p' check to accept prompt ending with both "? " or "?",
that is, it no longer needs the space.  (Bug#50621)
(checkdoc--fix-y-or-n-p): New helper function.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-fix-y-or-n-p)
(checkdoc-tests-fix-y-or-n-p/no-change)
(checkdoc-tests-fix-y-or-n-p/with-space): New tests.
2021-09-17 22:24:12 +02:00
Stefan Kangas
8220df9355 ; * test/lisp/emacs-lisp/seq-tests.el: Remove duplicate test. 2021-09-17 14:11:06 +02:00
Stefan Kangas
0cf0a2b986 Add new sequence function 'seq-union'
* lisp/emacs-lisp/seq.el (seq-union): New function.
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/shortdoc.el (sequence): Document above new
function.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-union): New test.
2021-09-17 11:03:39 +02:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
Michael Albinus
36474a1e49 Tramp code cleanup
* lisp/net/tramp-sh.el (tramp-methods) <telnet, nc>:
Reintroduce "%n" marker.
(tramp-maybe-open-connection): Handle it.

* lisp/net/tramp.el (tramp-prefix-regexp):
* lisp/net/tramp-smb.el (tramp-smb-options): Fix docstring.

* lisp/net/tramp*.el: Fix typos.  Remove trailing space from
`yes-or-no-p' and `y-or-n-p' prompts.

* test/lisp/net/tramp-tests.el (tramp--test-telnet-p): New defun.
(tramp-test29-start-file-process, tramp-test30-make-process)
(tramp-test35-remote-path, tramp-test44-asynchronous-requests):
Adapt tests.
2021-09-16 16:50:24 +02:00
F. Jason Park
426c5fdfb2 Change the erc debug logging format to be more repeatable
* erc.el (erc-debug-irc-protocol): Fix line-ending mismatch between
incoming and outgoing logger lines without changing interface. Do this
by adding carriage returns to the latter to improve machine
readability. Change printed peer labels to most accurately reflect
logical endpoints.

(erc-debug-irc-protocol-time-format): Add new variable to support
timestamps in protocol logger output.

(erc-debug-irc-protocol-version): Add new variable to help tooling
track logging format independent of ERC and Emacs versions.

(erc-toggle-debug-irc-protocol): Add headers to protocol-log buffer
to aid future bug-reproduction tools. Clean up overlong lines (bug#50009).
2021-09-16 15:35:55 +02:00
F. Jason Park
fb2971e18e Fix erc nick trimming
* lisp/erc/erc.el (erc-lurker-maybe-trim): Prevent warning from
showing up in third-party code using this function by autoloading
rx.el when needed.  Remove trailing chars appended for uniquifying
purposes when a nick is already taken. Special thanks to Mattias
Engdegård for making this more respectable (Bug#50005).

* test/lisp/erc/erc-tests.el: Add tests for the above and require
erc-networks.
2021-09-16 15:25:18 +02:00
F. Jason Park
492fd05ac2 Fix mistake in test for erc-ring-previous-command
* test/lisp/erc/erc-tests.el (erc-ring-previous-command):
The variable erc-send-completed-hook was previously set to nil
permanently, which would affect other tests (bug#50005).
2021-09-16 15:20:59 +02:00
Eli Zaretskii
83557511a7 Update Unicode support to Unicode version 14.0.0
* admin/unidata/copyright.html:
* admin/unidata/UnicodeData.txt:
* admin/unidata/Blocks.txt:
* admin/unidata/BidiBrackets.txt:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/IVD_Sequences.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/SpecialCasing.txt:
* test/manual/BidiCharacterTest.txt: Updated files from Unicode
14.0.

* lisp/international/fontset.el (script-representative-chars): Add
new scripts.
(otf-script-alist): Update from latest version.
(setup-default-fontset): Add new scripts.
* lisp/international/characters.el: Update syntax and category
tables for new characters and scripts.
(char-width-table): Update for changes in Unicode 14.0.
* lisp/international/mule-cmds.el (ucs-names): Update used and
unused ranges per Unicode 14.0.

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update per the test
results.

* doc/lispref/nonascii.texi (Character Properties): Update Unicode
version number.

* etc/NEWS: Announce support for Unicode 14.0.

* admin/notes/unicode: Minor copyedits.
2021-09-15 14:40:13 +03:00
Dmitry Gutov
1f54c7aeed Localize namespace-filtering code
To be able to filter results coming from
elisp-xref-find-def-functions, and for general ease of
understanding.

* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
Undo the previous change.
(xref-backend-apropos): Update accordingly.
(elisp--xref-filter-definitions): New function.
(xref-backend-definitions): Use it to post-filter the results
coming from elisp--xref-find-definitions.

* test/lisp/progmodes/elisp-mode-tests.el (find-defs-minor-defvar-c):
New test.
(find-defs-defun-defvar-el): Update test.
2021-09-15 05:33:06 +03:00
Glenn Morris
42b49e9f39 * test/Makefile.in (XDG_CONFIG_HOME): Don't export (bug#50577). 2021-09-14 16:27:42 -07:00
Harald Jörg
3d49ad73e5 cperl-mode.el: Allow non-ASCII Perl identifiers
Replace all "A-Z" regexp literals with unicode-aware rx constructs
wherever Perl allows non-ASCII identifiers.
* lisp/progmodes/cperl-mode.el (cperl-after-sub-regexp)
(cperl-after-label. cperl-sniff-for-indent)
(cperl-find-pods-heres, cperl-indent-exp)
(cperl-fix-line-spacing, cperl-imenu--create-perl-index)
(cperl-init-faces, cperl-find-tags):
Replace ASCII regex literals by unicode-aware rx constructs.
(cperl-init-faces): Eliminate unused lexical `font-lock-anchored'.
(cperl-have-help-regexp, cperl-word-at-point-hard): Allow non-ASCII
word characters.

* test/lisp/progmodes/cperl-mode-tests.el
(cperl-test-fontify-special-variables): New test for $^T
and $^{VARNAME}.
(cperl-test-ws-rx cperl-test-ws+-rx),
(cperl-test-version-regexp, cperl-test-package-regexp): Skip
for perl-mode.
(cperl-test-identifier-rx, cperl--test-unicode-setup)
(cperl-test-unicode-labels, cperl-test-unicode-sub)
(cperl-test-unicode-varname)
(cperl-test-unicode-varname-list, cperl-test-unicode-arrays)
(cperl-test-unicode-hashes, cperl-test-unicode-hashref)
(cperl-test-unicode-proto, cperl-test-unicode-fhs)
(cperl-test-unicode-hashkeys, cperl-test-word-at-point):
New tests for unicode identifiers.
 (cperl-test-imenu-index): Add a unicode identifier to the test.

* test/lisp/progmodes/cperl-mode-resources/grammar.pl: Add a
function with non-ASCII name for imenu tests.
2021-09-14 17:53:52 +02:00
João Távora
aec08e609e Keep and report "foreign" diangnostics in flymake-cc Flymake backend
This includes diagnostics for .h files that sprang up when checking a
c file.  Those diagnostics are reported to the Flymake infrastructure
which does not (yet) do anything with them.

This includes a change to the test fixtures, too.

* lisp/progmodes/flymake-cc.el (flymake-cc--make-diagnostics): Rework

* test/lisp/progmodes/flymake-resources/another-problematic-file.c:
  New file.

* test/lisp/progmodes/flymake-resources/some-problems.h:
  Add a function declaration..
2021-09-14 12:22:15 +01:00
Dmitry Gutov
feadcae139 Fix the tests
* test/lisp/progmodes/xref-tests.el
(xref--xref-file-name-display-is-abs)
(xref--xref-file-name-display-is-nondirectory)
(xref--xref-file-name-display-is-relative-to-project-root):
Update for the latest change in xref.el.
2021-09-13 15:47:45 +03:00
Stefan Kangas
f02624b342 ; Minor doc fixes found by checkdoc 2021-09-13 06:44:52 +02:00
Stefan Kangas
2110973351 Improve checkdoc abbreviation handling
* lisp/emacs-lisp/checkdoc.el
(checkdoc-in-abbreviation-p): New helper function.
(checkdoc-sentencespace-region-engine): Fix handling abbreviations
after escaped parenthesis.

* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests-in-abbrevation-p)
(checkdoc-tests-in-abbrevation-p/with-parens)
(checkdoc-tests-in-abbrevation-p/with-escaped-parens): New tests.
2021-09-13 06:44:52 +02:00
Stefan Kangas
fc4b956c7c ; Fix symbol quoting typos 2021-09-12 18:36:49 +02:00
Mattias Engdegård
4a44ac987e Infer identifier namespace in elisp xref backend
Improve the accuracy of `xref-find-definitions` by inferring the
likely namespace of the sought identifier from its context.
This reduces the number of irrelevant search hits when it is clear
what kind of identifier is being looked for (such as showing a
variable when the user looks for a function).

Co-written with Dmitry Gutov.

* lisp/progmodes/elisp-mode.el (elisp--xref-list-index)
(elisp--xref-infer-namespace, xref-backend-identifier-at-point): New.
(xref-backend-definitions): Use the buffer position for inferring.
(elisp--xref-find-definitions): Use the inferred namespace.
(xref-backend-apropos): Adapt call.
* test/lisp/progmodes/elisp-mode-tests.el (elisp-mode-test--with-buffer)
(elisp-mode-with-buffer, elisp-mode-infer-namespace): New tests.
2021-09-12 13:00:59 +02:00
Mattias Engdegård
020a408eda Propagate aliased lexical variables in byte compiler
Replace uses of a variable aliasing another variable with that aliased
variable, to allow for variable removal when possible.  This also
enables opportunities for other optimisations.  Example:

 (let ((y x)) (f y)) => (f x)

The optimisation is only performed if both aliased and aliasing
variables are lexically bound.  Shadowing bindings are α-renamed when
necessary for correctness.  Example:

   (let* ((b a) (a EXPR)) (f a b))
=> (let* ((a{new} EXPR)) (f a{new} a))

* lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New.
(byte-optimize-form-code-walker): Cancel aliasing upon mutation.
(byte-optimize--rename-var-body, byte-optimize--rename-var): New.
(byte-optimize-let-form): Add the optimisation.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add relevant test cases.
2021-09-11 17:17:33 +02:00
Michael Albinus
ef65d717d0 Tramp code cleanup
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-make-directory): Simplify.

* lisp/net/tramp-sh.el (tramp-methods) <telnet, nc>: Don't use
"%n" marker.

* test/lisp/net/tramp-tests.el (tramp-test13-make-directory): Merge with
`tramp-test-make-directory-helper' and
`tramp-test13-make-directory-with-file-modes'.
(tramp-test44-asynchronous-requests): Use always the same
operation in timer.
2021-09-11 15:35:51 +02:00
Dmitry Gutov
6eba633ead Fix test find-defs-defgeneric-el
* test/lisp/progmodes/elisp-mode-tests.el (find-defs-defgeneric-el):
Fix the test.  Reported by dick.r.chiang@gmail.com.
2021-09-10 18:42:55 +03:00
Stephen Gildea
5ee6583cb2 Tramp: honor default file modes in make-directory
* lisp/net/tramp-sh.el:
* lisp/net/tramp-adb.el:
* lisp/net/tramp-sudoedit.el:
* lisp/net/tramp-gvfs.el: Add support for default file modes to
relevant Tramp back ends for make-directory.  (Closes: Bug#50410)
* test/lisp/net/tramp-tests.el (tramp-test13-make-directory-with-file-modes):
New test.
* etc/NEWS: Note this enhancement.

Thanks to Michael Albinus for helping improve this patch.
2021-09-10 06:30:06 -07:00
Stefan Monnier
8c023e5ea1 Change ruby-align-chained-calls indendation
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Align with the
first sibling on the previous line instead of the last (bug#32496).

That is, before it used to be

one.two.three
       .four

and now it is

one.two.three
   .four
2021-09-09 16:24:57 +02:00
Lars Ingebrigtsen
30aaea1888 Adjust test to describe-function changes
The doc now always ends with an empty line
2021-09-08 09:45:45 +02:00
Harald Jörg
81677cb699 cperl-mode.el: Use rx sequences for Perl grammar
Following advice by Mattias Engdegård, most uses of rx-to-string
were eliminated, and rx sequences used instead to define Perl
grammar components.
* lisp/progmodes/cperl-mode.el: (cperl-block-declaration-p): New
function, replaces regexp literals.
(cperl-imenu--function-name-regexp-perl): Deleted, use rx
sequences to find imenu entries instead.
(cperl-indent-line): Use rx components instead of regexp literals.
(cperl-sniff-for-indent): use `cperl-block-declaration-p' to
increase accuracy, use rx sequence for labels to replace
inaccurate regexp literals.
(cperl-block-p): Replace inline comment by docstring.  Use
`cperl-block-declaration-p'.
(cperl-after-block-p): Use `cperl-block-declaration-p'.
(cperl-after-block-and-statement-beg): Replace inline comment by
docstring.
(cperl-imenu-package-keywords), (cperl-imenu-sub-keywords),
(cperl-imenu-pod-keywords) : New variables to sort imenu
entries into categories.
(cperl-imenu--create-perl-index): Use rx sequences to collect
imenu entries.
(cperl-init-faces): Use rx components instead of regexp literals
for labels.

* test/lisp/progmodes/cperl-mode-tests.el: Test rx sequences
instead of regexp strings
2021-09-07 22:31:06 +02:00
Lars Ingebrigtsen
8448782b40 Fix encoding in browse-url-encode-url
* lisp/net/browse-url.el (browse-url-url-encode-chars): Document
what the argument really is, and simplify the implementation
(bug#50435).
(browse-url-encode-url): Encode spaces.
2021-09-07 17:46:55 +02:00
Michael Albinus
31db28b1bb Adapt tramp-test26-file-name-completion
* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion):
Do not check for default method.
2021-09-07 16:28:41 +02:00
A
55540a3d89 * test/lisp/vc/vc-tests.el (vc-test--version-diff): Git env tweak. 2021-09-06 19:12:30 -07:00
Mattias Engdegård
fab1e220db Optimise member and assoc (etc) with constant empty list
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
(byte-optimize-member, byte-optimize-assoc, byte-optimize-memq):
When the list argument is constant nil, the result is always nil.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
2021-09-06 16:47:13 +02:00
Stefan Kangas
ff7867b4e7 ; * test/lisp/newcomment-tests.el: Fix copyright year. 2021-09-06 04:26:30 +02:00
Dmitry Gutov
71f8b55f46 project--files-in-directory: Fix handling of ignores
* lisp/progmodes/project.el (project--files-in-directory):
Pass "." as the DIR argument to 'find' because otherwise the ignore
expression can match the project root directory name, which we don't
want to happen (bug#50240).  Fixup the resulting file names at the end
with concatenation.
Originally I thought it could lead to worse performance, but the
results show equal or slightly better timings.

* lisp/progmodes/xref.el (xref-matches-in-directory):
Apply a similar fix.
(xref--find-ignores-arguments): Use file-name-as-directory, so
that when passed "." replace-match still had the expected effect.

* test/lisp/progmodes/project-tests.el (project-ignores-bug-50240):
New test.

* test/lisp/progmodes/xref-tests.el
(xref-matches-in-directory-filters-with-ignores): New test.
2021-09-06 05:01:07 +03:00
Dmitry Gutov
80d318aabb Try to fix vc-test-git06-version-diff on Hydra
* test/lisp/vc/vc-tests.el (vc-test--version-diff):
Fix Git backend when running in clean environment.
(vc-test-git06-version-diff): Unskip on Hydra.
2021-09-06 02:32:46 +03:00
Glenn Morris
dd4be8ad3b * test/lisp/vc/vc-tests.el (vc-test-git06-version-diff): Skip on hydra. 2021-09-05 14:04:43 -07:00
Lars Ingebrigtsen
c5b654b3f1 Autoload cl-struct-slot-info
* lisp/emacs-lisp/cl-macs.el (cl-struct-slot-info): Autoload
(bug#50301).

* test/lisp/emacs-lisp/memory-report-tests.el: Don't require cl-macs.
2021-09-05 16:52:14 +02:00
Michael Albinus
e6f936eb4d Cleanup tramp-tests.el
* test/lisp/net/tramp-tests.el
(tramp--test--deftest-direct-async-process): Fix macro declaration.
(tramp-test29-start-file-process, tramp-test30-make-process):
Do not run connection type test for direct async processes.
2021-09-05 09:23:30 +02:00
Glenn Morris
76300b87d4 * test/lisp/vc/vc-tests.el (vc-test-sccs06-version-diff): Fix it. 2021-09-04 18:39:20 -07:00
Dmitry Gutov
1d36043809 Fix test on machines with Bzr not set up
* test/lisp/vc/vc-tests.el (vc-test--version-diff):
Add EMAIL= to the environment to avoid potential failure.
2021-09-05 02:44:08 +03:00
Matthias Meulien
ea53f0df65 Add tests for vc-version-diff
* test/lisp/vc/vc-tests.el (vc-test--version-diff):
New function.
(vc-test-%s06-version-diff): New family of tests.
2021-09-05 02:32:49 +03:00
Yuchen Pei
ca7e76c6f9 Add diary-offset to diary-lib.el
* doc/emacs/calendar.texi: Document the change.
* lisp/calendar/diary-lib.el (diary-offset):
* test/lisp/calendar/icalendar-tests.el: Add a test (bug#50195).
2021-09-04 09:12:10 +02:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Stefan Kangas
0034067f47 Avoid cl-lib alias for cadadr and friends
* lisp/edmacro.el (edmacro-fix-menu-commands):
* lisp/frameset.el (frameset-move-onscreen):
* lisp/htmlfontify.el (hfy-face-at, hfy-merge-adjacent-spans)
(hfy-mark-tag-names):
* lisp/mail/footnote.el (footnote--make-hole)
(footnote-back-to-message):
* lisp/net/eudc.el (eudc-get-email, eudc-get-phone):
* lisp/net/rcirc.el (rcirc-make-trees, rcirc-handler-333)
(rcirc-authenticate):
* lisp/play/5x5.el (5x5-draw-grid, 5x5-solver):
* lisp/play/decipher.el (decipher-insert-frequency-counts):
* lisp/ses.el (ses-relocate-range):
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-step-into-macro-error)
(edebug-tests-error-stepping-into-subr): Avoid using cl-lib aliases
for cadadr and friends that now reside in subr.el.
2021-09-03 10:18:54 +02:00
Stefan Kangas
07e8ff7f0f Move cl-lib tests for caaXr to subr-tests.el
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-test-caaar)
(cl-test-caadr): Move tests using a cl-lib alias from here...
* test/lisp/subr-tests.el (subr-test-caaar, subr-test-caadr): ...to
here.  The functions under test are in subr.el.
2021-09-03 10:18:54 +02:00
Lars Ingebrigtsen
d9dabdb381 Fix memory-report test failure
* test/lisp/emacs-lisp/memory-report-tests.el: Fix test build failure.
2021-09-03 07:46:46 +02:00
Glenn Morris
926e69b207 More fixes for recently added vc-rename test
* test/lisp/vc/vc-tests.el (vc-test-cvs05-rename-file): Skip.
(vc-test-sccs05-rename-file): Treat like RCS.
2021-09-02 17:16:53 -07:00
Yikai Zhao
d8d5dc4565 memory-report: support calculating size for structures
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Add
support for cl-defstruct types (bug#50301).
2021-09-02 09:37:06 +02:00
Lars Ingebrigtsen
7d7e8a9c15 Add a test for bug#50320 in sh-script 2021-09-02 08:43:48 +02:00
Lars Ingebrigtsen
f143260d04 Revert "Tweak sh-script-mode indentation further"
This reverts commit 6392bc37ab.

The changes led to errors throughout (bug#50320).
2021-09-02 08:41:30 +02:00
Lars Ingebrigtsen
6a6de68daf Add new macro `with-existing-directory'
* doc/lispref/files.texi (Testing Accessibility): Document it.
* lisp/subr.el (with-existing-directory): New macro (bug#32004).
2021-09-01 15:56:04 +02:00
Lars Ingebrigtsen
fffcc7ab25 Fix (setf (map-elt map key) (my-func))
* lisp/emacs-lisp/map.el (map-elt): Ensure that the value isn't
referenced more than once (bug#50290).
2021-09-01 10:32:49 +02:00
Harald Jörg
a1887cc5e6 ; cperl-mode.el: Fix border cases of inserting with elisp
* lisp/progmodes/cperl-mode.el (cperl-unwind-to-safe): Replace
(and extend) inline comment by a docstring.  Handle edge cases when
inserting text with elisp (related to Bug#28962).
(cperl-process-here-doc): Add syntax-type `here-doc-start'.
(cperl-find-pods-heres): Make sure that the results of this
function are immediately visible.

* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-14343):
Add test cases for "empty" here-documents and inserting at the
edges of a here-document.
2021-08-30 20:32:41 +02:00
Stefan Monnier
ebd7c52f11 (cperl-test-bug-14343): Make it work for perl-mode
* test/lisp/progmodes/cperl-mode-tests.el (cperl--tests-heredoc-face):
New const.
(cperl-test-heredocs, cperl-test-bug-14343): Use it.
(cperl-test-identify-no-heredoc): Remove left-over message.
2021-08-30 10:52:25 -04:00
Stefan Monnier
455bed3c72 * test/lisp/progmodes/cperl-mode-tests.el: Adjust here-doc tests for perl-mode
(cperl-test-identify-heredoc, cperl-test-identify-no-heredoc):
Tweak tests so they can also be used for perl-mode.
2021-08-30 10:47:16 -04:00
Lars Ingebrigtsen
7dabcb1511 Make rfc2368 obsolete and add rfc6068
* lisp/obsolete/rfc2368.el: Moved here and made obsolete.

* lisp/mail/rfc6068.el (rfc6068-unhexify-string): New file.
2021-08-30 01:56:10 +02:00
Lars Ingebrigtsen
7c7d58f454 Fix vc test for RCS
* test/lisp/vc/vc-tests.el (vc-test--rename-file): Fix test for RCS.
2021-08-29 21:56:22 +02:00
Clément Pit-Claudel
9117a76b53 Change --with-nativecomp to --with-native-compilation in messages
* configure.ac:
* test/infra/Dockerfile.emba:
* test/infra/gitlab-ci.yml: Fix mentions of --with-nativecomp
(bug#50255).
2021-08-29 21:32:01 +02:00
Kévin Le Gouguec
6392bc37ab Tweak sh-script-mode indentation further
* lisp/progmodes/sh-script.el (sh-smie--default-backward-token):
Allow more parentheses in a token (bug#44592).
2021-08-29 21:32:01 +02:00
Dmitry Gutov
8fb32387c1 ; Remove copypasta accident 2021-08-29 03:58:01 +03:00
Dmitry Gutov
6d36177589 Add tests for vc-rename-file
* test/lisp/vc/vc-tests.el (vc-test--rename-file): New function.
(vc-test-%s05-rename-file): New family of tests (bug#39452).
2021-08-29 03:17:08 +03:00
Dario Gjorgjevski
4bb70549f7 Fix shell-script-mode indentation of continuation lines
* lisp/progmodes/sh-script.el (sh-smie--default-backward-token):
Fix indentation of continuation lines (bug#44592).
2021-08-27 19:08:41 +02:00
Christophe Troestler
0d45ad99da lisp/newcomment.el: Uncommenting with whitespace `comment-continue'
* lisp/newcomment.el (uncomment-region-default-1): Make
all-whitespace `comment-continue' work (bug#50226).

Copyright-paperwork-exempt: yes
2021-08-27 17:15:17 +02:00
Lars Ingebrigtsen
fc4d3eea5a Revert "Add support for "bright" ANSI colors in ansi-color"
This reverts commit c8e3347ec0.

Jim Porter's paperwork isn't finalised yet.
2021-08-26 15:22:28 +02:00
Lars Ingebrigtsen
2e2400a13f Revert "Add support for "bright" ANSI colors in term-mode"
This reverts commit 2b2a103db0.

Jim Porter's paperwork isn't finalized yet.
2021-08-26 15:21:52 +02:00
Michael Albinus
e5f82c1305 Improve robustness of shadowfile.el
* lisp/shadowfile.el (shadow-site-help): New defconst.
(shadow-read-site): Use it.
(shadow-make-fullname, shadow-contract-file-name)
(shadow-define-literal-group): Handle errors more robust.  (Bug#49596)

* test/lisp/shadowfile-tests.el (shadow-test06-literal-groups):
Extend test.
2021-08-26 13:14:19 +02:00
Lars Ingebrigtsen
7db376e560 Make thingatpt respect fields
* lisp/thingatpt.el (thing-at-point): Make thingatpt respect
fields (bug#9454).
2021-08-25 18:04:43 +02:00
Jim Porter
2b2a103db0 Add support for "bright" ANSI colors in term-mode
* list/term.el (ansi-term-color-vector): Add new faces.
(term-color-white): Tweak colors.
(term-color-bright-black, term-color-bright-red, term-color-bright-green)
(term-color-bright-yellow, term-color-bright-blue)
(term-color-bright-magenta, term-color-bright-cyan)
(term-color-bright-white): New faces.
(term--maybe-brighten-color): New function.
(term-handle-colors-array): Handle bright colors.
* test/lisp/term-tests.el (term-colors, term-colors-bold-is-bright):
New functions.
2021-08-25 13:57:25 +02:00
Jim Porter
c8e3347ec0 Add support for "bright" ANSI colors in ansi-color
* lisp/ansi-color.el (ansi-bright-color-names-vector): New defcustom.
(ansi-color-bold-is-bright): New defcustom.
(ansi-color--find-face): Sort ANSI codes and check
'ansi-color-bold-is-bright'.
(ansi-color-apply-sequence): Support bright ANSI colors.
(ansi-color--fill-color-map): New function.
(ansi-color-make-color-map): Add bright ANSI colors.
(ansi-color-get-face-1): Add BRIGHT parameter.
* test/lisp/ansi-color-tests.el
(ansi-color-apply-on-region-bold-is-bright-test): New function.
2021-08-25 13:57:07 +02:00