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`.
* 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>.
* 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)
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.
* 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)
* 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)
* 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.
* 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.
* 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).
* 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.
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.
* 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)
* 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).
* 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)
* 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.
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.
* 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).
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.
* 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.
* 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.
* 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.
* 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.
* 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)