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

6972 Commits

Author SHA1 Message Date
João Távora
81c6569e65 Flymake: unbreak tests
Flymake's normal behaviour implies catching the errors of misbehaving
backends.  This behavior is tested by Flymake's automated tests, built
on top of ERT, which means that debug-on-error is always t in the
bodies of said tests (I don't know the rationale for this, but it's
been like this for some time)

Flymake used to shun usage of 'condition-case-unless-debug' because of
this.  But since that macro is pretty useful, I started using it
again, and as a consequence, tests started breaking.

The solution is to:

1. stop requiring the deprecated legacy backend 'flymake-proc' (which
by design, always errors, except in rare circumstances).

2. deliberately set debug-on-error to nil around the "dummy backends""
test.

* lisp/progmodes/flymake.el (flymake-proc): Don't require it by
default.

* test/lisp/progmodes/flymake-tests.el:
(dummy-backends): Make robust to ert's debug-on-error setting.
2023-09-24 09:07:27 +01:00
Eli Zaretskii
cc8726d2c8 Merge from origin/emacs-29
6bc3800000 Ensure ucs-names is consistent with Unicode names
93134bb9c2 Make key-translate actually work
85f49a9bc8 Update to Org 9.6.9
2826c26537 Add leim subdirectories to emacs package
2023-09-23 09:32:57 -04:00
Philip Kaludercic
842411f09b package-tests.el: Add test Bug#65475
* test/lisp/emacs-lisp/package-tests.el (with-package-test): Bind
package-selected-packages.
(package-test-bug65475): Add test.
2023-09-21 18:28:30 +02:00
Mattias Engdegård
b03338c70d Warn about duplicated :tag strings in defcustom choices
It is bad user experience when two menu items have identical labels.

* lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-type): Add check.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test-defcustom-type): Add test case.
2023-09-19 15:21:03 +02:00
Alan Mackenzie
761f8901ff Don't use ellipses while cl-printing strings.
This fixes bug#65680.  The former use of print-length as a
bound on the length of the printed string was erroneous,
causing error messages preceding backtracees to get
unnecessarily truncated to 50 characters.

* lisp/emacs-lisp/cl-print.el (cl-print-object <string>):
Remove the substitution of ellipses for long strings.

* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-ellipsis-string): Remove this test.
2023-09-19 10:25:34 +00:00
Robert Pluim
6bc3800000 Ensure ucs-names is consistent with Unicode names
* lisp/international/mule-cmds.el (ucs-names): Skip adding an old-name
if it conflicts with the offical name of a codepoint.  Adjust the
ranges iterated over to account for new Unicode codepoints.
* test/lisp/international/mule-tests.el
(mule-cmds-tests--ucs-names-old-name-override,
mule-cmds-tests--ucs-names-missing-names): New tests for checking
'ucs-names' consistency.

Bug#65997
2023-09-18 11:55:10 +02:00
Danny Freeman
b892da5f61
Offset ranges before applying embedded tree-sitter parser
This feature would allow treesitter major modes to easily specify
offsets when using embeded parsers.  A potential use case for this is
javascript template strings, when we want to apply a different parser
to the string's contents, but do not want to include the template
string's delimiters.

