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

4861 Commits

Author SHA1 Message Date
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