1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-10 09:43:26 -08:00
Commit graph

178656 commits

Author SHA1 Message Date
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
Stefan Monnier
376bd36f34 register.el: Fix use of cl-find-class
`declare-function` doesn't cut it because the function can get
called without having loaded `cl-extra` beforehand.
Use `cl--find-class` instead, since that one gets inlined.

* lisp/register.el: Require `cl-macs`.
(register--get-method-type): Use `cl--find-class`.
(cl-find-class): Don't declare.
2025-06-16 17:15:37 -04:00
James Thomas
a4ca0cd7f0 Add repeat map for tab-bar-history (bug#78804)
Add repeat map similar to that of winner-mode (to which
tab-bar-history is an alternative).

* lisp/tab-bar.el (tab-bar-history-repeat-map): Make the change.
2025-06-16 09:36:22 +03:00
Paul Eggert
477112ebc3 process-attributes now uses get_boot_time
I noticed this issue while looking into Bug#63496.
GNU Emacs does not infer the boot time consistently on GNU/Linux
and similar platforms: android_notifications_notify_1 and
get_boot_sec use Gnulib’s boot-time module, but process-attributes
has idiosyncratic code that evidently predates that module.
The idiosyncratic code returns an unstable etime, which is a minor bug.
Simplify process-attributes by just using Gnulib.
This returns a stable etime.
It may also fix Bug#63496; if not, we can fix Gnulib later.
* src/sysdep.c: Include <boot-time.h>.
(get_up_time) [GNU_LINUX || CYGWIN || __ANDROID__]: Remove.
(system_process_attributes) [GNU_LINUX || CYGWIN || __ANDROID__]:
Use get_boot_time instead of get_up_time.
2025-06-15 19:22:48 -07:00
Mattias Engdegård
ebdad09c5a * src/bytecode.c (exec_byte_code): Remove superfluous condition
Bytecode should never be able to set anything to Qunbound because that
value is not accessible from Lisp.  Found by Pip Cet.
2025-06-15 17:50:32 +02:00
Mattias Engdegård
08a7477d22 * src/fns.c (mapcar1): Less lax type checking
Previously, mapcar etc would crash or return nonsense when passed a
record.  Found by Pip Cet.
2025-06-15 10:50:59 +02:00
Eli Zaretskii
336253ddd3 Merge from origin/emacs-30
df3fb94f09 Insert missing step to make use of directory tracking OSC...
1bed294958 * lisp/keymap.el (keymap-set): Refer to 'key-description'...
941158fc13 Support new tree-sitter grammar filename format (bug#78754)
888f846d37 Fix crash when evaluating "(signal nil 5)" (bug#78738)
51b9e92ab8 Merge branch 'emacs-30' of git.savannah.gnu.org:/srv/git/...
c0a913ea4f ; * doc/lispref/modes.texi (Font Lock Basics): Remove old...
37de076017 Adapt emba integration (don't merge)
2025-06-14 11:23:54 -04:00
Eli Zaretskii
4cc6cdcf9d ; Merge from origin/emacs-30
The following commit was skipped:

37de076017 Adapt emba integration (don't merge)
2025-06-14 11:23:54 -04:00
Steven Allen
4d88b925ba Improve documentation of the internal Lisp_Process->status field
Contrary to the existing documentation here, the value of this
field cannot be the symbols open or closed.  Furthermore, this
field is never set to "stop" for network connections.
* src/process.h (Lisp_Process): Improve/fix documentation of the
'status' field.  (Bug#78784)
2025-06-14 18:02:40 +03:00
Eli Zaretskii
69254cd51a ; * src/profiler.c (export_log): Fix whitespace (bug#78762). 2025-06-14 17:56:01 +03:00
Zach Shaftel
009cdc8ae0 Fix segfault in profiler-cpu-log and profiler-memory-log (bug#78763)
* src/profiler.c (export_log): Check if a log has been allocated first,
and return nil if it hasn't.
(Fprofiler_cpu_log, Fprofiler_memory_log): Doc fix.
* test/src/profiler-tests.el (profiler-tests-cpu-profiler)
(profiler-tests-memory-profiler): New tests.
2025-06-14 17:54:06 +03:00
Steven Allen
e1d0ee1b6b mailcap: Treat .ics files as text/calendar
This ensures iCalendar attachments are always displayed correctly
(via `gnus-icalendar-mm-inline'), even when they have an incorrect
MIME type (looking at you Google Calendar).
* lisp/net/mailcap.el (mailcap-mime-extensions): Add a mapping from ".ics"
to "text/calendar".  (Bug#78764)
2025-06-14 17:29:01 +03:00
Eli Zaretskii
994f816ca8 ; * lisp/time.el (world-clock--sort-entries): Avoid compiler warning. 2025-06-14 17:21:18 +03:00
Jacob S. Gordon
9c6c7c4bb7 world-clock: Add user option to control order of entries
* lisp/time.el (world-clock-sort-order): Add user option.
(world-clock--sort-entries): Add auxiliary sorting function.
(world-clock-display): Sort entries based on the new user option.
(Bug#78678)
2025-06-14 17:16:22 +03:00
Jacob S. Gordon
5bd9fa084d calc: Allow strings with character codes above Latin-1
The current behavior of the functions 'calc-display-strings',
'strings', and 'bstrings' is to skip any vector containing
integers outside the Latin-1 range (0x00-0xFF).  We introduce a
custom variable 'calc-string-maximum-character' to replace this
hard-coded maximum, and to allow vectors containing higher
character codes to be displayed as strings.  The default value
of 0xFF preserves the existing behavior.

* lisp/calc/calc.el (calc-string-maximum-character): Add custom
variable 'calc-string-maximum-character'.
* lisp/calc/calccomp.el (math-vector-is-string): Replace hard-coded
maximum with 'calc-string-maximum-character', and the 'natnump'
assertion with 'characterp'.  The latter guards against the
maximum being larger than '(max-char)', but not on invalid types of
the maximum such as strings.

* test/lisp/calc/calc-tests.el (calc-math-vector-is-string): Add
tests for 'math-vector-is-string' using different values of
'calc-string-maximum-character'.

* doc/misc/calc.texi (Quick Calculator, Strings, Customizing Calc):
Add variable definition for 'calc-string-maximum-character' and
reference thereof when discussing 'calc-display-strings'.
Generalize a comment about string display and availability of 8-bit
fonts.
(Bug#78528)
2025-06-14 17:07:19 +03:00
Eli Zaretskii
82766b71a4 ; Fix warnings in MinGW builds
* src/w32fns.c (msh_mousewheel): Declare.
* src/treesit.c (treesit_debug_print_linecol): Fix format
specifiers.

* lib-src/pop.c (pfn_getaddrinfo, pfn_freeaddrinfo): Now static.
2025-06-14 16:56:44 +03:00
Eli Zaretskii
ebe7c1b528 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-06-14 16:55:53 +03:00