1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-23 13:02:00 -08:00
Commit graph

50891 commits

Author SHA1 Message Date
Eli Zaretskii
ac8bc9a2e2 ; * src/alloc.c (Fgarbage_collect_heapsize): Avoid compiler warning. 2026-01-21 13:44:31 +02:00
Stefan Monnier
4150c2e22e (garbage-collect-heapsize): New function
The info returned from `garbage-collect` is really handy to
track the evolution of the heap size, but sadly it's available only
at the cost of running a full GC, which has two big downsides:
it's slow, it affects what we're measuring, and it can't be used
in `post-gc-hook`.
So, this patch makes it available without running the GC.

* src/alloc.c (Fgarbage_collect_heapsize): New function, extracted from
`Fgarbage_collect`.
(Fgarbage_collect): Use it.
(syms_of_alloc): defsubr it.

* doc/lispref/internals.texi (Garbage Collection): Extract
documentation for it from that of `garbage-collect`.
2026-01-20 16:09:22 -05:00
Paul Eggert
1ca5eda85e Don’t use C basename function
* src/pdumper.c (pdumper_set_emacs_execdir):
Don’t use basename; simply use the pointer we already have.
If we ever need a basename-like function in the future, we should
use Gnulib’s basename-lgpl module, as POSIX basename modifies its
argument string and is incompatible with glibc/Android basename; see
<https://www.gnu.org/software/gnulib/manual/html_node/basename.html>.
2026-01-19 12:49:16 -08:00
Eli Zaretskii
1e080e2ecc ; * src/indent.c (Fvertical_motion): Fix last change. (Bug#80223) 2026-01-19 20:01:48 +02:00
Eli Zaretskii
cb7a3f4e89 Fix vertical cursor motion across overlay strings
* src/indent.c (Fvertical_motion): Fix vertical cursor motion when
a screen line begins with an overlay string.  (Bug#80223)
2026-01-19 16:20:39 +02:00
Eli Zaretskii
e81cee7468 ; * src/window.c (Fwindow_cursor_info): Fix commentary of last change. 2026-01-19 14:25:04 +02:00
RadioNoiseE
11347939c1 Fix box cursor width returned for stretch glyph
* src/window.c (Fwindow_cursor_info): Return canonical character width
when on stretch glyph and `x-stretch-cursor' is nil.  (Bug#80211)
2026-01-19 14:19:12 +02:00
Yavor Doganov
b44053536d NS: Fix UI freezes and Lisp threads on GNUstep
* src/nsterm.m (ns_select_1): Return thread_select if current
thread is not the main thread or timeout is zero; otherwise call
'thread_select' with a minimal timeout to allow other Lisp
threads to run.  (Bug#80110, Bug#80112)
2026-01-19 14:16:15 +02:00
Eli Zaretskii
f9e063e922 ; * src/dbusbind.c (Fdbus_registered_inhibitor_locks): Fix signature. 2026-01-18 19:03:57 +02:00
Paul Eggert
58b9ac601e Avoid overflows in image size calculations
Problem reported by Basil L. Contovounesios (bug#66221#89).
* src/image.c (image_size_in_bytes, image_frame_cache_size):
Use intptr_t for sizes of collections of objects.
(struct anim_cache.byte_size, gif_load, Fimage_cache_size):
Use intmax_t for sizes of either files or objects.
2026-01-17 11:12:00 -08:00
Yavor Doganov
bc5fb19d16 NS: Fix startup with HAVE_NATIVE_COMP && !NS_SELF_CONTAINED
* src/pdumper.c (pdumper_set_emacs_execdir): Add workaround for
!NS_SELF_CONTAINED so that launching Emacs from the app bundle
works flawlessly when built with native compilation.
* configure.ac: Define BINDIR.  (Bug#80094)
2026-01-17 16:56:50 +02:00
Yavor Doganov
cc3e6f368f NS: Add native image support for HEIF, SVG and WEBP on GNUstep
* src/nsimage.m (ns_can_use_native_image_api): Handle HEIF, SVG
and WEBP image types on GNUstep.
* src/image.c (syms_of_image): Add conditional native image
support for HEIF, SVG and WEBP on GNUstep.  (Bug#80101)
2026-01-17 14:06:29 +02:00
Yavor Doganov
709983fb08 NS: Fix Meta key on GNUstep
* src/nsterm.m (syms_of_nsterm): On GNUstep, set
ns-command-modifier to "meta" to match the backend default
setting.  (Bug#80090)
2026-01-17 13:59:18 +02:00
Michael Albinus
ab77b4b60c New D-Bus functions to support systemd inhibitor locks
* doc/misc/dbus.texi (Top): Add "Inhibitor Locks" submenu.
Remove trailing period from chapter and section titles.
(Inhibitor Locks): New node.

* etc/NEWS: New D-Bus functions to support systemd inhibitor locks.
Presentational fixes and improvements.

* src/dbusbind.c (xd_registered_inhibitor_locks): New variable.
(Fdbus_make_inhibitor_lock, Fdbus_close_inhibitor_lock)
(Fdbus_registered_inhibitor_locks): New DEFUNs.  (Bug#79963)
(syms_of_dbusbind_for_pdumper): Initialize
`xd_registered_inhibitor_locks'.
(syms_of_dbusbind): Declare subroutines
`Sdbus_make_inhibitor_lock', `Sdbus_close_inhibitor_lock' and
`Sdbus_registered_inhibitor_locks'.  Declare symbol `Qdbus_call_method'.
staticpro `xd_registered_inhibitor_locks'.

* test/lisp/net/dbus-tests.el (dbus--test-systemd-service)
(dbus--test-systemd-path, dbus--test-systemd-manager-interface):
New defconsts.
(dbus-test10-inhibitor-locks): New test.
2026-01-17 11:40:31 +01:00
Basil L. Contovounesios
6287637ccd Various housekeeping in image.c
* doc/lispref/display.texi (Customizing Bitmaps): Fix grammar.
(XBM Images): Fix reference to incorrect number of properties.
(Multi-Frame Images, Other Image Types): Mention multi-frame WebP
support.

* src/image.c: Don't include pdumper.h; it hasn't been needed since
commit of 2019-05-17 "Clean up and simplify image-type setup".  Fix
some commentary.
(image_pix_container_create_from_bitmap_data): Remove no longer used
frame parameter (bug#80191); this continues from commit of
2022-11-25 "Remove unused parameter from
image_create_pix_container".  All callers updated.
(x_create_xrender_picture, initialize_image_type): Simplify.
(xbm_image_p): Remove redundant conditional branch.  Update
commentary.
2026-01-16 14:03:45 +02:00
Basil L. Contovounesios
8b27802256 Fix off-by-one error in native_image_p
* src/image.c (native_image_format): Make array size explicit, to
help keep it consistent with its later fmt descriptor copy.
(native_image_p): Parse the correct number of keywords (bug#80191).
2026-01-16 14:00:08 +02:00
Michael Albinus
5a1ced4b24 Call all registered D-Bus signal handlers
* doc/misc/dbus.texi (Signals): All registered signal handlers are
called.
(Synchronous Methods, Signals, Monitoring Messages): Add function
result in examples.

* src/dbusbind.c (xd_store_event): New function.
(xd_read_message_1): Use it.  Call all registered handlers per
signal.  (Bug#80168)

* test/lisp/net/dbus-tests.el (dbus--test-signal-handler): Adapt defun.
(dbus--test-signal-handler1, dbus--test-signal-handler2): New defuns.
(dbus-test05-register-signal-several-handlers): New test.
(dbus-test04-register-method)
(dbus-test04-call-method-authorizable)
(dbus-test05-register-signal)
(dbus-test05-register-signal-with-nils)
(dbus-test06-register-property-emits-signal): Adapt tests.
2026-01-14 10:41:41 +01:00
Stéphane Marks
1644463e5b Inhibit unused variable warning in NSTRACE_WHEN (bug#80096)
* src/nsterm.h (NSTRACE_WHEN): Mark
'nstrace_saved_enabled_global' as unused.
2026-01-13 09:41:49 +00:00
Stéphane Marks
785059a1f7 Add frame identifiers (bug#80138)
A unique frame id is assigned to a new or cloned frame, and
reused on an undeleted frame.

The id facilitates unambiguous identification among frames that
share identical names or titles, deleted frames where a live
frame object no longer exists that we can resurrect by id, for
example via 'tab-bar-undo-close-tab'.  It also aids debugging at
the C level using the frame struct member id.

Rewrite 'clone-frame' and 'undelete-frame' to not let bind
variables that 'make-frame' uses to avoid conflicts with nested
'make-frame' calls, for example via
'after-make-frame-functions'.

* lisp/frame.el (clone-frame, undelete-frame): Use
'frame--purify-parameters' to supply parameters explicitly.
(undelete-frame--save-deleted-frame): Save frame id for
restoration.
(undelete-frame): Restore frame id.
(frame--purify-parameters): New defun.
(make-frame): Assign a new id for a new or cloned frame, reuse
for undeleted frame.
* src/frame.h (struct frame): Add id member.
(frame_next_id): New extern.
* src/frame.c (frame_next_id): New global counter.
(frame_set_id, frame_set_id_from_params): New function.
(Fframe_id): New DEFUN.
(syms_of_frame <Sframe_id>): New defsubr.
(syms_of_frame <Qinternal_id>): New DEFSYM.
(syms_of_frame <frame_internal_parameters>): Add 'Qinternal_id'.
* src/androidfns.c (Fx_create_frame):
* src/haikufns.c (Fx_create_frame):
* src/nsfns.m (Fx_create_frame):
* src/pgtkfns.c (Fx_create_frame):
* src/w32fns.c (Fx_create_frame):
* src/xfns.c (Fx_create_frame): Call 'frame_set_id_from_params'.
* doc/lispref/frames.texi: Add documentation.
* etc/NEWS: Announce frame id.
2026-01-13 09:29:44 +01:00
Martin Rudalics
38092d879b Fix crash where dead frame remains on list of live frames (Bug#80120)
* src/fns.c (delq_no_quit): New function.
* src/lisp.h: Extern delq_no_quit.
* src/frame.c (delete_frame): Call delq_no_quit to remove frame
from Vframe_list uninterruptedly (Bug#80120).
2026-01-11 10:22:54 +01:00
Yavor Doganov
e5a8c4ae00 ; NS: Fix typo in -resetCursorRects implementations
* src/nsterm.m ([EmacsView resetCursorRects]): Fix typo in
selector name; restrict respondsToSelector: check to Cocoa.
([EmacsScroller resetCursorRects]): Likewise.  (Bug#80098)
2026-01-10 15:58:38 +02:00
Yavor Doganov
98f56a156e NS: Use Cocoa implementation of EmacsBell -init if named image is declared
* configure.ac: Check for 'NSImageNameCaution' declaration when
building on GNUstep.
* src/nsterm.m ([EmacsBell init]): Use fallback implementation on
GNUstep only if 'NSImageNameCaution' is not declared.  (Bug#80107)
2026-01-10 14:30:43 +02:00
Mattias Engdegård
cdfb7354d6 Less stingy lisp-eval-depth supply for debugger
* src/eval.c (call_debugger, signal_or_quit):
Raise extra headroom to 200 levels.  The debugger is sometimes entered
via handler-bind so we raise the bar there as well (bug#80154).
2026-01-09 17:19:45 +01:00
Martin Rudalics
52e0c9eb2a ; Fix doc-string of Fset_frame_position
* src/frame.c (Fset_frame_position): In doc-string say that for
a child frame X and Y are relative to FRAME's parent frame.
2026-01-06 10:05:51 +01:00
Martin Rudalics
80360ec4a7 Fix calculation of outer frame height in NS builds (Bug#80077)
* src/nsfns.m (frame_geometry): Include tool bar height when
calculating a frame's outer height (Bug#80077).
2026-01-05 10:24:45 +01:00
Sean Whitton
8819a9e763 ; * src/keyboard.c: Fix style in two comments. 2026-01-04 11:37:42 +00:00
Eli Zaretskii
c1b8a00da9 ; * src/window.c (Fwindow_cursor_info): More cleanup. 2026-01-03 17:34:52 +02:00
Eli Zaretskii
a9611b1022 Unbreak a build --without-x
* src/window.c (Fwindow_cursor_info): Provide values for TTY
frames.  (Bug#80023)
2026-01-03 16:39:39 +02:00
Eli Zaretskii
bd5f90fa13 ; * src/window.c (Fwindow_cursor_info): Doc fix. 2026-01-03 12:59:40 +02:00
RadioNoiseE
48b80a1e2b New function 'window-cursor-info'
* src/window.c (Fwindow_cursor_info): New function.
(syms_of_window): Defsubr it.
* doc/lispref/windows.texi (Window Point): Document it.
* etc/NEWS: Announce new function.  (Bug#80023)
2026-01-03 12:57:28 +02:00
Stéphane Marks
51498a88cf Add frame parameters 'cloned-from' and 'undeleted' (bug#80104)
* lisp/frame.el (clone-frame): Set the frame parameter
'cloned-from'.
(undelete-frame): Set the frame parameter 'undeleted'.
* src/frame.c (syms_of_frame): <Qcloned_from> <Qundeleted>: New
DEFSYM.
(syms_of_frame): Add 'Qcloned_from' and 'Qundeleted' to
'frame_internal_parameters'.
* doc/lispref/frames.texi: Document these frame parameters.
* etc/NEWS: Announce the new frame parameters.
2026-01-03 09:28:03 +01:00
Michael Albinus
4606510f65 ; * src/lread.c (Feval_buffer): Fix typo in docstring. 2026-01-03 09:24:29 +01:00
Eli Zaretskii
b51c95c1c7 ; Fix documentation of recent treesit changes
* etc/NEWS:
* src/treesit.c (Ftreesit_query_eagerly_compiled_p):
* doc/lispref/parsing.texi (Pattern Matching): Fix documentation
of the recent treesit-related changes.  (Bug#80108)
2026-01-02 14:48:58 +02:00
Yuan Fu
ad500a13e4
Compile queries in treesit-f-l-recompute-features (bug#80108)
The direct cause of the problem in the bug report is that when
user runs treesit-font-lock-recompute-features to add the
emacs-devel feature in c-ts-mode's mode hook, the added query
for emacs-devel aren't compiled.

This change consists of two parts:
1. The immediate fix: validate and compile queries in
treesit-font-lock-recompute-features.
2. To make it more fool-proof, change treesit-font-lock-rules
back to compile the queries and make
treesit--compile-query-with-cache support compiled queries. This
way, as long as the query goes through treesit-font-lock-rules,
it'll be compiled eventually and not cause slow-down. I had to
add some c-level functions, but they're kind of overdue anyway,
so I don't have any problem adding them to the API.

* lisp/treesit.el (treesit--compile-query-with-cache): Support
compiled queries.
(treesit-font-lock-rules): Compile the queries (but not
eagerly).
(treesit-font-lock-recompute-features): Validate and compile
queries.
(treesit-major-mode-setup): Remove call to
treesit-validate-and-compile-font-lock-rules since it's now
called in treesit-font-lock-recompute-features.

* src/treesit.c (Ftreesit_query_eagerly_compiled_p):
(Ftreesit_query_source): New functions.

* doc/lispref/parsing.texi (Pattern Matching): Add manual
entries for the new functions.
2026-01-01 23:21:27 -08:00
Po Lu
0db173fa23 ; * src/keyboard.c (is_ignored_event): Delete redundant assignment. 2026-01-02 10:02:47 +08:00
Sean Whitton
c31f6adc31 ; Add 2026 to copyright years. 2026-01-01 12:54:34 +00:00
Sean Whitton
7fa5c7e07b ; * src/keyboard.c (is_ignored_event): Fix last change. 2026-01-01 11:02:57 +00:00
Po Lu
ef12da4ba1 Don't permit special configuration events to trigger `throw-on-input'
* src/keyboard.c (init_while_no_input_ignore_events): Ignore
Qmonitors_changed and Qtoolkit_theme_changed events.
(is_ignored_event): Assign symbols to
{MONITOR_CHANGED,TOOLKIT_THEME_CHANGED}_EVENT.
(syms_of_keyboard) <Qmonitors_changed>
<Qtoolkit_theme_changed>: New symbols.  (bug#80022)
2026-01-01 10:24:49 +08:00
Martin Rudalics
258b5778c2 Inhibit looping in resize_mini_window (Bug#80017)
* src/xdisp.c (redisplay_window): Don't call resize_mini_window
when the minibuffer is active and minibuffer-only frames shall
be resized automatically since that can loop infinitely (Bug#80017).
2025-12-30 09:04:09 +01:00
Paul Eggert
481ad70d5c December 2025 spelling fixes
Some of the fixes are to continue to use American
rather than British spelling.
* doc/misc/modus-themes.org (my-modus-themes-engraved-faces):
Fix misspelled ‘:foreground’s.
* etc/themes/modus-themes.el (modus-themes-faces):
Fix misspelled ‘modus-themes-bold’.
* lisp/emacs-lisp/rx.el (rx--normalize-char-pattern):
Rename from rx--normalise-char-pattern.
(rx--optimize-or-args):	Rename from rx--optimise-or-args.
* lisp/frame.el (frame--special-parameters):
Fix misspelled "right-divider-width".
* lisp/net/tramp.el (tramp-fingerprint-prompt-regexp):
Use American spelling “centered”, to match current libfprintf.
* lisp/org/org-fold-core.el (org-fold-core--optimize-for-huge-buffers):
Rename from org-fold-core--optimise-for-huge-buffers.
(org-fold-core-update-optimization):
Rename from org-fold-core-update-optimisation,
leaving an alias behind.
(org-fold-core-remove-optimization):
Rename from org-fold-core-remove-optimisation,
leaving an alias behind.
* lisp/org/org.el (org-advertized-archive-subtree):
This alias is now obsolete.
* lisp/play/zone.el (zone-ignored-buffers):
Fix misspelling of ‘zone--buffer-encrypted-p’.
* lisp/progmodes/csharp-mode.el (csharp-ts-mode-faces):
Fix misspelling of ‘csharp’ group.
* lisp/vc/vc.el (vc-clonable-backends-custom-type):
Rename from vc-cloneable-backends-custom-type,
leaving an alias behind.
* test/lisp/emacs-lisp/bytecomp-tests.el:
(bytecomp-tests--warn-arity-non-compiled-callee):
Rename from bytecomp-tests--warn-arity-noncompiled-callee.
(bytecomp-test-defface-spec): Reword a deliberate misspelling
of “default” that is so common I don’t want it to pollute the
spelling dictionary.
* test/lisp/emacs-lisp/package-vc-tests.el:
(package-vc-tests-preserve-artifacts):
Rename from package-vc-tests-preserve-artifacts.
* test/lisp/eshell/em-prompt-tests.el:
(em-prompt-test/forward-backward-paragraph-1):
Reword a deliberate misspelling of “goodbye” that is so common I
don’t want it to pollute the spelling dictionary.
2025-12-26 10:22:12 -08:00
Stéphane Marks
d576216adb Add ns_set_window_size_and_position
* src/frame.c (Fset_frame_size_and_position_pixelwise): Correct
docstring typo.
* src/nsterm.m (compute_offset): New function of common code.
(ns_set_offset): Call compute_offset.
(ns_set_window_size_and_position): New function.
(ns_create_terminal): Add new function to the hook.
2025-12-24 16:32:04 +01:00
Stéphane Marks
b3aa0a652c In Fns_progress_indicator fix GNUstep enum spelling (bug#79859)
* src/nsfns.m (Fns_progress_indicator): GNUstep spells its level
indicator enum NSContinuousCapacityLevelIndicatorStyle vs. macOS
NSLevelIndicatorStyleContinuousCapacity.
2025-12-24 16:24:19 +01:00
Eli Zaretskii
2566f26e0a Improve documentation of 'word-combining-categories'
* src/category.c (syms_of_category) <word-combining-categories>:
Doc fix.  (Bug#80042)
2025-12-24 15:47:06 +02:00
Gerd Möllmann
39badb5a38 ; * src/frame.c (Fmake_frame_invisible): Don't skip setting frame invisible. 2025-12-23 04:39:28 +01:00
Po Lu
b0140bcd44 Implement set_window_size_and_position_hook on Android
* java/org/gnu/emacs/EmacsWindow.java (moveResizeWindow): New
method, which alters all of the bounding box of a window at
once.

* src/android.c (android_init_emacs_window): Load method
`move_resize_window'.
(android_move_resize_window): Invoke this method, rather than a
sequence of operations that will produce two ConfigureNotify
events.

* src/androidterm.c (android_set_window_size_and_position_1)
(android_set_window_size_and_position): New functions; ported
from X.
(android_create_terminal): Register the same.
2025-12-23 10:39:45 +08:00
Gerd Möllmann
575dc8e534 Fix handling of border face on tty child frames (bug#80043)
* src/dispnew.c (box_from_display_table, box_default,
box_glyph): New functions, extracted from produce_box_glyphs.
(box_from_display_table): Merge face nwith glyph's face.
(box_default): Lookup face.
(produce_box_glyphs): Use new functions.
2025-12-22 15:00:42 +01:00
Eli Zaretskii
acb91f501c ; Improve documentation of 'font-spec'
* src/font.c (Ffont_spec):
* doc/lispref/display.texi (Low-Level Font): More accurate
documentation of 'font-spec's arguments.
2025-12-22 15:36:11 +02:00
Mattias Engdegård
ca5d0de3e5 ; * src/editfns.c (styled_format): fix build for C99 compilers 2025-12-22 11:12:43 +01:00
Martin Rudalics
f3d9371a89 Add functions to set frame size and position in one compound step
* lisp/frame.el (set-frame-size-and-position): New function.
* src/frame.c (adjust_frame_size): Handle requests to set size
and position.
(Fset_frame_size_and_position_pixelwise): New function.
* src/gtkutil.c (xg_frame_set_size_and_position): New function.
(xg_wm_set_size_hint): Handle any non-NorthWestGravity values
for child frames only.  Some GTK implementations don't like
them.
* src/gtkutil.h (xg_frame_set_size_and_position.): Add external
declaration.
* src/termhooks.h (set_window_size_and_position_hook): New hook.
* src/w32term.c (w32_set_window_size_and_position): New
function.
(w32_create_terminal): Make it the Microsoft Windows API
set_window_size_and_position_hook.
* src/xterm.c (x_set_window_size_and_position_1)
(x_set_window_size_and_position): New functions.
(x_create_terminal): Make x_set_window_size_and_position the
set_window_size_and_position_hook for the X protocol.
* src/xterm.h (x_set_window_size_and_position): Add external
declaration.
* etc/NEWS: Announce new functions.
2025-12-22 11:01:53 +01:00
Paul Eggert
5cf8af2290 Simplify new %b/%B code many years from now
* src/editfns.c (styled_format): Do %b and %B with sprintf if
sprintf is known to support them.  This will let us simplify this
code many years from now.  (Bug#79990)
2025-12-22 00:15:09 -08:00