* lisp/treesit.el
(treesit-query-range): Accept an optional offest arg, apply the offset
to all returned ranges.
(treesit-range-rules): Accept an optional :offset keyword arg to adjust
ranges an embded parser is applied to.
(treesit-update-ranges): Forward optional :offset setting from
`treesit-range-rules' to `treesit-query-rang'.
* test/lisp/treesit-tests.el
(treesit-range-offset): Tests the new offset functionality.
2023-09-17 21:12:56 -07:00
Jim Porter
514b70d5a0 ; Fix last change
* test/lisp/eshell/eshell-tests.el
(eshell-test/eshell-command/output-buffer/sync): Remove unused
let-binding.
2023-09-17 17:34:20 -07:00
F. Jason Park
ef4a3c2a6d ; Fix example in display-buffer section of ERC manual
* doc/misc/erc.texi: Fix `display-buffer-alist' example and mention
that it's only meant for users of Emacs 29 and above.
* test/lisp/erc/erc-tests.el (erc-setup-buffer--custom-action): Add
simplistic test case for example in manual.
2023-09-17 16:06:49 -07:00
Jim Porter
7d2870dc85 Fix running background commands via 'eshell-command'
This regressed (I believe) due to 2ec41c174f.

* lisp/eshell/esh-cmd.el (eshell-resume-eval): Check for non-nil
'retval' instead of for a process list (nil is also a technically a
process list!).

* test/lisp/eshell/eshell-tests.el
(eshell-test/eshell-command/background-pipeline): Remove unnecessary
'copy-tree'.
(eshell-test/eshell-command/output-buffer/sync)
(eshell-test/eshell-command/output-buffer/async): New tests.
2023-09-17 15:45:45 -07:00
Stefan Kangas
f3a50f6dd8 Rename describe-map-tree to help--describe-map-tree
This function should have been made internal in the first place.
* lisp/help.el (help--describe-map-tree): Rename from
'describe-map-tree'.  Keep old name as an obsolete alias, and update
all callers.
2023-09-17 22:56:00 +02:00
Mattias Engdegård
f8ea47ebf4 Expanded defcustom type byte-compilation warnings (bug#65852)
Warn about more kinds of mistakes in :type arguments of `defcustom`
and `define-widget`.  These include:

- misplaced keyword args, as in (const red :tag "A reddish hue")
- missing subordinate types, as in (repeat :tag "List of names")
  or (choice list string)
- duplicated values, as in (choice (const yes) (const yes))
- misplaced `other` member, as in
  (choice (const red) (other nil) (const blue))
- various type name mistakes, as in (vector bool functionp)

* lisp/emacs-lisp/bytecomp.el (byte-compile--defcustom-type-quoted)
(byte-compile-nogroup-warn): Remove.
(byte-compile-normal-call): Remove call to the above.
(bytecomp--cus-warn, bytecomp--check-cus-type)
(bytecomp--custom-declare): New.
2023-09-17 17:16:35 +02:00
Eli Zaretskii
38757723e1 Support Unicode version 15.1
* admin/unidata/BidiBrackets.txt:
* admin/unidata/BidiMirroring.txt:
* admin/unidata/Blocks.txt:
* admin/unidata/IdnaMappingTable.txt:
* admin/unidata/NormalizationTest.txt:
* admin/unidata/PropertyValueAliases.txt:
* admin/unidata/ScriptExtensions.txt:
* admin/unidata/Scripts.txt:
* admin/unidata/SpecialCasing.txt:
* admin/unidata/UnicodeData.txt:
* admin/unidata/confusables.txt:
* admin/unidata/copyright.html:
* test/manual/BidiCharacterTest.txt:
* admin/unidata/emoji-data.txt:
* admin/unidata/emoji-sequences.txt:
* admin/unidata/emoji-test.txt:
* admin/unidata/emoji-variation-sequences.txt:
* admin/unidata/emoji-zwj-sequences.txt: Update from Unicode data
files.
* admin/notes/unicode: Update instructions.
* lisp/international/characters.el: Update 'char-width-table'
data.
* etc/NEWS: Announce support for Unicode 15.1.
2023-09-17 11:40:06 +03:00
Stefan Kangas
7ff836b366 Revert "Mark two tests as expensive"
This reverts commit 1d952078c0.
2023-09-16 19:09:04 +02:00
Eli Zaretskii
302bc23f7c Merge from origin/emacs-29
755ae813a6 ; Declare some treesit.c functions in typescript-ts-mode.el.
89fa204b70 Fix loss of encrypted data in plstore.el
d9a1175a61 Close SQL database when corresponding 'sqlite-mode' buffe...
cbd8fac283 Fix Unicode normalization of characters
825be05b37 Support one-time passwords in Tramp
f880b94e64 Fix the 'C' and 'c' categories of characters
58fd212d8a Fix Emoji zooming commands
8970cdd009 ; Fix last change.
ba924be452 ; * etc/DEBUG: Improve the redisplay section.
e110312ad9 ; * doc/lispref/minibuf.texi (Text from Minibuffer): Ment...
65f4810003 tsx-ts-mode--font-lock-compatibility-bb1f97b: Improve
6fe11b88ed Avoid using --display in emacsclient to reuse frames on PGTK
2fc7463c0e ; * INSTALL: Don't advertise -O3.  (Bug#65988)
29055412f2 ; Fix doc string of 'lsh'
738d854333 Support emacsclient on Windows with server on GNU or Unix...
f0a89fa1d0 ; * lisp/saveplace.el (save-place-ignore-files-regexp): F...
c9cb8ee0fc Fix defcustom in saveplace.el (Bug#65977)
5ec8be1d58 ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc ...
809305e6d8 Fix 'window-text-pixel-size' when there are several image...
ea14b0dcc2 : Doc fix.
01e8a0c6cb Doc fix for prettify-symbols-unprettify-at-point
0065621d0d (report_overlay_modification): Fix bug#65929
6cc6455e93 Fix SVG colors (bug#56182)
9396d73942 * doc/emacs/text.texi (Outline Minor Mode): Add a note ab...
a65d1a5a16 Improve documentation of 'list-abbrevs'
5dcc4b7eab Tweak s-p-f for js-ts-mode
1fb2fb501f typescript-ts-mode, tsx-ts-mode: Fix syntax properties fo...
946b395e7e * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Provide (bug...
33ee3e588f Fix regression of treesit_cursor_helper_1
d11d81dfcc ; Fix doc typos (Bug#65868)
6554ec2246 Update docs for passing of Thien-Thi Nguyen
5ab2792d5c Update defvar usage tips example in manual
35d88c657e Document using Flymake together with Eglot
3f04efe9e7 ; * src/font.h (struct font): Comment about use of averag...
459b5f6b6d ; * admin/authors.el (authors-aliases): Update.
0c029ae8bc ; tweak etc/TODO item

# Conflicts:
#	admin/authors.el
#	lisp/subr.el
2023-09-16 07:36:49 -04:00
bug-gnu-emacs@gnu.org
b6659e98a4 bug#65673: Add lua-ts-mode
* lisp/progmodes/lua-ts-mode.el:
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
* test/lisp/progmodes/lua-ts-mode-tests.el: New files.
* etc/NEWS: Mention the new mode.
* lisp/progmodes/eglot.el (eglot-server-programs):
* lisp/progmodes/hideshow.el (hs-special-modes-alist):
Support 'lua-ts-mode'.
* admin/notes/tree-sitter/build-module/batch.sh:
* admin/notes/tree-sitter/build-module/build.sh: Add Lua.
* test/infra/Dockerfile.emba:
* test/infra/test-jobs.yml: Include lua-ts-mode tests.
2023-09-16 13:01:43 +03:00
Mauro Aranda
2ea98ea35c Avoid errors when a restricted-sexp widget is empty
* lisp/wid-edit.el (restricted-sexp): Don't try to read
an empty string when converting the current value to the
external format.  (Bug#63838)

* test/lisp/wid-edit-tests.el (widget-test-restricted-sexp-empty-val):
New test.
2023-09-16 12:56:34 +03:00
Eli Zaretskii
cbd8fac283 Fix Unicode normalization of characters
* lisp/international/ucs-normalize.el
(ucs-normalize-composition-exclusions, check-range): Update from
Unicode 15.0 data.  (Bug#65996)

* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update to reflect
changes in ucs-normalize.el.

* admin/notes/unicode: Mention the updates in ucs-normalize.el.
2023-09-16 12:17:23 +03:00
Jim Porter
bc25d76650 Fix documented Eshell behavior of ignoring leading nils in commands
* lisp/eshell/esh-var.el (eshell-handle-local-variables): Simplify,
and move leading-nil handling to...
* lisp/eshell/esh-cmd.el (eshell-named-command): ... here.

* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/skip-leading-nils):
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/local-variables/skip-nil): New tests.

* doc/misc/eshell.texi (Expansion): Document this behavior.
2023-09-15 13:43:07 -07:00
Stefan Monnier
e7e925f062 (mutually_exclusive_p): Fix the regression from commit 6fad73d7cc
Commit 6fad73d7cc throws away some useful optimization because
it misfired in some cases (as seen in bug#657260).  Here we try to
recover those useful optimizations with a slightly more careful
algorithm.

* src/regex-emacs.c (mutually_exclusive_aux): Rename from
`mutually_exclusive_p`.  Add two new args.  Improve the
case where we need to recurse.
(mutually_exclusive_p): New function defined on top of it.

* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Re-enable the test.
2023-09-15 14:53:24 -04:00
Stefan Kangas
1d952078c0 Mark two tests as expensive
* test/lisp/calendar/todo-mode-tests.el
(todo-test-add-and-delete-file):
* test/lisp/simple-tests.el (simple-tests-shell-command-39067):
Mark tests taking more than 10 seconds to run on a MacBook Pro from
2015 as expensive.
2023-09-15 11:28:25 +02:00
Michael Albinus
2f2f934208 Fix Tramp test on NetBSD
* test/lisp/net/tramp-tests.el (tramp--test-netbsd-p): New defun.
(tramp--test-check-files): Use it.
2023-09-14 14:38:27 +02:00
F. Jason Park
d8c0bfb265 ; * test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): Tag unstable. 2023-09-13 16:05:55 -07:00
Stefan Monnier
0065621d0d (report_overlay_modification): Fix bug#65929
Somehow the new overlay code in Emacs-29 changed slightly
the test to decide when to run the `modification-hooks` of overlays,
with the consequence that these hook functions end up being executed
also when text is deleted right after an empty overlay, which is
contrary to Emacs-28 behavior as well as contrary to the Texinfo doc.

* src/buffer.c (report_overlay_modification): Better reproduce the
Emacs-28 code.

* test/src/buffer-tests.el (overlay-modification-hooks):
Add corresponding test.
2023-09-13 18:49:55 -04:00
Damien Cassou
1f7113e689 Shorten docstrings generated by cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of
generated docstrings if either the struct name or a field name is very
long.  This reduces the likelihood of "docstring wider than 80
characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Damien Cassou
f045750fa5 Shorten docstrings generated by cl-defsubst
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of
the docstring into 2 lines if the function name is very long.
Additionally, remove the word "inlining" in the generated docstring as
it is not very useful and increases the likelihood of "docstring wider
than 80 characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Damien Cassou
d436c559a4 bytecomp-tests.el: Add new helper function
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp--without-warning-test): Add helper function.
(bytecomp-warn--ignore): Use the helper.
2023-09-13 16:34:44 +02:00
Jim Porter
f542a4537e ; Improve recent change to printing exit status in Eshell
* lisp/eshell/esh-proc.el (eshell-interactive-filter): Declare.
(eshell-interactive-process-filter): Simplify.
(eshell-sentinel): Call 'eshell-interactive-filter'.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-process/redirect-message): Use
'eshell-with-temp-buffer'.
2023-09-12 18:13:52 -07:00
Jim Porter
a0c8b45820 Be more careful about when to print abnormal exit status in Eshell
* lisp/eshell/esh-proc.el (eshell-sentinel): Only output abnormal
status when stderr is interactive.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/kill-process/redirect-message): New test.
2023-09-12 11:44:27 -07:00
F. Jason Park
617ddb8089 Consider all windows in erc-scrolltobottom-mode
* etc/ERC-NEWS: Add entry for option `erc-scrolltobottom-all', and
mention explicit hook-depth intervals reserved by ERC.
* lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth on
`pre-command-hook' from 91 to 80.
* lisp/erc/erc-goodies.el (erc-input-line-position): Mention secondary
role when new option `erc-scroll-to-bottom-relaxed' is non-nil.
(erc-scrolltobottom-all): New option that decides whether module
`scrolltobottom' affects all windows or just the selected one, as it
always has.
(erc-scrolltobottom-relaxed): New option to leave the prompt
stationary instead of forcing it to the bottom of the window.
(erc-scrolltobottom-mode, erc-scrolltobottom-enable,
erc-scrolltobottom-disable): Use `erc--scrolltobottom-setup' instead
of `erc-add-scroll-to-bottom' for adding and removing local hooks and
instead of ranging over buffers when removing them.  Also add and
remove new hook members when `erc-scrolltobottom-all' is non-nil.
(erc--scrolltobottom-relaxed-commands,
erc--scrolltobottom-window-info,
erc--scrolltobottom-post-force-commands,
erc--scrolltobottom-relaxed-skip-commands): New internal variables.
(erc--scrolltobottom-on-pre-command
erc--scrolltobottom-on-post-command): New functions resembling
`erc-possibly-scroll-to-bottom' that try to avoid scrolling repeatedly
for no reason.
(erc--scrolltobottom-on-pre-command-relaxed,
erc--scrolltobottom-on-post-command-relaxed): New commands to help
implement `erc-scroll-to-bottom-relaxed'.
(erc--scrolltobottom-at-prompt-minibuffer-active): New function to
scroll to bottom on window configuration changes when using the
minibuffer.
(erc--scrolltobottom-all): New function to scroll all windows
displaying the current buffer.
(erc-add-scroll-to-bottom): Deprecate this function because it is now
unused in the default client and trivial to implement otherwise.
(erc--scrolltobottom-setup): New generic function to perform teardown
as well as setup depending on the state of the module's mode variable.
Also add an implementation specifically for `erc-scrolltobottom-all'
that locally modifies different sets of hooks depending on
`erc-scrolltobottom-relaxed'.
(erc--scrolltobottom-on-pre-insert): New generic function that
remembers the last `window-start' and maybe the current screen line
before inserting a message, in order to restore it afterward.
(erc--scrolltobottom-confirm): New function, a replacement for
`erc-scroll-to-bottom' that returns non-nil when it's actually
recentered the window.  For now, used only when
`erc-scrolltobottom-all' is enabled.
(erc-move-to-prompt-setup): Add `erc-move-to-prompt' to
`pre-command-hook' at a depth of 70 in the current buffer.
(erc-keep-place-mode, erc-keep-place-enable): Change hook depth from 0
to 85.
(erc--keep-place-indicator-setup): Add overlay arrow `after-string' in
non-graphical settings in case users have time stamps or other content
occupying the left margin.
(erc-keep-place-indicator-mode, erc-keep-place-indicator-enable):
Change hook depth from 90 to 85 locally so as not to conflict with a
value of t, for append.
(erc--keep-place-indicator-on-global-module): Change hook depth from
90 to 85 locally.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el: New file.
* test/lisp/erc/erc-scenarios-scrolltobottom.el: New file.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--term-size, erc-scenarios-common--run-in-term,
erc-scenarios-common-interactive-debug-term-p,
erc-scenarios-common-with-noninteractive-in-term): New test macro and
supporting helper function and variables to facilitate running
scenario-based tests in an inferior Emacs, in term-mode.
(erc-scenarios-common--at-win-end-p,
erc-scenarios-common--above-win-end-p,
erc-scenarios-common--prompt-past-win-end-p,
erc-scenarios-common--recenter-top-bottom-around,
erc-scenarios-common--recenter-top-bottom,
erc-scenarios-scrolltobottom--normal): New test fixture and assertion
helper functions.
* test/lisp/erc/resources/scrolltobottom/help.eld: New file.
(Bug#64855)
2023-09-10 17:58:20 -07:00
F. Jason Park
7c932fa307 Add optional timezone param to erc-echo-timestamp
* etc/ERC-NEWS: Move `erc-echo-timestamp' from misc section
to own entry, and mention option `erc-echo-timestamp-zone'.
* lisp/erc/erc-stamp.el (erc-echo-timestamps): Mention that some
finagling is required if enabling this option after activating the
module.
(erc-echo-timestamp-format): Add additional Custom choice constants
and make the existing default one of them.
(erc-echo-timestamp-zone): New option to specify timezone for option
`erc-echo-timestamps' and function `erc-echo-timestamp'.
(erc-stamp-mode, erc-stamp-enable, erc-stamp-disable): Call
`erc-stamp--setup' instead of `erc-munge-invisibility-spec'.
(erc-stamp--current-time): Use `current-time' instead of
`erc-current-time'.
(erc-add-timestamp): Improve readability slightly, and change
`fboundp' to `functionp' to avoid signaling an error when the
variable's value is not a symbol.
(erc-munge-invisibility-spec): Perform teardown when boolean flag
options, like `erc-timestamp-intangible' and `erc-echo-timestamps' are
nil.
(erc-stamp--setup): Call `erc-munge-invisibility-spec', possibly
binding timestamp options to nil to force a tear down).
(erc-stamp--last-stamp, erc-stamp--on-clear-message): New function and
helper state variable to tell Emacs not to clear the current timestamp
message when navigating within the same IRC message.
(erc-echo-timestamp): Add optional `zone' parameter, to be passed
directly to `format-time-string', when non-interactive, and massaged
sensibly otherwise.  Set the local variable `erc-stamp--last-stamp'.
* test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): New test.
(Bug#60936)
2023-09-10 17:58:20 -07:00
F. Jason Park
e1b8dbe9ea ; Allow alternate ert-info text in ERC test utility
* test/lisp/erc/erc-tests.el
(erc-tests--assert-printed-in-subprocess): Don't insist that arguments
to the Emacs "-load" invocation option be actual disk files.
* test/lisp/erc/resources/erc-d/erc-d-t.el
(erc-d-t--wait-message-prefix, erc-d-t-wait-for, erc-d-t-ensure-for):
Add and use new variable to make `ert-info' message prefix adjustable.
The immediate use for this is to make it easier to distinguish between
consecutive assertions in which the first waits for a condition and
the second ensures it holds for some duration.
* test/lisp/erc/resources/erc-d/erc-d-u.el
(erc-d-u--read-exchange-default): Skip killed buffers.
* test/lisp/erc/resources/erc-d/erc-d.el: Typo.
* test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bouncer-history/foonet.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/again.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/foisted.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/refoisted.eld: Timeouts.
* test/lisp/erc/resources/base/flood/soju.eld: Timeouts.
* test/lisp/erc/resources/base/netid/bouncer/barnet.eld: Timeouts.
* test/lisp/erc/resources/base/netid/bouncer/foonet.eld: Timeouts.
* test/lisp/erc/resources/base/reconnect/aborted-dupe.eld: Timeouts.
* test/lisp/erc/resources/base/reconnect/aborted.eld: Timeouts.
* test/lisp/erc/resources/base/renick/self/qual-chester.eld: Timeouts.
* test/lisp/erc/resources/base/renick/self/qual-tester.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/dynamic-barnet.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/linger.eld: Timeouts.
* test/lisp/erc/resources/join/legacy/foonet.eld: Timeouts.
2023-09-10 17:58:20 -07:00
F. Jason Park
c96a626dce Allow login to contain NUH delimiters in erc-parse-user
* lisp/erc/erc.el (erc--parse-user-regexp-legacy,
erc--parse-user-regexp-pedantic): New constants.  The first is the
original pattern that matches across line endings.  The second
disallows multiline strings and interprets excess delimiting
characters as part of the middle, "user" component as per RFC1459.
The latter distinction is largely academic because most servers reject
such logins anyway, but bridges to other protocols and future
extensions may need to exploit this for novel uses.
(erc--parse-user-regexp): New variable, currently set to
`erc--parse-user-regexp-legacy'.
(erc-parse-user): Keep original pattern as default, but do so
indirectly via `erc--parse-user-regexp'.
* test/lisp/erc/erc-tests.el (erc-parse-user): New test.
2023-09-10 17:58:20 -07:00
Jim Porter
2ec41c174f Wait for all processes in a pipeline before resuming an Eshell command
Previously, we only waited until the tail process was finished, but
now, we wait for all of them.  This is more consistent with other
shells, and prevents some cases of a process's output coming *after*
we continued past its pipeline.

* lisp/eshell/esh-cmd.el (eshell-resume-command): Simplify
conditionals, and check that all the foreground processes are dead
before resuming Eshell command.

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/pipeline-wait/multi-proc): New test.
2023-09-10 10:38:25 -07:00
Jim Porter
e554ee0b5f ; Move some Eshell tests to more-topical files
eshell-tests.el should mainly be for code in eshell.el.

* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc)
(eshell-test/pipe-tailproc, eshell-test/pipe-subcommand)
(eshell-test/pipe-subcommand-with-pipe)
(eshell-test/subcommand-reset-in-pipeline)
(eshell-test/lisp-reset-in-pipeline): Move to...
* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/pipeline-wait/head-proc)
(esh-cmd-test/pipeline-wait/tail-proc)
(esh-cmd-test/pipeline-wait/subcommand)
(esh-cmd-test/pipeline-wait/subcommand-with-pipe)
(esh-cmd-test/reset-in-pipeline/subcommand)
(esh-cmd-test/reset-in-pipeline/lisp): ... here.

* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc-stdin):
Move to...
* test/lisp/eshell/esh-io-tests.el
(esh-io-test/pipeline/stdin-to-head): ... here.
2023-09-10 10:38:25 -07:00
Mattias Engdegård
b6032f0fe4 ; Suppress relint complaint in test
* test/src/regex-emacs-tests.el
(regex-tests-mutual-exclusive-inf-rec): This isn't supposed to be a
good regexp.
2023-09-10 15:15:12 +02:00
Felix Dietrich
4101464b47 Make ‘mailcap-viewer-passes-test’ return t for viewers without tests
* lisp/net/mailcap.el (mailcap-viewer-passes-test):
Make ‘mailcap-viewer-passes-test’ follow its docstring and return t
for viewers without a test.  (Bug#65224)
* test/lisp/net/mailcap-tests.el
(mailcap-viewer-passes-test-w/o-test-returns-t): New test.
2023-09-10 08:16:22 +02:00
Mattias Engdegård
c137b5195b Add byte-compiler warning about useless trailing cond clauses
Warn about clauses after the default clause, as in

    (cond ((= x 0) (say "none"))
          (t (say "some"))
          (say "goodbye"))

because they are very much an indicator of a mistake (such as
misplaced brackets), and since they are deleted by the optimiser, any
other warnings there are lost and the user wouldn't know that
something is wrong otherwise.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Add warning.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
2023-09-09 13:24:31 +02:00
Mattias Engdegård
176b7dad71 Don't cache warnings between bytecode compilation tests
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--with-fresh-warnings): New macro.
(test-byte-comp-compile-and-load, bytecomp--with-warning-test):
Use it.
2023-09-09 13:24:30 +02:00
Eli Zaretskii
9d27b95b26 Merge from origin/emacs-29
b8a8106fa1 ; Add missing space in the manual
5b906b6215 Fix defcustom :type of ielm-indirect-setup-hook
82af484ec1 ; Two updates of etc/TODO
0ab2823f51 ; Describe in PROBLEMS 2 problems with keyboard input
4e7112ab21 ; Fix inaccuracy in ELisp reference manual
34bbb6c8d2 Document NonGNU ELPA in FAQ
2af092741e Fix remote path setting in Eshell
4613575d97 ; * lisp/completion.el (dynamic-completion-mode): Fix las...
2f0f33fbf9 Update docs for (co-)maintainer changes
b068fcd4a3 * doc/lispref/strings.texi (Text Comparison): Fix typo (b...
2e2a5f8118 Adapt Tramp manual
d32f00a35b Improve docstring of message-sendmail-envelope-from
1a668cda8b Unbreak builds with CHECK_STRUCTS.
77b6e9bb17 Improve documentation of EPG
d3382f9471 ; * lisp/completion.el (dynamic-completion-mode): Doc fix.
1458daf316 Avoid crashes on macOS with context menus

# Conflicts:
#	src/pdumper.c
2023-09-09 04:33:47 -04:00
Eli Zaretskii
0273914921 Merge from origin/emacs-29
bc56da92d8 ; Fix error in 'tex-recenter-output-buffer'
d17c5adc05 Fix regexp for recognizing PBM images
9e9f61866e Improve wording in ELisp manual
7427efa033 Fix typo (Bug#65764)
59c6624408 ; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#6...
4ec4b18c2a Fix libgccjit build on Haiku
80bdcf8f35 (regexp-tests-backtrack-optimization): Mark it as failing
8a9e653cc8 ; Add regression test for bug#65726
6fad73d7cc * src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop ...
1d3d419607 ; * lisp/files.el (save-some-buffers-functions): Doc fix ...
42b14c6e5b Bump seq version to 2.24
ff5190a174 Add note on ELPA to admin/notes/bug-triage
f1e4cbe72a ; * etc/PROBLEMS: Minor wording fix.
fd5593c7f2 * etc/PROBLEMS: Mention bug#65432 and its remedy.
dd896ea1e6 Ignore errors when checking for object initializers (bug#...
3550f44c17 ; Fix typos
5b246b9b81 * CONTRIBUTE: Document making ChangeLogs with Magit.
0bd4661941 Doc fixes for obsolete functions and variables
524c0c34f2 ; * lisp/ffap.el (ffap-rfs-regexp): Fix :type (bug#65698).
f48dccc467 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
71a85e2266 A revision to the Widget manual
dbbcf4a659 Fix fontification of " in edit-kbd-macro

# Conflicts:
#	test/src/regex-emacs-tests.el
2023-09-09 04:32:45 -04:00
Jim Porter
09840a8a2f ; Fix last change
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Make sure we have no *new*
processes, instead of making sure we have no processes at all.
2023-09-08 22:24:06 -07:00
Jim Porter
1bf036bf3f ; Fix name of an Eshell test
* test/lisp/eshell/esh-proc-tests.el
(esh-var-test/output/remote-redirect): Rename to...
(esh-proc-test/output/remote-redirect): ... this.
2023-09-08 21:08:57 -07:00
Stefan Kangas
802a54ad62 Error when trying to make nil or t obsolete
* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Signal error if the symbol to make obsolete is nil or t.  (Bug#62248)
(byte-run--constant-obsolete-warning): New function.
* test/lisp/emacs-lisp/byte-run-tests.el: New file.
2023-09-08 01:01:16 +02:00
Jim Porter
2af092741e Fix remote path setting in Eshell
This ensures that we supply Tramp with the local PATH so that it can
do its job of starting the local "ssh", or whatever the method uses
(bug#65551).

* lisp/eshell/esh-proc.el (eshell-gather-process-output): Add special
handling for remote processes.

* test/lisp/eshell/esh-proc-tests.el
(esh-var-test/remote/remote-path): New test.
2023-09-07 10:23:48 -07:00
Mauro Aranda
2a8f458719 Fix perl-mode indentation after a hanging paren
* lisp/progmodes/perl-mode.el (perl-hanging-paren-p): Allow
comments.  (Bug#34245)
* test/lisp/progmodes/perl-mode-tests.el (perl-test-bug-34245): New
test.
2023-09-07 00:13:53 +02:00
Dmitry Gutov
62229fb2d1 (project-try-vc): When found non-VC project root, still search for the backend
* lisp/progmodes/project.el (project-try-vc): When finding a
non-VC project root, still try to search for the containing
responsible VC backend, if any (bug#65704).
2023-09-06 23:30:42 +03:00
Stefan Kangas
7055e47cde ; Silence byte-compiler
* test/lisp/emacs-lisp/cl-lib-tests.el (old-struct)
(cl-lib-old-struct):
* test/lisp/progmodes/eglot-tests.el
(eglot-test-rust-analyzer-watches-files)
(eglot-test-capabilities, eglot-test-path-to-uri-windows):
Silence byte-compiler.
2023-09-06 14:15:00 +02:00
Spencer Baugh
03ac16ece4 Correctly handle common prefixes in substring completion
Substring completion would previously not complete the longest common
substring if that substring was a prefix of all the completion
alternatives.  Now it does.  An explanation of this bug

Substring completion is implemented by passing the `prefix' symbol as
part of the pattern passed to completion-pcm--merge-completions.  This
symbol is supposed to cause completion-pcm--merge-completions to
"grow" a completion of a common substring only from the "right" of the
symbol (a common suffix), not from the "left" of the symbol (a common
prefix).  Yes, this is the opposite of what the name `prefix' would
imply.

When processing a symbolic element of the pattern,
completion-pcm--merge-completions first finds the common prefix of all
the completions in that part of the pattern (using try-completion).
Then for `prefix' and other elements which want to complete a common
suffix, the common prefix is removed from each element and then the
common suffix is calculated with completion--common-suffix.

If the common prefix covers the entirety of all the alternatives
(i.e. when "unique" is true in the code), it's also a common suffix.
In that case, the common suffix calculation (if it runs) is basically
a no-op which will produce an empty string, since we removed the
common prefix before running it.

Before this change, `prefix' elements would unconditionally discard
the common prefix, which produced the wrong result in the case that
common prefix == common suffix.  For example:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b")

Now we detect this situation and include the common prefix in this
case for `prefix' elements.  Then we get:

  (completion-pcm--merge-completions '("ab" "ab") '(prefix "b"))
  -> ("b" "a")

which is correct.

* lisp/minibuffer.el (completion-pcm--merge-completions): Don't ignore
a common suffix in a `prefix' pattern element when it's also a common
prefix.
* test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a
test.
2023-09-05 17:16:57 -04:00
Stefan Monnier
80bdcf8f35 (regexp-tests-backtrack-optimization): Mark it as failing
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
The fix for bug#65726 broke some of the optimization added for bug#61514.
2023-09-05 10:54:25 -04:00