1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-20 21:11:18 -07:00
Commit graph

178241 commits

Author SHA1 Message Date
Juri Linkov
cd557d6f64 Improve elixir-ts--thing-settings.
* lisp/progmodes/elixir-ts-mode.el (elixir-ts--thing-settings):
Add extra grouping "keywords" to named sexp nodes.
Add "," to anonymous sexp nodes.  Use bos/eos.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Use bos/eos for anonymous sexp nodes for better disambiguation.

* test/lisp/progmodes/heex-ts-mode-tests.el
(heex-ts-mode-test-indentation): Skip the test when 'elixir' is
missing since 'heex-ts-mode' depends on the 'elixir' grammar.
2025-05-01 21:03:34 +03:00
Juri Linkov
5684a38086 Avoid adding duplicate items to 'treesit-language-source-alist'.
* lisp/textmodes/mhtml-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
Use 'add-to-list' on items in language-source-alist
that should check for duplicate items.

* test/infra/Dockerfile.emba: Move multi-language mhtml-ts-mode and
php-ts-mode to the end to give their dependent grammars a lower priority.

* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
Skip the test when 'jsdoc' is missing since 'js-ts-mode' depends
on the 'jsdoc' grammar.
2025-05-01 20:55:33 +03:00
Stefan Monnier
311ea96ccf register.el (register--jumpable-p): Fix bug#78186
While `register--get-method-type` worked fine for `register-val-insert`
it always returns nil for `register-val-jump-to` because it presumed the
method took a single argument.  Make it work for multi-arg generic functions.

* lisp/register.el (register--get-method-type): Add `other-args-type` arg.
(register--jumpable-p): Use it.
2025-05-01 12:38:33 -04:00
Alan Mackenzie
8ddb8b0e45 Implement C23 features:
Improve the handling of #error and #warning in C and C++ Modes.

* lisp/progmodes/cc-engine.el (c-looking-at-c++-attribute)
(c-enclosing-c++-attribute, c-forward-sws, c-backward-sws):
Handle attributes in C as they have been handled in C++.
(c-forward-align-clause-throw-if-invalid): New macro.
(c-forward-type): Handle alignas, alignof, and _BitInt, putting
a catch block around most of the function to catch invalid uses
of these new keywords.
(c-in-id-arglist): New function.
(c-forward-decl-or-cast-1): Recognize a "maybe" type identifier
as a type in arglists when there is no parameter identifier
associated with it.

* lisp/progmodes/cc-fonts.el (c-font-lock-cpp-messages): New
function.
(c-cpp-matchers): Move the handling of "invalid" comment
delimiters outside of the block handling CPP directives.
Remove the inline handling of #error and #warning, using the
new function c-font-lock-cpp-messages instead.
(c-get-fontification-context): Handle alignof, alignas,
_BitInt.
(c-font-lock-declarations): Adapt fontification of K&R
parameters to the C23 nameless parameter scheme.

* lisp/progmodes/cc-langs.el (c-has-quoted-numbers)
(c-stmt-boundary-skip-chars)
(c-recognize-post-brace-list-type-p, c-modifier-kwds)
(c-constant-kwds): Handle C the same as the existing C++
handling.
(c-cpp-message-directives-re, noncontinued-line-end)
(c-cpp-messages-re, c-cpp-message-match-no): New
c-lang-consts/vars.
(c-cpp-include-directives): New directive embed.
(c-cpp-expr-directives): New directives elifdef, elifndef.
(c-primitive-type-kwds): New types, _Decimal*, bool, char*_t,
nullptr_t.
(c-typeof-kwds): New keyword typeof_unqual.
(c-type-with-paren-kwds, c-type-with-paren-key): New
c-lang-const/vars.
(c-type-modifier-with-parens-kwds)
(c-type-modifier-with-parens-key, c-type-internal-paren-kwds)
(c-type-internal-paren-key): New c-lang-const/vars.
(c-type-modifier-prefix-kwds, c-type-start-kwds): Amend with
the above new c-lang-consts.
(c-no-type-with-equals-kwds, c-no-type-with-equals-key): New
c-lang-const/vars.
(c-modifier-kwds): Add constexpr, auto, and thread_local to the
C value.
(c-paren-nontype-kwds): Add static_assert to the C value.
(c-constant-kwds): Add nullptr to the C value.
(c-regular-keywords-regexp): Include c-type-with-paren-kwds.
(c-recognize-nameless-type-decls): New c-lang-const/var.

