1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00
Commit Graph

169084 Commits

Author SHA1 Message Date
Mauro Aranda
7caa3f5499 Fix indentation in perl-mode (Bug#35925)
* 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.
2023-10-01 04:13:17 +02:00
john muhl
6dd1565fcf Various fixes to lua-ts-mode font-locking
* 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)
2023-10-01 01:17:36 +02:00
Stefan Kangas
42423b6154 Bump buffers-menu-max-size to 15 on graphical displays
* lisp/menu-bar.el (buffers-menu-max-size): Bump default to 15 on
graphical displays.  (Bug#64398)
2023-10-01 01:08:17 +02:00
Stefan Kangas
820deac94b ; Add missing GNU ELPA :core package statements
* lisp/bind-key.el:
* lisp/emacs-lisp/map.el:
* lisp/erc/erc.el:
* lisp/external-completion.el:
* lisp/net/ntlm.el:
* lisp/net/soap-client.el:
* lisp/progmodes/python.el:
* lisp/svg.el:
* lisp/use-package/use-package.el: Add GNU ELPA :core package
statements.
2023-10-01 00:09:05 +02:00
Eli Zaretskii
4ca131b7f5 Merge etc/NEWS from origin/emacs-29 2023-09-30 13:54:42 -04:00
Eli Zaretskii
46978fa1ef Merge from origin/emacs-29
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
2023-09-30 13:50:07 -04:00
Eli Zaretskii
e6dd64aaba ; * lisp/progmodes/elixir-ts-mode.el (treesit-node-p): Declare. 2023-09-30 20:39:09 +03:00
Eli Zaretskii
fcd0bb295a ; * src/regex-emacs.c (forall_firstchar_1): Fix compilation error. 2023-09-30 20:16:40 +03:00
Alan Mackenzie
c55e22c418 Complete yesterday's commit for cl-print.el
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.
2023-09-30 14:32:50 +00:00
Stefan Monnier
63ddbcc022 Merge remote-tracking branch 'refs/remotes/origin/master' 2023-09-30 09:42:02 -04:00
Stefan Monnier
f7fd21b068 * configure.ca (open_memstream): New checked function 2023-09-30 09:41:35 -04:00
Po Lu
8db48d247b Eschew non-portable constructs in configure.ac
* configure.ac (gl_gcc_warnings): Delete `test -o' and simplify
long test condition correspondingly.
2023-09-30 19:39:54 +08:00
Mattias Engdegård
ec6e7f7c01 ; Make configure work on Solaris after last change
* configure.ac: Solaris /bin/sh doesn't have `test -e`.
2023-09-30 11:11:12 +02:00
Po Lu
cdc653d68f Update Android port
* src/androidmenu.c (android_menu_show): Properly encode pane
names before deriving Java strings from them.

* src/sfntfont.c (sfnt_parse_style, sfntfont_list_1): Intern
adstyles.
2023-09-30 15:40:21 +08:00
Gerd Möllmann
9a3523e7d8 ; Fix a glob in .clangd 2023-09-30 07:41:19 +02:00
Po Lu
64c58011b7 Fix last change
* src/search.c (Fre__describe_compiled): Correct typos and
pointer signedness missmatch.
2023-09-30 08:30:59 +08:00
Stefan Monnier
168cc0aff0 regex.c: Remove the old analyzes functions
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.
2023-09-29 17:46:20 -04:00
Stefan Monnier
e61a039843 regex.c: Consolidate the two analysis functions
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.
2023-09-29 17:39:10 -04:00
Stefan Monnier
6e44d6e184 regex.c: Various cosmetic changes
* 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.
2023-09-29 16:45:41 -04:00
Stefan Monnier
35fbf6f158 * src/regex-emacs.c (STORE_NUMBER): Make it a plain function 2023-09-29 15:22:06 -04:00
Stefan Monnier
cc0d7d7a38 search.c (re--describe-compiled): New function (bug#66261)
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.
2023-09-29 14:55:24 -04:00
Alan Mackenzie
01229fe009 Stop truncating strings too much in cl-print-string-with-limit
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.
2023-09-29 16:14:04 +00:00
Mattias Engdegård
6e4432673c Small clean-up of byte-compile-docstring-style-warn
* 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.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
5959a28cce Include all in byte-compile-warnings defcustom type
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings):
Let "All" mean `all`, not `t`.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
a89c86888c Detect developer builds in git worktrees as well
* configure.ac (gcc-warnings): Don't require .git to be a directory.
If you wondered why you didn't get any warnings, this may have been
the reason.
2023-09-29 17:59:50 +02:00
Harald Jörg
f13c4f1562 ; cperl-mode-tests.el: Avoid using skip-when
* 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.
2023-09-29 16:46:23 +02:00
Alan Mackenzie
688c893b18 CC Mode: Fix bug in whitespace scanning functions
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.
2023-09-29 12:07:32 +00:00
Stefan Kangas
309554edb4 ; Mention 64-bit first in FAQ on large files
* doc/misc/efaq.texi (Problems with very large files): Mention
64-bit machines before 32-bit ones, as they are more common.
2023-09-28 21:44:10 +02:00
Eshel Yaron
8a635ac849 ; Substitute quotes in obsoletion notice in 'C-h f'
* lisp/help-fns.el (help-fns--obsolete): Substitute quotes in string
arguments to 'obsolete' declarations.

* lisp/emacs-lisp/advice.el (defadvice): Markup symbols in 'obsolete'
declaration.  (Bug#66240)
2023-09-28 21:44:09 +02:00
Stefan Kangas
cf4778a136 Simplify alist lookups in align-region
* lisp/align.el (align-region): Simplify alist lookup caching.
2023-09-28 21:44:09 +02:00
Juri Linkov
9cf1fc49e8 * lisp/tab-line.el: Move Touch screen support section to the better place. 2023-09-28 20:13:22 +03:00
Stefan Monnier
7c26501175 regex.c (mutually_exclusive_aux) <wordbound>: Remove optimization
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.
2023-09-28 12:37:44 -04:00
Juri Linkov
0c15c7d946 ; * etc/NEWS: Demote outline 'describe-bindings-outline-rules' under Help.
* lisp/menu-bar.el (kill-this-buffer): Fix typo in comments.
2023-09-28 09:53:55 +03:00
Juri Linkov
3b831fe0f4 Unquote #'project-uniquify-dirname-transform in uniquify-dirname-transform.
* lisp/uniquify.el (uniquify-dirname-transform): Use , on #'.
2023-09-28 09:48:51 +03:00
Yuan Fu
5ad8db88df
; * admin/notes/tree-sitter/performance (Experiments): Update. 2023-09-27 23:42:32 -07:00
Yuan Fu
e881a172d4
; * lisp/treesit.el (treesit--read-major-mode): Use string-suffix-p. 2023-09-27 21:52:59 -07:00
Sam Steingold
83e0442139 There are no file modes on windows and dos
* 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`.
2023-09-27 22:33:47 -04:00
Po Lu
7b43d70c73 Update Android port
* 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.
2023-09-28 08:46:35 +08:00
Stefan Monnier
dc2199de3e * lisp/calendar/todo-mode.el: Let-bind inhibit-read-only
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`.
2023-09-27 18:52:00 -04:00
Juri Linkov
d813f71ffe * lisp/vc/diff-mode.el (diff-apply-buffer): New command (bug#66113).
(diff-mode-map): Bind 'diff-apply-buffer' to 'C-c C-m a'.
2023-09-27 20:39:33 +03:00
Juri Linkov
2d25f071b6 New commands to show replacements as diffs (bug#65854)
* 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.
2023-09-27 20:39:32 +03:00
Stefan Monnier
bc52fdd1d1 * src/regex-emacs.c (analyze_first): Fix incorrect optimization
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.
2023-09-27 13:29:50 -04:00
Mattias Engdegård
9a67540e51 ; * test/src/regex-emacs-tests.el: suppress relint complaints 2023-09-27 12:45:43 +02:00
Alan Mackenzie
6956382033 Revert "Don't use ellipses while cl-printing strings."
This reverts commit 761f8901ff.
2023-09-27 09:54:33 +00:00
Yuan Fu
a3a840c80a
Don't call font-lock-mode in treesit-major-mode-setup (bug#66223)
* lisp/treesit.el (treesit-major-mode-setup): Remove.
2023-09-27 00:21:40 -07:00
Wilhelm H Kirschbaum
1f850d8d7b
Fix treesit-langauge-at-point for elixir-ts-mode.
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.
2023-09-26 23:23:54 -07:00
Yuan Fu
07ede5e92a
; * lisp/treesit.el (treesit-language-at-point-function): Fix doc. 2023-09-26 23:23:53 -07:00
Yuan Fu
6490af559f
Extract feature list of java-ts-mode to a variable
* lisp/progmodes/java-ts-mode.el:
(java-ts-mode--feature-list): New variable.
(java-ts-mode): Extract out.
2023-09-26 23:23:53 -07:00
Jim Porter
eef32d13da Use 'unwind-protect' in more places in Eshell
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.
2023-09-26 12:29:52 -07:00
Stefan Monnier
e88be844bf regex.c (mutually_exclusive_p): Fix initial value of loop_beg
* 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.
2023-09-26 11:43:51 -04:00