1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

178673 commits

Author SHA1 Message Date
Peter Oliver
22db624c0e New function treesit--language-git-version-tags
* lisp/treesit.el (treesit--language-git-version-tags): New function to
  list version tags for a Tree-sitter parser Git repository (bug#78848).
2025-06-23 09:47:30 +03:00
Stefan Monnier
08fba517f6 (smerge-refine-shadow-cursor): New variable and face (bug#78806)
* lisp/vc/smerge-mode.el (smerge-refine-shadow-cursor): New variable
and face.
(smerge-refine-regions): Add `cursor-sensor-functions` property
to the covering overlays.
(smerge--refine-at-right-margin-p, smerge--refine-shadow-cursor):
New functions.
(smerge--refine-other-pos): New function, extracted from
`smerge-refine-exchange-point`.
(smerge-refine-exchange-point): Use it.
(smerge--refine-highlight-change): Add thin
highlighted space for insertion/deletion positions.

* lisp/emacs-lisp/cursor-sensor.el (cursor-sensor--detect):
Run functions for `moved` events.  Demote errors.
(cursor-sensor-mode): Adjust docstring accordingly.

* doc/lispref/text.texi (Special Properties) <cursor-sensor-functions>:
Mention the new `moved` direction.
2025-06-23 00:00:38 -04:00
Jim Porter
e5ad9ae100 When navigating to anchor targets in EWW, retain 'eww-data' properties
Previously, navigating to an in-page anchor target would clear
'eww-data', removing many important properties like the original source
and the DOM.  Among other things, this prevented enabling/disabling
readable mode.

* lisp/net/eww.el (eww-follow-link): Copy previous 'eww-data'.
2025-06-22 09:29:39 -07:00
Michael Albinus
87fc539a0b Tramp: Cache also file-executable-p' in file-name-all-completions'
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-regexp):
Fix comment.

* lisp/net/tramp-sh.el (tramp-perl-file-name-all-completions):
Cache also `file-executable-p'.  Suggested by <mail@knazarov.com>.
(tramp-shell-file-name-all-completions): New script.
(tramp-bundle-read-file-names): Fix for special characters.  Cache
also `file-executable-p'.
(tramp-sh-handle-file-name-all-completions): Unify different cases.

* lisp/net/tramp.el (with-tramp-suspended-timers, without-remote-files):
Fix debug spec.
2025-06-22 17:29:52 +02:00
Eli Zaretskii
081c1aae99 Fix 'c-ts-mode' indentation when the style is defined as a function
* lisp/progmodes/c-ts-mode.el (c-ts-mode, c++-ts-mode): Handle the
case where 'c-ts-mode-indent-style' is a function.  (Bug#78814)
2025-06-22 11:16:53 +03:00
Eli Zaretskii
e66428a0d2 ; Fix last change
* lisp/emacs-lisp/package.el (package-mark-install-line)
(package-mark-delete-line): Doc fixes.  (Bug#78794)
2025-06-22 11:08:04 +03:00
Elías Gabriel Pérez
be0b44e4ed Pretiffy package-menu (Bug#78794)
Add package-menu mode-line which displays information about:
total number of packages installed, total number of packages
from all the packages archive, total number of packages to
upgrade and total number of new packages available.
Highlight packages marked for installation or deletion.
* lisp/emacs-lisp/package.el (package-menu-mode): Add package-menu
mode-line format to 'mode-line-misc-info'.
(package-mark-install-line, package-mark-delete-line): New faces.
(package-menu--overlay-line, package-menu--remove-overlay)
(package-menu--set-mode-line-format): New functions.
(package-menu-mark-delete, package-menu-mark-install)
(package-menu-mark-unmark, package-menu-backup-unmark)
(package-menu-mark-obsolete-for-deletion): Tweak for set/unset the
overlays.
(package-menu-mode-line-format, package-menu-mode-line-info): New
buffer-local variables.
(list-packages): Add 'package-menu--set-mode-line-format' to
'package--post-download-archives-hook'.

* etc/NEWS: Announce changes.
2025-06-22 11:04:51 +03:00
Sean Whitton
c916f816e0 ; * lisp/vc/vc.el (vc-checkin): Fix thinko. 2025-06-21 19:03:54 +01:00
Michael Albinus
c98a74cd87 * test/infra/gitlab-ci.yml (test-eglot): Fix EMACS_EXTRAOPT. 2025-06-21 16:27:46 +02:00
Eli Zaretskii
d0af57196a ; Merge from origin/emacs-30
The following commit was skipped:

1406e583fe Workaround for "M-x man" on macOS 15 and later
2025-06-21 06:26:10 -04:00
Eli Zaretskii
31febb1a28 Merge from origin/emacs-30
a2bfce5d2a ; Fix customization and doc strings in pp.el
2025-06-21 06:26:10 -04:00
Eli Zaretskii
f1696c3c27 ; * lisp/progmodes/python.el (treesit-thing-settings): Defvar. 2025-06-21 06:23:51 -04:00
Manuel Giraud
d7e5555875 Avoid rebuilding a static alist inside a loop
* lisp/calendar/diary-lib.el (diary-mark-entries-1): Build
months-alist outside of the loop.  (Bug#78779)
2025-06-21 12:39:56 +03:00
Eli Zaretskii
1406e583fe Workaround for "M-x man" on macOS 15 and later
* lisp/man.el (Man-init-defvars): Workaround for macOS Sed.  Do
not merge to master.  (Bug#77944)
2025-06-21 12:33:12 +03:00
Elías Gabriel Pérez
60fbeda771 Support strings for electric pairs (bug#78053)
This add support for insert string pairs in 'electric-pairs-mode'.
* lisp/elec-pair.el (electric-pair-pairs)
(electric-pair-text-pairs): Add new defcustom types.
(electric-pair-syntax-info)
(electric-pair-post-self-insert-function): Add support for
strings.

* etc/NEWS: Announce changes.

* test/lisp/electric-tests.el: Add new tests.
2025-06-21 12:24:55 +03:00
Eli Zaretskii
e379f14193 Fix setting custom 'c++-ts-mode' indent style
* lisp/progmodes/c-ts-mode.el (c-ts-mode-set-style): Fix a typo.
(Bug#78814)
2025-06-21 12:10:54 +03:00
Eli Zaretskii
dd95447b05 Avoid segfault when profiling Lisp programs with threads
* src/eval.c (backtrace_top): Don't segfault if current_thread is
NULL.  (Bug#76970)
2025-06-21 11:53:24 +03:00
Zach Shaftel
075ebed98f Fix byte-compilation of defalias with a constant macro cons pair
* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defalias):
Quote the function name in '(macro . function-name), since we eval
it later.
* test/lisp/emacs-lisp/bytecomp-tests.el
(test-eager-load-macro-expand-defalias): New test.
(Bug#78792)
2025-06-21 11:40:17 +03:00
Jostein Kjønigsen
39721a4d79 python-ts-mode: Improve fontification
python--treesit-settings: Fontification based on selectors & code-conventions

- Constructor: Fontified as type, not function-call.
- Typed default parameters
- Fontify kwargs in function calls as property-use. Differentiate from
  variable-use (passed in arguments)
2025-06-21 11:17:51 +03:00
Manuel Giraud
00b8d11ac8 Fix bold or underline of underscores (bug#78839)
* lisp/man.el (Man-fontify-manpage): Fix the "_\b_" case.
2025-06-21 11:15:26 +03:00
Eli Zaretskii
4607d3e426 Fix 'split-string' when TRIM is used
* lisp/subr.el (split-string): Support the case where STRING
begins with a match for SEPARATORS, and a match for SEPARATORS
also matches TRIM.  Doc fix.  (Bug#78690)

* test/lisp/subr-tests.el (subr-test-split-string): New test.
2025-06-21 11:08:05 +03:00
Eli Zaretskii
8201e7e7a7 ; * src/xfaces.c (init_xfaces) <face_attr_sym>: Add :family (bug#78813). 2025-06-21 09:45:02 +03:00
Stefan Monnier
df86d10316 (peg--merge-error) <guard>: Add missing method
Also clarify that the package requires at least Emacs-25.

* lisp/progmodes/peg.el (peg--merge-error) <guard>: Add missing method.
2025-06-20 19:59:54 -04:00
Juri Linkov
1a76b527ac Use keyword :commit with full hashes for treesit-language-source-alist.
* lisp/treesit.el (treesit-language-source-alist):
Document the format that uses keywords.
(treesit--install-language-grammar-1): Remove args
'revision', 'source-dir', 'cc', 'c++', 'commit'.
Use 'args' to process the keywords, and use the remaining
list as the previous list of arguments.
(treesit--install-language-grammar-1): Let-bind
'treesit--install-language-grammar-full-clone' and
'treesit--install-language-grammar-blobless' to t
when 'commit' is non-nil (bug#78542).

* lisp/progmodes/c-ts-mode.el:
* lisp/progmodes/cmake-ts-mode.el:
* lisp/progmodes/csharp-mode.el:
* lisp/progmodes/dockerfile-ts-mode.el:
* lisp/progmodes/elixir-ts-mode.el:
* lisp/progmodes/go-ts-mode.el:
* lisp/progmodes/heex-ts-mode.el:
* lisp/progmodes/java-ts-mode.el:
* lisp/progmodes/js.el:
* lisp/progmodes/json-ts-mode.el:
* lisp/progmodes/php-ts-mode.el:
* lisp/progmodes/python.el:
* lisp/progmodes/ruby-ts-mode.el:
* lisp/progmodes/rust-ts-mode.el:
* lisp/progmodes/sh-script.el:
* lisp/progmodes/typescript-ts-mode.el:
* lisp/textmodes/css-mode.el:
* lisp/textmodes/html-ts-mode.el:
* lisp/textmodes/markdown-ts-mode.el:
* lisp/textmodes/toml-ts-mode.el:
* lisp/textmodes/yaml-ts-mode.el:
Use the keyword :commit with full hashes instead of tags
in 'treesit-language-source-alist'.

* lisp/treesit-x.el (define-treesit-generic-mode):
Simplify the keyword :copy-queries.
(gitattributes-generic-ts-mode, liquid-generic-ts-mode):
Add keywords :commit and :copy-queries to :source.

* admin/tree-sitter/treesit-admin.el
(treesit-admin--unversioned-treesit-language-source-alist):
Handle :revision and :commit as well.
(treesit-admin--find-latest-compatible-revision):
Process the keywords in the recipe.
2025-06-20 19:58:28 +03:00
Michael Albinus
e3660a32c7 Improve eglot tests on emba
* test/infra/gitlab-ci.yml (test-eglot): Use packages company and
yasnippet.

* test/lisp/progmodes/eglot-tests.el (eglot--call-with-timeout):
Skip on emba in case of timeout.  (Bug#78730)
2025-06-20 18:38:27 +02:00
Pip Cet
1bc86b1776 Revert "Avoid excessively large backtraces in ert-tests (bug#71988)"
This reverts commit 0264ab1118.
2025-06-20 14:03:40 +00:00
Robert Pluim
1560e9bf66 Make tls tests use random port
* test/lisp/net/network-stream-tests.el (server-process-filter):
Remove 'message' call.
(make-tls-server): Try random ports until we find one that's
unused and use it.  Adjust all callers.
2025-06-20 12:09:14 +02:00
Robert Pluim
04a1a53de1 ; Improve previous change
* test/lisp/net/network-stream-tests.el
(network-test--resolve-system-name): Resolve addresses once not
twice.
2025-06-20 12:01:59 +02:00
Robert Pluim
dcead54ed5 Fix echo-server-with-dns for really broken systems
*test/lisp/net/network-stream-tests.el
(network-test--resolve-system-name): Check to see if we get any
address result at all (looking at you macOS).
2025-06-20 11:57:41 +02:00
Robert Pluim
1c168e166d Fix echo-server-with-dns test
This test wasn't being run because the check for DNS was
inverted.

* test/lisp/net/network-stream-tests.el (echo-server-with-dns):
Use 'skip-when' instead of 'ert-skip'.
2025-06-20 11:47:31 +02:00
Pip Cet
0264ab1118 Avoid excessively large backtraces in ert-tests (bug#71988)
* test/lisp/emacs-lisp/ert-tests.el (ert-test-run-tests-batch-expensive):
Temporarily make `cl-print-object' not print out vectors while running
the test.
2025-06-20 07:00:21 +00:00
Martin Rudalics
60a567af86 Have 'split-window' forget previous window height (Bug#78835)
* lisp/window.el (split-window): When WINDOW has a
'quit-restore' parameter that specifies a previous height to
restore, remove that when splitting vertically.  It does more
harm than good now (Bug#78835).
2025-06-20 08:51:58 +02:00
Pip Cet
b6cf7c0942 Make cl-random behave consistently for unusual arguments (bug#75105)
The old behavior was for (cl-random -1.0e+INF) to return NaN in about
one in eight million calls, and -1.0e+INF otherwise.  Other unusual
arguments were handled inconsistently as well.

* lisp/emacs-lisp/cl-extra.el (cl-random): Handle positive finite
arguments consistently, error for nonpositive or infinite arguments.
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-random): New
test.
2025-06-20 06:09:24 +00:00
Peter Oliver
6181e0cec5 Eliminate redundant variable treesit-admin--builtin-language-sources
Nowadays, each mode populates treesit-language-source-alist when the
mode is required; we do not need to duplicate the information.

* admin/tree-sitter/treesit-admin.el
(treesit-admin--builtin-language-sources)
(treesit-admin-verify-major-mode-queries)
(treesit-admin--generate-compatibility-report): Eliminate variable
treesit-admin--builtin-language-sources.
(treesit-admin--generate-compatibility-report): bash-ts-mode is “clever”
and switches back to sh-mode if it thinks the current buffer does not
contain a Bash script (bug#78747).
(treesit-admin--builtin-modes): Add missing modes.
(treesit-admin--builtin-features): New variable, telling us which
features to require to populate treesit-language-source-alist.
(treesit-admin--populated-treesit-language-source-alist): New function,
to add everything we know to treesit-language-source-alist.
(treesit-admin--unversioned-treesit-language-source-alist): Return a
copy of treesit-language-source-alist with the version requirements
removed.
* test/infra/Dockerfile.emba: Make use of
treesit-admin--populated-treesit-language-source-alist (bug#78748).
2025-06-19 19:28:21 +03:00
Juri Linkov
e5646f7903 Fix repeat-echo-message-string for keys with hints (bug#78797).
* lisp/repeat.el (repeat-echo-message-string): For one character
use it to format hints.  For multi-key sequence first print it,
then use the last character to format hints in parenthesis.

* test/lisp/repeat-tests.el (repeat-tests-another-repeat-map): Add hints.
(repeat-tests-hints): Add test.
2025-06-19 09:40:36 +03:00
Eli Zaretskii
564a8da53e ; * admin/MAINTAINERS: Fix whitespace. 2025-06-19 08:02:15 +03:00
shipmints
2de157f993 * admin/MAINTAINERS: Added myself as the vtable.el maintainer. 2025-06-19 08:00:57 +03:00
Michael Albinus
e3e0be8786 ; Fix last change 2025-06-18 21:08:30 +02:00
Michael Albinus
5310083ba0 Show test name in ERT progress bar
* lisp/emacs-lisp/ert.el
(ert--results-progress-bar-button-help-echo): New defun.
(ert--results-progress-bar-button): Use it.
2025-06-18 20:12:55 +02:00
shipmints
318715105d Make savehist timer actually repeat
* lisp/savehist.el (savehist--manage-timer): Correct the
arguments to 'run-with-timer'.  Suggestion from Stéphane Marks
<shipmints@gmail.com>.  (Bug#78820)
2025-06-18 17:03:36 +02:00
Pip Cet
af68c6e825 Remove eieio's ...-list-p predicate (bug#78782)
There seem to be no remaining callers of this function, which has not
been working for a while.

* lisp/emacs-lisp/eieio-core.el (eieio-backward-compatibility): Don't
mention "-list-p" predicate.
(eieio-defclass-autoload): Don't autoload predicate.
(eieio-defclass-internal): Remove code to generate list-p predicate.
2025-06-18 11:41:43 +00:00
Yuan Fu
27a524602f
Use treesit-thing-settings in python-ts-mode
* lisp/progmodes/python.el (python--thing-settings): New variable.
(python-ts-mode): Setup treesit-thing-settings.
2025-06-17 17:44:23 -07:00
Yuan Fu
eb3f089356
Remove obsolete tree-sitter type-regexp vars
* lisp/treesit.el (treesit-text-type-regexp):
(treesit-sexp-type-regexp):
(treesit-sentence-type-regexp): Remove variables.
2025-06-17 17:33:08 -07:00
Paul Eggert
037fb02135 process-attributes uses CLOCK_BOOTTIME for uptime
* src/sysdep.c (get_host_uptime) [GNU_LINUX || CYGWIN || __ANDROID__]:
New function, replacing get_host_boot_time.
Use CLOCK_BOOTTIME instead of inspecting /proc/stat.
All callers changed.  This should be an even better way to fix Bug#63496.
2025-06-17 17:11:17 -07:00
Paul Eggert
73cebbb87b process-attributes uses /proc/stat for boot time
With a Linux kernel, use /proc/stat rather than get_boot_time
to get boot time, since when Emacs is running in a container
we want the underlying host boot time, not the container boot time.
This should be a better way to fix Bug#63496.
* src/sysdep.c: Do not include boot-time.h.
(get_host_boot_time) [GNU_LINUX || CYGWIN || __ANDROID__]:
New function.
(system_process_attributes) [GNU_LINUX || CYGWIN || __ANDROID__]:
Use it instead of get_boot_time.
2025-06-17 12:25:16 -07:00
Mattias Engdegård
3f72004961 Fix function arity check for noncompiled callees (bug#78685)
This fixes a regression from Emacs 29, and is the second attempt after
the later reverted 8b0f5b0597.

* lisp/emacs-lisp/bytecomp.el (byte-compile-fdefinition):
Make it work for functions that aren't compiled.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--f):
(bytecomp-tests--warn-arity-noncompiled-callee): Add test.
2025-06-17 20:18:53 +02:00
Mattias Engdegård
eca2cc00b6 * doc/lispref/functions.texi (Closures): Rewrite outdated text. 2025-06-17 17:51:49 +02:00
Stephen Berman
79e50ddb9c Fix regression in 'kill-this-buffer' (bug#78809)
This restores the ability to use 'kill-this-buffer' when a
keyboard event pops up the Global Menu.  Instead of raising an
error if the command was not called by a mouse event, an error is
now raised if it was not called from a menu or a tool bar.

* lisp/menu-bar.el (kill-this-buffer): Remove optional EVENT from
argument list and "e" code from interactive spec.  Adjust doc
string.  Use 'last-command-event' to determine if command was
called from a menu or a tool bar.  Use 'event--posn-at-point' in
test for frame.

* lisp/net/eudc-hotlist.el (eudc-hotlist-quit-edit):
* lisp/net/eudc.el (eudc-display-records, eudc-query-form):
* lisp/vc/pcvs.el (cvs-mode-map): Replace uses of
'kill-this-buffer' by 'kill-current-buffer'.
2025-06-17 16:08:32 +02:00
Eli Zaretskii
06b74b04cb Prevent redisplay slowdown with non-zero vscroll
* src/xdisp.c (try_scrolling): Don't loop when the
partially-visible cursor line is at the top of the window.  This
looping are pointless, and just makes redisplay slow for no reason.
(Bug#78766)
2025-06-17 16:00:04 +03:00
Andrea Corallo
f38e969e47 Make nativecomp don't error when encountering undeclared types (bug#6573)
* test/src/comp-resources/comp-test-funcs.el (comp-test-76573-1-f): New
function.
* lisp/emacs-lisp/comp-cstr.el (comp-supertypes): Don't error if 'type'
is unknown.
2025-06-17 09:22:32 +02:00