* lisp/progmodes/cc-mode.el (c-leave-cc-mode-mode): Also clear
c-digit-separator properties.
2025-05-01 16:12:18 +00:00
Michael Albinus
b589fa9e23 ; Fix last change 2025-05-01 16:49:35 +02:00
Eli Zaretskii
75870a7ad1 ; Fix wording of recently added documentation
* lisp/window.el (display-buffer):
* doc/lispref/windows.texi (Buffer Display Action Alists): Fix wording.
2025-05-01 17:42:12 +03:00
Eli Zaretskii
5cdcebc2ad ; Fix sectioning of recent changes in the Emacs user manual
* doc/emacs/maintaining.texi (VC-Aware Project Backend):
* doc/emacs/emacs.texi (Top): Fix recent changes.
2025-05-01 17:35:47 +03:00
Sean Whitton
343f0c44f3 New this-command buffer display action alist entry
* lisp/subr.el (buffer-match-p): New this-command cons cell
condition to implement new this-command buffer display action
alist entry (bug#78082).
* lisp/window.el (display-buffer):
* doc/lispref/windows.texi (Buffer Display Action Alists):
* etc/NEWS: Document the new buffer display action alist entry.
2025-05-01 20:56:36 +08:00
Sean Whitton
7ae8607423 ; * lisp/emacs-lisp/package.el (dired-get-marked-files): Declare. 2025-05-01 20:56:36 +08:00
Michael Albinus
ab67f684e9 Improve treesitter tests on emba
* test/infra/Dockerfile.emba (emacs-tree-sitter): Print language
versions.

* test/infra/gitlab-ci.yml (.job-template): Pass ${http_proxy},
${https_proxy} and ${no_proxy} to the docker call.
(.tree-sitter-template): Add some dependencies.
2025-05-01 12:47:44 +02:00
Jostein Kjønigsen
b9632a9049
Fix compilation-mode matches for csharp-mode (bug#78128)
* lisp/progmodes/csharp-mode.el:
(csharp-compilation-re-dotnet-error):
(csharp-compilation-re-dotnet-warning): Ignore leading whitespace.
2025-05-01 00:54:33 -07:00
Jostein Kjønigsen
2964d51c9c
Improve python-ts-mode fontification (bug#78129)
Fontification based on selectors & code-conventions:

- Lambda parameters: variable declarations
- For in statements: variable declarations
- Import statements: variable declerations
- Constants: All upper case alphanumerical identifiers
- Types: CamelCase alphanumerical identifiers
- Enums: Enum-values as constants.

* lisp/progmodes/python.el:
(python--treesit-settings): Improve queries.
2025-05-01 00:54:33 -07:00
Jostein Kjønigsen
6c35ae0827
Improve csharp-ts-mode fontification (bug#78130)
Improves:
- fontification of generic types with namespace-prefixes
- function-call parameters
- variable use in string interpolation
- implicitly typed parameters in lambda-expressions
- index-expressions
- variables used in return-statements
- variables used in binary expressions

* lisp/progmodes/csharp-mode.el:
(csharp-ts-mode--font-lock-settings): Improve queries.
2025-05-01 00:54:32 -07:00
Philip Kaludercic
15e77fe03a
; Fix invalid 'expand-file-name' call from 4226eb2b
* lisp/emacs-lisp/package-vc.el (package-vc--main-file)
(package-vc--unpack-1): Provide a fallback value if the package
specification has no :lisp-dir.
2025-05-01 09:50:12 +02:00
Spencer Baugh
1acb645432 Replace cl-remove-if with seq-remove in minibuffer.el
* lisp/minibuffer.el (completion--file-name-table): Replace
cl-remove-if with seq-remove. (bug#78149)
2025-05-01 08:42:21 +03:00
João Távora
dd5ae0f3ba Eglot: tweak previous change (clear Flymake 'Wait' state)
When we don't have anything to give to Flymake, we still want to
signal we're alive so the mode-line doesn't show a confusing
'Wait'.

* lisp/progmodes/eglot.el (eglot--report-to-flymake): Clear 'Wait'
state.
2025-04-30 22:45:44 +01:00
Philip Kaludercic
d6755ff1e1
Allow selecting what to copy when installing a local package
* lisp/emacs-lisp/package.el (package-unpack, package-dir-info):
Check the marked files if in a Dired buffer, and otherwise
fallback on the previous behaviour or if there was no selection.
(package-install-from-buffer): Document the feature.
* etc/NEWS: Mention the change.

(Bug#78017)
2025-04-30 23:40:16 +02:00
Philip Kaludercic
ef5c7ec499
Improve detection of VC package revisions
* lisp/emacs-lisp/package-vc.el (package-vc-commit): If the
package specification lists a :lisp-dir, use that to search for
Lisp files.
2025-04-30 23:40:16 +02:00
Philip Kaludercic
4226eb2b20
Avoid using symbolic links when installing local VC packages
* lisp/emacs-lisp/package-vc.el (package-vc--main-file): Use
`expand-file-name' to support :lisp-dir entries outside of the
elpa directory.
(package-vc--unpack-1): Same as above.
(package-vc-install-from-checkout): Instead of creating a
symlink to the requested directory, create an empty directory
and use autoload indirections, analogously to checkouts with
Lisp code in a subdirectory.

(Bug#78017)
2025-04-30 23:40:04 +02:00
Philip Kaludercic
b81f937e60
Do a deep-copy when installing a package from a local package
* lisp/emacs-lisp/package.el (package-unpack, package-dir-info):
Call 'directory-files-recursively' with appropriate arguments.

(Bug#78017)
2025-04-30 23:39:38 +02:00
Alan Mackenzie
766adfa8a7 Fix typo in bug#19867 correction (CC Mode indentation bugs)
* lisp/progmodes/cc-align.el (c-lineup-item-after-paren-at-boi):
Replace an erroneous skip-syntax-backward with
skip-chars-backward.
2025-04-30 18:51:37 +00:00
Juri Linkov
b06046edcf Fix the match data in elisp-outline-search.
* lisp/progmodes/elisp-mode.el (elisp-outline-search):
Add 'save-match-data' since 'syntax-ppss' garbles the match data.
2025-04-30 20:34:52 +03:00
Juri Linkov
85cd476a14 * test/infra/Dockerfile.emba: Avoid duplication of tree-sitter data.
Require ts-mode files in order to add their tree-sitter grammar sources
to 'treesit-language-source-alist'.
2025-04-30 20:30:14 +03:00
Juri Linkov
dbd1688237 Add python tree-sitter grammar data to 'treesit-language-source-alist'.
* lisp/progmodes/python.el (python-ts-mode):
Use 'treesit-ensure-installed' when it's fboundp.
2025-04-30 20:28:05 +03:00
Stefan Monnier
ab95809202 Merge branch 'cleanup-register-preview' 2025-04-30 12:31:58 -04:00
Stefan Monnier
1284b6f118 (register-type, register--type): Delete functions
Automatically figure out which regval can be used for insertion
and jump based on the presence of a matching method.

* lisp/register.el (register-type, register--type): Delete functions.
(register--get-method-type, register--jumpable-p)
(register--insertable-p): New functions.
(jump-to-register, insert-register): Use them.
* lisp/frameset.el (register--type): Delete method.
2025-04-30 12:28:35 -04:00
Stefan Monnier
826a831129 (register-preview-1): Delete function
* lisp/register.el (register-preview): Add `pred` arg.
(register-preview-1): Delete function.
(register-read-with-preview-fancy): Use `register-preview` instead.
2025-04-30 12:28:35 -04:00
Stefan Monnier
b2904e064d (register-command-info): Delete function
* lisp/register.el (register-command-info): Delete function.
(register-read-with-preview-fancy): Don't use it any more.
(jump-to-register, increment-register, view-register)
(insert-register, append-to-register, prepend-to-register):
Pass a `pred` arg instead.
2025-04-30 12:28:35 -04:00
Stefan Monnier
c43964d27a (register-type): Change arg to be the "regval"
* lisp/register.el (register-type): Change arg to be the "regval".
(register-read-with-preview-fancy): Adjust call accordingly
2025-04-30 12:28:35 -04:00
Stefan Monnier
0fc6bd5c76 (register-read-with-preview): Add optional pred arg
* lisp/register.el (register--read-with-preview-function):
Improve docstring..
(register--type) <(eql nil)>: New method.
(register-of-type-alist, register-preview-1)
(register--preview-get-defaults): Replace `types` arg with `pred` arg.
(register-read-with-preview, register-read-with-preview-traditional):
Add `pred` arg.
(register-read-with-preview-fancy): Add `pred` arg.
Use it instead of the `types` info returned by `register-command-info`,
when provided.
2025-04-30 12:28:35 -04:00
Stefan Monnier
1143a52738 (register-preview-info): Delete struct type
* lisp/register.el (register-preview-info): Delete struct type.
(register-command-info): Return a list of types, instead.
(register-read-with-preview-fancy): Adjust accordingly.
2025-04-30 12:28:35 -04:00
Stefan Monnier
3044d16b81 (register-preview-info): Delete slot act
* lisp/register.el (register-preview-info): Delete slot `act`.
(register-command-info): Delete arg `:act`.
(register--preview-get-defaults): Rename from
`register--preview-get-defaults` and rewrite with, different args.
(register-read-with-preview-fancy): Use it instead of `act`.
2025-04-30 12:28:35 -04:00
Stefan Monnier
573b377e8c (register-preview-info): Delete slot smatch
Use the `types` slot to carry that info instead.

Replace the list of types `(all)` with `(t)` since `t` is the
usual name of the "supertype of all types".
Use the type `null` to represent the fact that empty registers
can be used.  Allow an empty list of types to stand for
`(t null)`, i.e. any register even empty ones.

* lisp/register.el (register-preview-info): Delete slot `smatch`.
(register-command-info): Delete arg `:smatch`.  Adjust `:types` instead.
Fix the `copy-rectangle-to-register` case, which disallowed using
an empty register.
(register-of-type-alist): Adjust handling of `types` accordingly.
(register-preview-1): Simplify.
(register-read-with-preview-fancy): Use types instead of `smatch`.
Use it also in place of `act`.
2025-04-30 12:28:35 -04:00
Stefan Monnier
215246108e (register-preview-info): Delete msg slot
* lisp/register.el (register-preview-info): Remove `msg` slot.
(register-command-info): Delete `:msg` args.
(register-read-with-preview-fancy): Compute `msg` from the `prompt`.
2025-04-30 12:28:35 -04:00
Stefan Monnier
3bc1c13661 (register-preview-info): Delete noconfirm slot
* lisp/register.el (register-preview-info): Remove `noconfirm` slot.
(register-command-info): Delete `:noconfirm` args.
(register-read-with-preview-fancy): Hardcode the `noconfirm` setting
because it was always exactly the same anyway.
2025-04-30 12:28:35 -04:00
Stefan Monnier
fcaec1ff0d (register-preview-function): Use a single default again
* lisp/register.el (register-preview-function): Revert to Emacs<30 value.
(register-use-preview, register-preview, register-preview-1):
Don't touch it.
(register-preview-default): Merge it with `register-preview-default-1`.
(register--preview-function): Delete function.
2025-04-30 12:28:34 -04:00
Stefan Monnier
44069711e8 (register-read-with-preview-fancy): Fix handling of control chars
The code assumed that the string returned by `register-preview-function`
has the register name as the first char.  This was an
incompatible change which broke packages that set this var,
such as `calculator.el` and others.
Remove this assumption by recording the register names in the
preview buffer on a new `register--name` text property.
While at it, fix a few other problems where control chars were
not pretty printed.

* lisp/register.el (register-preview-1): Remember the raw
register name in the `register--name` text property.
(register-preview-forward-line): Use the
`register--name` text property.
(register--find-preview): New function.
(register-read-with-preview-fancy): Use it.
If the last command inserted more than one char, only keep the first of
the new chars.
Make sure control chars are pretty printed in the minibuffer.
including minibuffer messages.
2025-04-30 12:22:25 -04:00
Stefan Monnier
30b9694f2a register.el: Fix some inconsistencies in the code
* lisp/frameset.el (register-val-jump-to): Fix `:cleanup-frames`.
The code did not obey its documented behavior and matched
against the wrong symbols.

* lisp/register.el (register-command-info) <append-to-register>,
<prepend-to-register>: Remove `number` from the `:types` argument
since those operations fail on numbers.
2025-04-30 11:25:13 -04:00
Stefan Monnier
e760e58019 lisp/register.el: Minor cosmetics
Remove redundant `:group` arguments.
Prefer #' to quote function names.
Fix some markup on symbol names in docstrings.
2025-04-30 11:22:03 -04:00
Eli Zaretskii
cb701f95c6 ; Improve last change
* lisp/international/fontset.el (script-representative-chars):
Improve last change by adding more representative chars.
2025-04-30 16:08:15 +03:00
Werner Lemberg
9c98b6cbd3 Improve support for Avestan, Old Turkic, and Chakma
* lisp/international/fontset.el (script-representative-chars,
  setup-default-fontset): Add support for Avestan, Old Turkic, and Chakma.
2025-04-30 16:05:17 +03:00
Eli Zaretskii
6bb3c6f9e1 Merge from origin/emacs-30
cc5b1a01a2 ; * doc/misc/efaq-w32.texi (Location of init file): Fix a...
6c2aaedfce Fix compilation errors in emacsclient.c with MinGW GCC 15
d56e5ba97e ; * etc/DEBUG: Add link to GCC bug #78685.
80cbd1e31c ; Fix key notation in Introduction to Emacs Lisp
1224e5fd96 ; * lisp/files.el (revert-buffer-restore-functions): Doc ...
79e7eeb329 ; Improve documentation of 'format-time-string'
2838b64fc8 ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix ...
9adb05422e ; Improve obsolescence of 'text-mode-variant'
4858d81848 ; * lisp/files.el (revert-buffer-restore-functions): Doc ...
2a8e223b8d ; Mention early-init file in Emacs FAQ for Windows
14c707b42d ; Isearch: Fix key bindings in docstrings
2025-04-30 07:14:23 -04:00
Eli Zaretskii
cc5b1a01a2 ; * doc/misc/efaq-w32.texi (Location of init file): Fix a typo. 2025-04-30 14:10:25 +03:00
Eli Zaretskii
6c2aaedfce Fix compilation errors in emacsclient.c with MinGW GCC 15
* lib-src/emacsclient.c (set_fg, get_wc): Declare using actual
function signatures.
(w32_give_focus): Cast return value of 'GetProcAddress' to correct
pointer types.  (Bug#78160)
2025-04-30 14:06:44 +03:00
Sean Whitton
606e7b73ba cperl-mode-map: Don't bind C-j
* lisp/progmodes/cperl-mode.el (cperl-mode-map): Don't bind C-j.
The default global mode bindings will DTRT depending on whether
or not electric-indent-mode is on.
2025-04-30 17:28:22 +08:00
Sean Whitton
d56e5ba97e ; * etc/DEBUG: Add link to GCC bug #78685. 2025-04-30 17:12:50 +08:00
Robert Pluim
9b560a54c3 Fix custom type of 'flymake-show-diagnostics-at-end-of-line'
*
lisp/progmodes/flymake.el (flymake-show-diagnostics-at-end-of-line):
Add 'fancy' value to custom type.

* etc/NEWS: "variable" -> "user option".

(Bug#78148)
2025-04-30 10:52:28 +02:00
Eli Zaretskii
80cbd1e31c ; Fix key notation in Introduction to Emacs Lisp
* doc/lispintro/emacs-lisp-intro.texi (Typing Lists)
(Note for Novices): Fix notation of 'M-C-\'.  (Bug#78153)
2025-04-30 09:03:17 +03:00
Stefan Monnier
b1407b41a1 register.el: Remove bogus deftypes and fix associated methods
* lisp/register.el (frame-register, kmacro-register): Remove bogus deftypes.
(register--type) <oclosure>: Fix kmacro method and generalize it to
any OClosure.
(register--type) <frameset-register>: Fix method and move it to ...
* lisp/frameset.el (register--type) <frameset-register>: ... here,
where `frameset-register` is defined.
2025-04-29 16:05:14 -04:00
Eli Zaretskii
1224e5fd96 ; * lisp/files.el (revert-buffer-restore-functions): Doc fix (bug#78124). 2025-04-29 21:28:01 +03:00