1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-22 14:01:47 -07:00
Commit graph

178218 commits

Author SHA1 Message Date
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
Juri Linkov
483762ef2f Use 'file-equal-p' in 'multi-isearch-read-files' (bug#77678).
* lisp/misearch.el (multi-isearch-read-files): Replace 'string-equal'
with 'file-equal-p' that should handle abbreviated file names as well.
2025-04-29 20:14:07 +03:00
Juri Linkov
746a3cb314 Ignore parens in strings for outline headings in emacs-lisp-mode.
* lisp/outline.el (outline-font-lock-keywords): For non-nil
outline-search-function return a lambda that calls the function,
then sets the match data to the end of the line that is equivalent
to adding ".*" in the regexp.  Then search functions don't need to
match ".*" themselves.

* lisp/progmodes/elisp-mode.el (elisp-outline-search):
New function to skip leading parens in strings when searching
for outline headings.
(emacs-lisp-mode): Set buffer-local 'outline-search-function' to
'elisp-outline-search'.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00934.html
2025-04-29 19:55:48 +03:00
Juri Linkov
9d0595d879 Fix invalid search bound in 'search-within-boundaries'.
* lisp/isearch.el (search-within-boundaries): Don't go over BOUND.

* test/lisp/isearch-tests.el (isearch--test-search-within-boundaries):
Test with the BOUND arg as well (bug#78116).
2025-04-29 19:41:44 +03:00
Juri Linkov
6228259952 Respect point when changing direction after isearch scrolling.
* lisp/isearch.el (isearch-repeat): Don't go to isearch-other-end
on changing direction after scrolling (bug#78074).
2025-04-29 19:35:30 +03:00
João Távora
825ea052ad Flymake: promptly delete eol overlay if source overlay changed
In the vast majority of cases, changing the source overlay
invalidates the content of the end-of-line overlay, so best to
delete it asap.

* lisp/progmodes/flymake.el (flymake--delete-overlay): Use
'flymake--eol-ov'
(flymake--highlight-line): Use some overlay modification hooks.
2025-04-29 12:39:52 +01:00
João Távora
7ae275f04c Eglot: improve diagnostic-reporting performance
After a change in the buffer has occured, it is often the case
that Flymake is quicker to ask for diagnostics than the server
is to supply them to us.  If we're still stuck with old outdated
diagnostics, don't forward them to Flymake, even if it eagerly
asks us for them.

* etc/EGLOT-NEWS (Changes in upcoming Eglot): Announce changes.

* lisp/progmodes/eglot.el
(eglot--diagnostics): Rework.
(eglot--report-to-flymake): Also take version.
(eglot-handle-notification textDocument/publishDiagnostics)
(eglot--managed-mode)
(eglot-flymake-backend): Tweak call to eglot--report-to-flymake.
2025-04-29 12:23:06 +01:00
Eli Zaretskii
79e7eeb329 ; Improve documentation of 'format-time-string'
* doc/lispref/os.texi (Time Parsing): Fix documentation of week
numbers for %U, %V and %W.  (Bug#78096)
2025-04-29 11:19:19 +03:00
Eli Zaretskii
2838b64fc8 ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix last change. 2025-04-29 10:47:35 +03:00
Eli Zaretskii
9adb05422e ; Improve obsolescence of 'text-mode-variant'
* lisp/textmodes/text-mode.el (text-mode-variant): Improve
obsolescence announcement text.

* doc/lispref/modes.texi (Example Major Modes): Update example.
(Bug#78125).
2025-04-29 10:09:54 +03:00
Eli Zaretskii
4858d81848 ; * lisp/files.el (revert-buffer-restore-functions): Doc fix. 2025-04-29 09:39:34 +03:00
Yuan Fu
3c47139b8f
Update tree-sitter subroutine in Fsubst_char_in_region
Some explanation: Fsubst_char_in_region used to have a branch,
one branch path calls replace_range, one branch path modifies
the buffer directly.  replace_range already calls
treesit_record_change within it, so we needed to make sure we
only call treesit_record_change in the other branch path.

After I added the call to treesit_record_change, some changes
are made to Fsubst_char_in_region, and the branch was removed.
So no wonder Stefan had the confusion and wrote the FIXME note.

Now that the branch is gone, we can indeed call
treesit_record_change in the end like signal_after_change.

* src/editfns.c (Fsubst_char_in_region): Move to end.
2025-04-28 23:21:36 -07:00
Eli Zaretskii
2a8e223b8d ; Mention early-init file in Emacs FAQ for Windows
* doc/misc/efaq-w32.texi (Location of init file, Init file):
Mention the early-init file.  Suggested by David Hedlund
<davidh@gnu.org>.
2025-04-29 09:05:28 +03:00
Eli Zaretskii
d2c7d8ff67 ; * lisp/cus-edit.el: Fix a typo in a comment. 2025-04-29 08:07:33 +03:00
Po Lu
8970c9589b * lisp/progmodes/grep.el (grep-hello-file): Fix another typo. 2025-04-29 12:54:50 +08:00
Po Lu
ac40a65f75 * lisp/progmodes/grep.el (grep-hello-file): Fix typos. 2025-04-29 12:54:32 +08:00
Sean Whitton
b9886bb206 New log-edit-maybe-show-diff option for log-edit-hook
* lisp/vc/log-edit.el (log-edit-maybe-show-diff): New function.
(log-edit-hook): Add it as an option.
(log-edit-diff-function):
* etc/NEWS: Document it.
2025-04-29 09:40:51 +08:00
Sean Whitton
d44c87ceb6 log-edit-diff-function leaves the diff-mode buffer's window selected
This reverts the following two changesets:

    Author:     Sean Whitton <spwhitton@spwhitton.name>
    AuthorDate: Tue Oct 29 09:40:02 2024 +0800

      Fix window selection after log-edit-show-diff

    Author:     Sean Whitton <spwhitton@spwhitton.name>
    AuthorDate: Tue Apr 8 20:36:42 2025 +0800

      Fix window selection after log-edit-show-diff, again

This also replaces the following changeset:

    Author:     Sean Whitton <spwhitton@spwhitton.name>
    AuthorDate: Tue Oct 29 12:52:20 2024 +0800

      * lisp/vc/log-edit.el (log-edit-diff-function): Document.

* lisp/vc/log-edit.el (log-edit-diff-function): Document that
the function *should* leave the window selected when it returns.
(log-edit-diff-fileset):
* lisp/vc/vc.el (vc-modify-change-comment):
Don't use save-selected-window (bug#77946).
(vc-diff-patch-string):
Call pop-to-buffer, not display-buffer (bug#77946).
2025-04-29 09:20:44 +08:00
Jake Forster
14c707b42d ; Isearch: Fix key bindings in docstrings
* lisp/isearch.el (isearch-allow-motion)
(isearch-motion-changes-direction): Use isearch-mode-map for
commands in docstrings (bug#78118).

Copyright-paperwork-exempt: yes
2025-04-29 09:10:30 +08:00
Po Lu
3279194bf2 Port Grep argument autodetection to Android
* lisp/progmodes/grep.el (grep-hello-file): On Android, copy
sample text to a real directory.
2025-04-29 08:28:19 +08:00
Spencer Baugh
509cbe1c35 Improve env var handling in read-file-name
Fix various bugs, including bug#77718, by rewriting the way file
name completion handles environment variable expansion.  Instead
of using completion-table-with-quoting to manipulate the string
being completed on, simply make the completion table itself
understand substitute-in-file-name.

Tests are updated: partial-completion now preserves unexpanded
environment variables.  However, partial-completion no longer
works across environment variables containing delimiters; that's
an acceptable sacrifice.

* lisp/minibuffer.el (completion--sifn-boundaries): Add.
(completion--file-name-table): Rewrite to use
substitute-in-file-name explicitly. (bug#77718)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Update.
2025-04-28 14:00:27 -04:00
Spencer Baugh
21e340494a Don't escape "." in `prin1' when followed by a letter
Among other users, let-alist widely uses symbols which start with a ".".
Make those symbols print more nicely by tweaking the escaping rules in
print_object to not escape a leading "." followed by a letter.  This is
a conservative change to avoid constraining future lexer changes.

This is a followup to 637dde4aba, which
removed some unnecessary escaping of "." and "?" when printing symbols
in prin1.  (Actually, if we always escaped "?" (which was the case
before 637dde4aba) then "." only ever needs to be escaped when
string_to_number returns non-nil.  So 637dde4aba could have just
dropped the escaping of "." with no other changes, if it didn't also
remove escaping of "?")

* src/print.c (print_object): Don't escape "." as the first
character in a symbol if followed by a letter. (bug#77656).
* test/src/print-tests.el (test-dots): Update for new behavior.
2025-04-28 13:46:40 -04:00
Stefan Monnier
a0f26f3eaf (Custom-dirlocals-mode): Let define-derived-mode do its job
* lisp/cus-edit.el (Custom-dirlocals-mode-map): Rename from
`custom-dirlocals-map`.
(Custom-dirlocals-menu): Adjust accordingly.
(Custom-dirlocals-mode): Let `define-derived-mode` do its job.
Use `run-mode-hooks`.
2025-04-28 13:35:09 -04:00
Michael Albinus
c801856820 ; Fix previous change
* test/lisp/url/url-parse-tests.el
(url-generic-parse-url/ms-windows-file-uri-handling): Rename.
2025-04-28 08:22:09 +02:00