aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Pacify GCC with gdk-pixbuf 2.44Paul Eggert2026-02-132-0/+34
| | | | | | | | * src/pgtkfns.c (xg_set_icon_from_xpm_data): * src/xfns.c (xg_set_icon_from_xpm_data): gdk-pixbuf 2.44 (2025-09) deprecated xg_set_icon_from_xpm_data, and this breaks --enable-gcc-warnings builds. For now, pacify GCC by using a pragma.
* Remove vla.hPaul Eggert2026-02-132-2/+0
| | | | | | | | Uses of <vla.h>’s macro VLA_ELEMS were removed some time ago. * admin/merge-gnulib (GNULIB_MODULES): Remove vla. * lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate. * lib/vla.h: Remove. * src/fns.c, src/lread.c: Do not include <vla.h>.
* Rewrite flex completion with Gotoh algorithmJoão Távora2026-02-131-0/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The greedy regexp matching, broken scoring and broken highlight were sources of frequent complaints about the 'flex' matching style. This commit fixes that. Inspired by the 'hotfuzz' style (available at https://github.com/axelf4/hotfuzz) it uses a modified version of Gotoh's 1982 dynamic programming algorithm. It is strictly more correct than the "old" flex. For example, when matching the pattern 'goto' to no longer will 'eglot-format' be sorted before some hypothetical much better 'goobarbaz-goto'. And of course the highlighting is also correctly placed on the 'goto', not scattered across the candidate. Regarding performance, it is faster than the naive 'flex', primarily because of the Elisp rewrite in minibuffer.el. The matching and costing algorithm matters but is not the bottleneck. The Elisp parts of the style were almost completely decoupled from the pcm/substring styles in lisp/minibuffer.el. Only 'completion-flex-try-completion' uses some of pcm's code for pattern augmentation. * src/minibuf.c (completion--flex-cost-gotoh): New function. * lisp/minibuffer.el (completion-flex--pattern-str): New variable. (flex-score-match-tightness): Make obsolete. (completion--flex-all-completions-1): New helper function. (completion-flex-try-completion, completion-flex-all-completions): Rewrite. (completion-substring--all-completions): No longer take transform-pattern-fn. (completion--flex-adjust-metadata): Tweak. (completion--flex-score, completion--flex-score-1) (completion--flex-score-last-md, completion-flex--make-flex-pattern): Delete. * test/lisp/minibuffer-tests.el (completion--sorted-flex-completions): New helper function. (completion-flex-test-non-ascii): New test. (completion--pcm-score): Delete. (completion-pcm-test-3, completion-pcm-test-4) (completion-substring-test-1, completion-substring-test-2) (completion-flex-test-2, completion-flex-test-3): Tweak. * etc/NEWS: Describe change.
* ; * src/dispnew.c (box_default): Shut up compilation warnings (bug#80386).Eli Zaretskii2026-02-123-3/+3
|
* * src/lisp.h (struct Lisp_Fwd): Add comments.Helmut Eller2026-02-121-5/+5
|
* Move the Lisp_Fwd.bufoffset field back to the unionHelmut Eller2026-02-123-10/+16
| | | | | | | | * src/lisp.h (struct Lisp_Fwd): With the predicate enum, we can now pack the offset and the predicate into a one-word struct. (XBUFFER_OFFSET): Use the new field name. * src/buffer.c (DEFVAR_PER_BUFFER): Create the one-word struct. * src/data.c (store_symval_forwarding): Use the new field name.
* Introduce an enum Lisp_Fwd_PredicateHelmut Eller2026-02-123-45/+77
| | | | | | | | | | | | Using an enum instead of a symbol makes it obvious that this field is of no concern to the GC. * src/lisp.h (enum Lisp_Fwd_Predicate): New. (struct Lisp_Fwd): Use it instead of a symbol. * src/buffer.c (DEFVAR_PER_BUFFER): Create the necessary enum constant instead of a symbol. * src/data.c (check_fwd_predicate, check_choice): New helpers. (store_symval_forwarding): Use it.
* Remove struct Lisp_Buffer_ObjfwdHelmut Eller2026-02-123-39/+39
| | | | | | | | | | | | | | * src/lisp.h (struct Lisp_Buffer_Objfwd): Deleted. (struct Lisp_Fwd): Add the fields bufoffset and bufpredicate. Make the type a 1-byte bitfield so that the entire struct still fits in two words. (XBUFFER_OFFSET): Renamed from XBUFFER_OBJFWD. * src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer) (buffer_local_value): Update accordingly. * src/data.c (do_symval_forwarding, store_symval_forwarding) (set_internal, default_value, set_default_internal) (Fmake_local_variable, Fkill_local_variable, Flocal_variable_): Use XBUFFER_OFFSET.
* Remove struct Lisp_Kboard_ObjfwdHelmut Eller2026-02-122-19/+10
| | | | | | | | | * src/lisp.h (struct Lisp_Kboard_Objfwd): Deleted ... (struct Lisp_Fwd): ... replaced with field kbdoffset. (DEFVAR_KBOARD): Use new field. * src/data.c (XKBOARD_OFFSET): Renamed from XKBOARD_OBJFWD. (do_symval_forwarding, store_symval_forwarding (set_default_internal): Use it .
* Remove struct Lisp_ObjfwdHelmut Eller2026-02-124-29/+20
| | | | | | | | | | * src/lisp.h (struct Lisp_Objfwd): Deleted. (struct Lisp_Fwd): Replace it with objvar field. (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_LISP_NOPROX): Use the field. * src/lread.c (defvar_lisp): Updated as needed. * src/pdumper.c (dump_field_fwd): Use the field. * src/data.c (XOBJVAR): Renamed and updated from XOBJFWD. (do_symval_forwarding, store_symval_forwarding): Use it.
* Remove struct Lisp_BoolfwdHelmut Eller2026-02-123-18/+9
| | | | | | | | | * src/lisp.h (struct Lisp Boolfwd): Deleted (struct Lisp_Fwd): Replaced it with a boolvar field. (DEFVAR_BOOL): Update. * src/data.c (XBOOLVAR): Renamed from XBOOLFWD. (do_symval_forwarding, store_symval_forwarding): Use it. * src/pdumper.c (dump_field_fwd): Use boolvar field.
* Remove struct Lisp_IntfwdHelmut Eller2026-02-123-23/+13
| | | | | | | | | | It was a struct with a single field. * src/lisp.h (struct Lisp_Intfwd): Deleted. (struct Lisp_Fwd): Add an intvar field instead. (DEFVAR_INT): Update accordingly. * src/data.c (XINTVAR): Updated and renamed from XFIXNUMFWD. (do_symval_forwarding, store_symval_forwarding): Use it.
* Introduce a struct Lisp_FwdHelmut Eller2026-02-125-162/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains the type and an union of Lisp_Objfwd, Lisp_Intfwd etc. lispfwd is now a pointer to a struct Lisp_Fwd; the void *fwdptr field is gone. * src/lisp.h (struct Lisp_Fwd): New. (Lisp_Intfwd, Lisp_Boolfwd, Lisp_Objfwd, Lisp_Buffer_Objfwd) (Lisp_Kboard_Objfwd): The type is in in Lisp_Fwd. (lispwfd): Is now a pointer to struct Lisp_Fwd. (SYMBOL_BLV, SET_SYMBOL_FWD, XFWDTYPE, BUFFER_OBJFWDP): Update accordingly. (defvar_lisp, defvar_lisp_nopro, defvar_bool, defvar_int) (defvar_kboard): These all take now a Lisp_Fwd. (DEFVAR_LISP, DEFVAR_LISP_NOPRO, DEFVAR_BOOL, DEFVAR_INT) (DEFVAR_KBOARD): Update for new types. * src/lread.c (defvar_int, defvar_bool, defvar_lisp_nopro) (defvar_lisp, defvar_kboard): Update for new types. * src/pdumper.c (dump_field_fwd, dump_blv): Update accordingly. (dump_fwd_int, dump_fwd_bool, dump_fwd_obj, dump_fwd_buffer_obj) (dump_fwd): Deleted. * src/buffer.c (DEFVAR_PER_BUFFER, defvar_per_buffer, buffer_local_value) (set_buffer_internal_1): Update accordingly for new types. * src/data.c (XBOOLFWD, XKBOARD_OBJFWD, XFIXNUMFWD, XOBJFWD, boundp) (store_symval_forwarding, swap_in_global_binding) (swap_in_symval_forwarding, find_symbol_value, set_internal) (default_value, set_default_internal, make_blv, Fmake_local_variable): Update accordingly.
* Make Lisp_Buffer_Objfwd objects constHelmut Eller2026-02-122-94/+84
| | | | | | | | | | | | | The predicate field is always a builtin symbol. That means we know the bit pattern at compile-time and they don't change at runtime. * src/buffer.c (DEFVAR_PER_BUFFER): Create a const struct. (defvar_per_buffer): Remove predicate and address arguments. (syms_of_buffer): Instead of &BVAR (current_buffer, foo) use a plain foo as argument to DEFVAR_PER_BUFFER. * src/pdumper.c (dump_field_fwd): No more relocs needed for Lisp_Fwd_Buffer_Obj and we can't apply them in the .rodata section.
* Don't dump lispfwd objectsHelmut Eller2026-02-121-22/+47
| | | | | | | | | | The forwarding structs already exist in the data or bss section. They are all created with DEFVAR_INT and similar macros. Instead of creating new structs in the dump, create relocs to the data section. * src/pdumper.c (dump_field_fwd): New. (dump_blv, dump_symbol): Use it. (dump_pre_dump_symbol): Don't dump fwd objects.
* Make 'overlays_in' use only real EOB (bug#80242)Stephen Berman2026-02-121-7/+6
| | | | | | | | | | | | This restores the original behavior of 'overlays_in'. Changes in this behavior had been made for cases of narrowing, but this resulted in a regression with uses of 'remove-overlays'. * src/buffer.c (overlays_in): Change all occurrences of ZV to Z. * test/src/buffer-tests.el (test-overlays-in-2) (test-remove-overlays): Adjust expected results to accommodate changes in 'overlays_in'.
* Move ns_init_colors from ns_term_init to emacs.c (bug#80377)Stéphane Marks2026-02-122-48/+62
| | | | | | | | | | | | Accommodate NS Emacs on a headless system. Add error checking for failed calls to NSColorList writeToURL and writeToFile. * src/nsterm.m (ns_term_init): Move color initialization to nsfns.m. * src/nsfns.m (ns_init_colors): New function. (Fns_list_colors): Call ns_init_colors.
* Scale position values in xg_frame_set_size_and_positionMartin Rudalics2026-02-121-0/+2
| | | | | * src/gtkutil.c (xg_frame_set_size_and_position): Scale position values.
* ; Fix recently installed changesEli Zaretskii2026-02-112-10/+7
| | | | | | | | | | | | | | * src/w32fns.c (w32_register_for_sleep_notifications) (sleep_notification_callback): Fix signatures. * src/w32term.h (w32_register_for_sleep_notifications): Fix prototype. These changes avoid compilation warnings. * lisp/system-sleep.el: Remove stray non-ASCII character. * doc/lispref/os.texi (System Sleep): Remove non-ASCII character, and fix wording and markup. * etc/NEWS: Fix wording of recently-added entry.
* system-sleep sleep blocker and sleep/wake event package (bug#80348)Stéphane Marks2026-02-116-9/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This package provides platform-neutral interfaces to block your system from entering idle sleep and a hook to process pre-sleep and post-wake events. Implementations are for D-Bus on GNU/Linux, macOS/GNUstep, and MS-Windows. * lisp/system-sleep.el: New package. * src/fns.c: Qpre_sleep, Qpost_wake: New DEFSYM. * src/nsfns.m (Fns_block_system_sleep, Fns_unblock_system_sleep) (syms_of_nsfns): New functions. * src/nsterm.m (applicationDidFinishLaunching): Subscribe to pre-sleep and post-wake notifications. (systemWillSleep, systemDidWake): New function. * src/w32fns.c (Fw32_block_system_sleep) (Fw32_unblock_system_sleep, Fw32_system_sleep_block_count) (sleep_notification_callback) (w32_register_for_sleep_notifications): New function. (syms_of_w32fns): Sw32_unblock_system_sleep Sw32_block_system_sleep Sw32_system_sleep_block_count: New defsubr. * src/w32term.h (Fw32_block_system_sleep): New extern. * src/w32term.c (w32_initialize): Call w32_register_for_sleep_notifications. * doc/lispref/os.texi: Document the system-sleep package. * doc/lispref/commands.texi: Update sleep-event special documentation. * etc/NEWS: Announce the new package.
* * src/process.c (server_accept_connection): Fix assertion (bug#80237).Eli Zaretskii2026-02-101-2/+6
|
* Support D-Bus file descriptor manipulationMichael Albinus2026-02-071-83/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/dbus.texi (Synchronous Methods): Adapt `dbus-call-method'. (Asynchronous Methods): Adapt `dbus-call-method-asynchronously'. (File Descriptors): New chapter, replaces Inhibitor Locks. * etc/NEWS: Replace "New D-Bus functions to support systemd inhibitor locks" by "Support D-Bus file descriptor manipulation". Presentational fixes and improvements. * lisp/net/dbus.el (dbus-call-method) (dbus-call-method-asynchronously): Adapt docstring. (dbus-list-hash-table): Return (nreverse result). (dbus-monitor-goto-serial): Declare `completion'. * src/dbusbind.c (Fdbus_message_internal, xd_read_message_1): Handle `:keep-fd'. (xd_registered_inhibitor_locks, Fdbus_make_inhibitor_lock) (Fdbus_close_inhibitor_lock, Fdbus_registered_inhibitor_locks): Delete. (xd_registered_fds): New variable. (Fdbus__fd_open, Fdbus__fd_close, Fdbus__registered_fds): New DEFUNs. (Bug#79963) (syms_of_dbusbind_for_pdumper): Initialize `xd_registered_fds'. (syms_of_dbusbind): Remove subroutines `Sdbus_make_inhibitor_lock', `Sdbus_close_inhibitor_lock' and `Sdbus_registered_inhibitor_locks'. Remove symbol `Qdbus_call_method'. Declare subroutines `Sdbus__fd_open', `Sdbus__fd_close' and `Sdbus__registered_fds'. Declare symbol `QCkeep_fd'. staticpro `xd_registered_fds'. * test/lisp/net/dbus-tests.el (dbus-test10-inhibitor-locks): Delete. (dbus-test10-keep-fd, dbus-test10-open-close-fd): New tests.
* Minor improvements in vertical cusror motionEli Zaretskii2026-02-011-2/+4
| | | | | | | | | | | * src/xdisp.c (move_it_vertically_backward): Zero out cached value of line height, to avoid using stale and incorrect values. (try_window_reusing_current_matrix): Fix conditions for changes in tab-line height. Reported by Michael Heerdegen <michael_heerdegen@mailbox.org> in https://lists.gnu.org/archive/html/help-gnu-emacs/2026-01/msg00163.html This improves the scrolling a little bit, but doesn't solve the problem entirely.
* Fix macOS 26 (Tahoe) scrolling lag and input handling issuesBoris Buliga2026-01-311-0/+9
| | | | | | | | | | | | macOS 26 introduced new event processing behavior that causes scrolling lag and input handling problems in Emacs. This patch disables two features via NSUserDefaults when built against the macOS 26 SDK: - NSEventConcurrentProcessingEnabled - NSApplicationUpdateCycleEnabled This fix is based on the equivalent patch in emacs-mac by Mitsuharu Yamamoto. See: https://bitbucket.org/mituharu/emacs-mac/commits/e52ebfd * src/nsterm.m (ns_term_init): Disable problematic event processing when built for macOS 26+. (Bug#80268)
* xsettings: honor GDK DPI scaling valuesDaniel Colascione2026-01-301-1/+31
| | | | | | | | | | | Some XWayland setups only report DPI changes through GDK xsettings, so Emacs missed DPI updates there. Recognize the GDK DPI and scaling settings and use them to compute the effective DPI. * src/xsettings.c (parse_settings): Recognize Gdk/UnscaledDPI and Gdk/WindowScalingFactor. Use them to compute DPI when present.
* Avoid interference between child frame deletion and recenteringEli Zaretskii2026-01-291-0/+27
| | | | | | | | | * src/frame.c (delete_frame) [HAVE_X_WINDOWS]: Block input while child frame is displayed, and process the X events triggered by that later. Patch by Byakuren (https://web.liminal.cafe/~byakuren/). (Bug#76186) Copyright-paperwork-exempt: yes
* ; Fix MS-Windows build broken by recent treesit.c changesEli Zaretskii2026-01-281-4/+4
| | | | | | * src/treesit.c (ts_tree_cursor_copy) [WINDOWSNT]: Remove, as it is no longer used. (ts_tree_cursor_goto_previous_sibling) [WINDOWSNT]: Add. (Bug#80108)
* Always unset lisp_data when freeing imagesBasil L. Contovounesios2026-01-281-30/+4
| | | | | | | | | | | | | | Historically only the GIF code did this (since it stores animation metadata in lisp_data), and recently the WebP code followed suit. The benefit of clearing lisp_data is not 100% clear (to me: bug#66221#41), but it probably can't hurt, so do it unconditionally for all image types to simplify conditional compilation and avoid warnings (bug#80266). * src/image.c (image_clear_image): Set lisp_data to nil. [HAVE_GIF || HAVE_WEBP] (gif_clear_image): [HAVE_IMAGEMAGICK] (imagemagick_clear_image): Remove, replacing all uses with image_clear_image.
* Fix tree-sitter traversal slowness (bug#80108)Yuan Fu2026-01-281-42/+6
| | | | | | | | * configure.ac (LIBSYSTEMD_CFLAGS): Increase minimal required tree-sitter version to 0.20.10. * src/treesit.c (treesit_traverse_sibling_helper): When traversing forward, use the new function ts_tree_cursor_goto_previous_sibling.
* ; Avoid warnings when neither GIF nor WebP are supportedPo Lu2026-01-271-0/+4
| | | | | * src/image.c (gif_clear_image): Render contingent on HAVE_GIF || HAVE_WEBP.
* Fix image.c compilation when HAVE_GIF is not definedEli Zaretskii2026-01-261-0/+4
| | | | | * src/image.c (gif_clear_image): Make it available for other image types. (Bug#80266)
* (read_char_minibuf_menu_prompt): Fix bug#80146Stefan Monnier2026-01-261-8/+11
| | | | | | * src/keyboard.c (read_char_minibuf_menu_prompt): Give priority to a binding in the map over the `menu_prompt_more_char` "binding". (follow_key): Move before new first use.
* Fix point-adjustment when overlays are specific to windowsEli Zaretskii2026-01-261-4/+6
| | | | | * src/keyboard.c (adjust_point_for_property): Consider only overlays associated with the selected window. (Bug#80255)
* ; * src/buffer.h: Mention indirect buffers in 'buffer_window_count' commentMartin Rudalics2026-01-251-1/+3
|
* ; * src/pdumper.c (dump_buffer): Update hash.Basil L. Contovounesios2026-01-241-1/+1
| | | | | This follows the commit of 2026-01-24 "Support cons cell for 'line-spacing'".
* Improve (WebP) image animationBasil L. Contovounesios2026-01-241-211/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for animations with heterogeneous frame durations without sacrificing CPU (bug#47895), and plugs a memory leak in and speeds up WebP animations (bug#66221). * lisp/image.el (image-animate): No need to stash image-multi-frame-p data here, as image-animate-timeout now refetches it for each animation frame. (image-show-frame): Fetch image-multi-frame-p anew when checking bounds; a cached value risks going stale. This is not on the hot path for animations, and is mainly used when framewise stepping through an animation interactively. (image-animate-timeout): Fetch current frame duration anew but do so before image-show-frame to ensure an image cache hit (bug#47895, bug#66221). Include time taken by local arithmetic in 'time-to-load-image'. Update commentary. * src/image.c (parse_image_spec): Simplify using FIXNATP. (filter_image_spec): Remove check for :animate-multi-frame-data as it is no longer used by image.el. [HAVE_ANIMATION && HAVE_GIF] (struct gif_anim_handle): [HAVE_ANIMATION && HAVE_WEBP] (struct webp_anim_handle): New structures formalizing animation cache handles, and allowing for more than two custom fields per image type. (struct anim_cache): Replace generic handle and temp pointers with a union of gif_anim_handle and webp_anim_handle. All uses updated. Update destructor signature accordingly. (anim_create_cache): Use xzalloc to zero-initialize both integer and pointer fields. Initialize frames, width, height to -1 for consistency with index. Mark as ATTRIBUTE_MALLOC. (anim_prune_animation_cache): Check whether destructor (not handle) is null before calling it. (gif_clear_image): Note in commentary that WebP also uses it. (gif_destroy): Free pixmap here now that prune_anim_cache no longer does it automatically. Remove unused gif_err variable. (gif_load): Avoid UB from casting destructor to a different type. Don't redundantly check for null before xfree. Change default frame delay from 15fps to t, which image-multi-frame-p will translate into image-default-frame-delay, which the user can control. [HAVE_WEBP && WINDOWSNT] (init_webp_functions): Reconcile library definitions with current webp_load implementation. (webp_destroy): Free owned copy of input WebP bitstream contents. (webp_load): Ownership of both input and decoded memory is a function of :data vs :file and animated vs still. Make this and transfers of ownership to animation cache clearer by using distinct copy/view variables. Also make resource freeing clearer by using a single unconditional cleanup and exit path. Check animation cache early to avoid rereading bitstream and reparsing headers on each call. Remove redundant call to WebPGetInfo since WebPGetFeatures does the same thing. Check more libwebpdemux return values for failure and fix file name reported in error messages. Remove unset local variable 'file'. If requested :index is ahead, fast-forward instead of restarting from first frame. If requested :index is behind, reset animation decoder to first frame instead of deleting and recreating it. Reuse animation decoder's own WebPAnimInfo and WebPDemuxer instance instead of creating and deleting a separate WebPDemuxer. Fix leak when copying :data to animation cache. Fix frame duration calculation, and return each frame's own duration now that image.el supports it. Return t as a default frame duration, as per gif_load. Consistently use WebPBitstreamFeatures to simplify control flow. Don't pollute lisp_data image-metadata for still images with animation-related properties. (image_types) [HAVE_WEBP]: Use gif_clear_image to clear lisp_data for consistency with GIF code. (syms_of_image): Remove QCanimate_multi_frame_data; no longer used.
* Improve animation cache documentationBasil L. Contovounesios2026-01-241-22/+37
| | | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Image Cache): Document animation cache argument that clear-image-cache gained in Emacs 29 (bug#56546, bug#66221). * lisp/image.el (image-animate-timeout): Note limitation of clear-image-cache with ImageMagick. * src/image.c (Fclear_image_cache): Rename animation-cache argument to animation-filter and expand its description for clarity. (struct anim_cache, anim_create_cache, image_prune_animation_caches): Improve commentary. (mark_image_cache): Replace stale commentary that referred to forall_images_in_image_cache with description of mark_image_cache. [HAVE_IMAGEMAGICK] (struct animation_cache): Mention lack of clear-image-cache support in commentary.
* Support cons cell for 'line-spacing'Daniel Mendler2026-01-248-30/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: Announce the change. * src/dispextern.h (struct glyph_row): Add 'extra_line_spacing_above' member. (struct it): Add 'extra_line_spacing_above' member. * src/frame.h (struct frame): Add 'extra_line_spacing_above' member. Update comment for 'extra_line_spacing.' * src/buffer.c (syms_of_buffer): Update the docstring of 'line-spacing' to describe the cons cell usage. * src/buffer.h (struct buffer): Update comment for 'extra_line_spacing'. * src/frame.c (gui_set_line_spacing): Handle cons cell value for 'line-spacing'. Calculate and set 'extra_line_spacing_above' for both integer and float pairs. * src/xdisp.c (init_iterator): Initialize 'extra_line_spacing_above' from buffer or frame 'line-spacing', handling cons cells for both integer and float values. (gui_produce_glyphs): Use 'extra_line_spacing_above' to distribute spacing between ascent and descent. Update 'max_extra_line_spacing' calculation. (resize_mini_window): Take line spacing into account when resizing the mini window. Pass height of a single line to 'grow_mini_window' and 'shrink_mini_window'. * src/window.c (grow_mini_window, shrink_mini_window): Add unit argument which defines height of a single line. * src/window.h (grow_mini_window, shrink_mini_window): Adjust function prototypes accordingly with unit argument. * lisp/subr.el (total-line-spacing): New function to calculate total spacing from a number or cons cell. (posn-col-row): Use total-line-spacing. * lisp/simple.el (default-line-height): Use 'total-line-spacing'. * lisp/textmodes/picture.el (picture-mouse-set-point): Use 'total-line-spacing'. * lisp/window.el (window-default-line-height): Use 'total-line-spacing'. (window--resize-mini-window): Take 'line-spacing' into account. * test/lisp/subr-tests.el (total-line-spacing): New test. * test/src/buffer-tests.el (test-line-spacing): New test. * doc/emacs/display.texi (Display Custom): Document that 'line-spacing' can be a cons cell. (Line Height): Document the new cons cell format for 'line-spacing' to allow vertical centering. Co-authored-by: Przemysław Alexander Kamiński <alexander@kaminski.se> Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
* ; Safer 'x-display-monitor-attributes-list'Eli Zaretskii2026-01-241-1/+2
| | | | | | | * src/xfns.c (Fx_display_monitor_attributes_list): Don't access more elements in monitor_frames than there are monitors reported by 'gdk_display_get_n_monitors' or 'gdk_screen_get_n_monitors'. (Bug#79941)
* Fix MS-Windows build broken by recent updates in MinGW64 headersEli Zaretskii2026-01-221-4/+0
| | | | | | | | | * nt/inc/ms-w32.h (strerror): Redirect to sys_strerror after including <string.h>, to prevent the linker from thinking it should be imported from some DLL. Reported by Richard Copley <rcopley@gmail.com>. * src/w32.c: Remove now unneeded prototype of sys_strerror.
* ; * src/alloc.c (Fgarbage_collect_heapsize): Avoid compiler warning.Eli Zaretskii2026-01-211-1/+1
|
* (garbage-collect-heapsize): New functionStefan Monnier2026-01-201-8/+23
| | | | | | | | | | | | | | | | | 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`.
* Don’t use C basename functionPaul Eggert2026-01-191-1/+1
| | | | | | | | | * 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/indent.c (Fvertical_motion): Fix last change. (Bug#80223)Eli Zaretskii2026-01-191-0/+1
|
* Fix vertical cursor motion across overlay stringsEli Zaretskii2026-01-191-1/+4
| | | | | * src/indent.c (Fvertical_motion): Fix vertical cursor motion when a screen line begins with an overlay string. (Bug#80223)
* ; * src/window.c (Fwindow_cursor_info): Fix commentary of last change.Eli Zaretskii2026-01-191-1/+3
|
* Fix box cursor width returned for stretch glyphRadioNoiseE2026-01-191-0/+12
| | | | | * src/window.c (Fwindow_cursor_info): Return canonical character width when on stretch glyph and `x-stretch-cursor' is nil. (Bug#80211)
* NS: Fix UI freezes and Lisp threads on GNUstepYavor Doganov2026-01-191-9/+5
| | | | | | | * 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)
* ; * src/dbusbind.c (Fdbus_registered_inhibitor_locks): Fix signature.Eli Zaretskii2026-01-181-1/+1
|
* Avoid overflows in image size calculationsPaul Eggert2026-01-171-7/+7
| | | | | | | | 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.