* lisp/progmodes/perl-mode.el (perl--format-regexp): New defconst.
(perl--end-of-format-p): New function.
(perl-continuation-line-p): Use it.
(perl-calculate-indent): Use it. Make the lines of the formlist stay
at column 0.
* test/lisp/progmodes/cperl-mode-resources/cperl-bug-35925.pl: New
test file.
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-35925): New
test.
* lisp/progmodes/lua-ts-mode.el (lua-ts--font-lock-settings):
Identify functions and assignments in more places. Use constant
face for goto/labels. (Bug#66162)
4776d90c31 Add new Tramp test
ca5b48fd76 Fix tmm-mid-prompt :type (Bug#66179)
7447d3df94 Fix tree-sitter indentation conflict with multiple languages
bee18e5273 Fix bug#66093 in Tramp
7d5fee0fea Support regeneration of ja-dic.el under '--with-small-ja-...
Conflicts:
make-dist
I.e. commit the needed change to the test suite.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-ellipsis-string): Bind cl-print-string-length.
Only bind print-length and print-level where they are
specifically needed.
After testing and checking that the changes brought by the new
consolidated analysis function (which are all cases of improved
optimizations) are indeed safe, remove the old code.
* src/regex-emacs.c (analyze_first_old): Delete function.
(analyze_first): Don't call it any more.
(skip_noops): Delete function.
(mutually_exclusive_aux): Delete function.
(mutually_exclusive_p): Don't call it any more.
We currently have two functions that analyze the bytecode
to try and apply optimizations: `analyze_first` and `mutually_exclusive_p`.
Extract the common code between them into a new function `forall_firstchar`,
and then rewrite the old ones on top of that one.
Along the way, we get slightly better analyses that reverts
the recent de-optimizations but without re-introducing the
corresponding bugs.
* src/regex-emacs.c (forall_firstchar_1, forall_firstchar): New functions.
(analyze_first_old): Rename from `analyze_first`.
(struct anafirst_data): New struct.
(analyze_first_fastmap, analyze_first_null): New functions.
(analyze_first): Rewrite to use `forall_firstchar` with those two functions.
Take a `bufp` rather than a `multibyte` arg.
(regex_compile, re_compile_fastmap): Adjust calls accordingly.
(struct mutexcl_data): New struct.
(mutually_exclusive_one): New function.
(mutually_exclusive_p): Rewrite to use `forall_firstchar` with that function.
* src/regex-emacs.c (extract_address): New function.
(skip_noops, mutually_exclusive_aux, re_match_2_internal): Use it.
(regex_compile): Fix oversight in last commit.
(analyze_first): Return a bool rather than an int.
(re_compile_fastmap): Simplify accordingly.
(re_match_2_internal): Share the common code between the fail and
success exit paths.
This provides a fairly primitive but handy way to see what
a regexp compiles to without having to enable REGEX_EMACS_DEBUG
and wade through tons of stderr output.
* doc/lispref/searching.texi (Regexp Problems): Mention
`re--describe-compiled`.
* src/regex-emacs.c (debug_putchar, print_fastmap)
(print_partial_compiled_pattern, print_compiled_pattern): Add `dest`
argument, and compile also when `ENABLE_CHECKING` is set.
(DEBUG_PRINT_COMPILED_PATTERN, print_double_string, regex_compile):
Adjust to additional argument.
* src/regex-emacs.h (print_compiled_pattern): Declare.
* src/search.c (Fre__describe_compiled): New function.
(syms_of_search): Defsubr it.
This fixes bug#65680, by introducing a new variable limiting
the length of a printed string, rather than abusing
print-length for that purpose.
* lisp/emacs-lisp/cl-print.el (cl-print-string-length): New
variable.
(cl-print-object <string>, cl-print--string-props): Use
cl-print-string-length rather than print-length here.
(cl-print-string-with-limit): bind cl-print-string-length based
on argument `limit'. Decrement it by a quarter at each trial
iteration of printing.
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
Make the code slightly cheaper. It's still dominated by the
huge cost of `byte-compile--wide-docstring-p`, though.
* test/lisp/progmodes/cperl-mode-tests.el: Add a hint to the
commentary that the tests are intended to run on older Emacsen.
(cperl-test-bug-10483): Replace skip-when by skip-unless followed
by a negation.
(cperl-test-bug-37127): Replace skip-when by skip-unless followed
by a negation.
c-forward-sws and c-backward-sws were scanning over spaces and
linefeeds marked with the string-fence syntax-table text
property. Fix this by (i) removing the WS text properties
c-in-sws and c-is-sws from characters when setting the
string-fence on them; (ii) checking the syntax of "space"
characters when scanning over them.
* lisp/progmodes/cc-defs.el (c-skip-ws-chars-forward)
c-skip-ws-chars-backward, c-put-string-fence): New macros.
* lisp/progmodes/cc-awk.el
(c-awk-set-string-regexp-syntax-table-properties): Use
c-put-string-fence.
* lisp/progmodes/cc-engine.el (c-beginning-of-statement-1):
Correct the determination of macro-start.
(c-forward-sws, c-backward-sws): Replace skip-chars-forward by
c-skip-ws-chars-forward and skip-chars-backward by
c-skip-ws-chars-backward.
(c-unmark-<>-around-region, c-after-change-unmark-ml-strings)
(c-propertize-ml-string-opener): Use c-put-string-fence.
* lisp/progmodes/cc-mode.el (c-put-syn-tab): Use
c-put-string-fence when appropriate.
Another case that was too optimistic. Better use \> or \< rather
than \b if you want your regexp to be handled efficiently.
* src/regex-emacs.c (mutually_exclusive_aux) <wordbound>: Cancel optimization.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
New test.
* lisp/ls-lisp.el (ls-lisp-verbosity): Add `modes` on GNU & Unix
(ls-lisp-format): When `modes` is not in `ls-lisp-verbosity',
keep just the 1st character of `drwxrwxrwx`.
* doc/emacs/android.texi (Android Windowing): Document
`android-keyboard-bell-duration'.
* java/org/gnu/emacs/EmacsService.java (ringBell): New argument
DURATION.
* src/android.c (android_init_emacs_service): Adjust
correspondingly.
(android_bell): Provide the duration of the vibration.
* src/androidfns.c (syms_of_androidfns)
<android_keyboard_bell_duration>: New variable.
rather than `buffer-read-only`. Applied throughout the file.
(todo-date-pattern, todo-edit-item--header, todo-convert-legacy-date-time)
(todo-read-date): Remove redundant "" arg to `mapconcat`.
* lisp/dired-aux.el (dired-do-replace-regexp-as-diff): New command.
* lisp/misearch.el (multi-file-diff-unsaved): New user option.
(multi-file-replace-as-diff): New function.
(multi-file-replace-regexp-as-diff): New command.
(replace-regexp-as-diff): New command.
(multi-file-diff-no-select): New function.
The optimization was incorrect in a particular corner case.
In this fix I just disable it conservatively for more cases because
it's not obvious how to fix it while preserving the "good" cases.
We may find a better fix by using an approach like the one
in `mutually_exhaustive_aux`, but for now this is good enough,
especially since \{..\} repetitions are not used very frequently.
* test/src/regex-resources/PTESTS: New test.
The treesit-language-at-point function is only suppose to query the
host language.
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--indent-rules): Add missing rules.
(elixir-ts--treesit-language-at-point): Update function to only query
the host language.
* test/lisp/progmodes/elixir-ts-mode-resources/indent.erts: Add test
for inline docs.
This lets us simplify the logic for how we reset
'eshell-current-command' and 'eshell-last-async-procs', as well as
improving correctness of Eshell command forms in a few esoteric
scenarios. Additionally, this helps set the stage for better support
of background commands in Eshell (bug#66164).
* lisp/eshell/esh-cmd.el (eshell-cmd-initialize): Remove addition to
'eshell-post-command-hook'; this is handled in 'eshell-resume-command'
and 'eshell-resume-eval' now.
(eshell-resume-command): Handle resetting the prompt as needed.
(eshell-resume-eval): Use 'unwind-protect' to ensure that we set
'eshell-last-async-procs' and 'eshell-current-comment' at the right
times.
(eshell-parse-command, eshell-trap-errors, eshell-manipulate): Use
'unwind-protect'.
(eshell-do-eval): Allow 'eshell-defer' to pass through
'unwind-protect' forms without actually calling the unwinding forms
(yet).
* lisp/eshell/esh-proc.el (eshell-kill-process-function)
(eshell-reset-after-proc): Make obsolete. The behavior is now handled
in 'eshell-resume-command'.
(eshell-gather-process-output, eshell-sentinel)
(eshell-interrupt-process, eshell-kill-process, eshell-quit-process)
(eshell-stop-process, eshell-continue-process): Run 'eshell-kill-hook'
directly.
* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/throw): New test.
* src/regex-emacs.c (mutually_exclusive_p): Don't pretend that pattern
position 0 has been checked already.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Add a corresponding regression test plus some other related tests
I had around.