* 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.
* 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.
* 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.
* 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).
* 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.
* 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).
* 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.
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.
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.
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..
* 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.
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.
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.
* 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.
* 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.
* 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
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
* 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.
* 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.
* 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.
* 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.
* 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).
* 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.