Commit graph

181049 commits

Author SHA1 Message Date
Po Lu
f949d5ab62 ; Update Android dependencies 2026-01-29 11:20:48 +08:00
Dmitry Gutov
dfc2a66ad8 xref-matches-in-directory and xref-matches-in-files: More consistency
* lisp/progmodes/xref.el (xref--parse-hits, xref--sort-hits):
Extract from xref-matches-in-directory and xref-matches-in-files.
Use in both for better consistency between these functions.
2026-01-28 23:48:04 +02:00
Dmitry Gutov
d44b855b0c xref-matches-in-directory: Don't error on "Binary file ... matches"
* lisp/progmodes/xref.el (xref-matches-in-directory):
Consider the "Binary file ... matches" message (bug#80246).
2026-01-28 22:10:34 +02:00
Stefan Monnier
fbe4d649c3 (loaddefs-generate--make-autoload): Try harder to find autoload-macro
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Try and (auto)load the macro in case that defines `autoload-macro`.
Simplify the code for the `loaddefs--defining-macros` case.
2026-01-28 13:43:36 -05:00
Przemysław Kryger
b370a076b9 Create package-vc-tests repositories once per tests run (bug#80235)
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-repos): New variable.
(package-vc-tests-create-repository): Add argument `repos-dir'.
(package-vc-tests-make-temp-dir): Create a temporary directory
with prefix.
(package-vc-with-tests-environment): Use
`package-vc-tests-make-temp-dir' to create a temporary directory
for package test.  Use `package-vc-tests-repos' to cache test
package repository.
(package-vc-tests-preserve-pkg-artifacts-p): Detect when to
preserve package temporary files.
(package-vc-tests-environment-tear-down): Use
`package-vc-tests-preserve-pkg-artifacts-p'.  Use plural there
are more than one buffer.  Report temporary directory with test
repository.
(package-vc-tests-add-ert-run-tests-listener): Wrap listener in
args with custom functionality for `package-vc-tests'.  On tests
run start reset `package-vc-tests-repos' cache.  On tests run
end delete temporary directories.
2026-01-28 18:44:06 +01:00
Sean Whitton
43d6907ad9 Move outstanding changes commands from 'o' to 'T'
The main reason for this is that then these commands can have
the same bindings in VC-Dir buffers that they have under
vc-prefix-map.  'T' is a good mnemonic for "Topic" and a
serviceable mnemonic for "outsTanding".

* lisp/vc/vc-hooks.el (vc-prefix-map): Move 'o' to 'T'.
* lisp/vc/vc-dir.el (vc-dir-mode-map): New 'T' bindings.
2026-01-28 16:13:47 +00:00
Eli Zaretskii
08b7739cf1 ; Fix MS-Windows build broken by recent treesit.c changes
* 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)
2026-01-28 14:09:12 +02:00
Michael Albinus
aaa505025f Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2026-01-28 12:44:30 +01:00
Michael Albinus
8c84a2ae71 New Tramp test
* test/lisp/net/tramp-tests.el (tramp-test45-force-remote-file-error):
New test.
2026-01-28 12:43:38 +01:00
Basil L. Contovounesios
f9080e9bc0 Always unset lisp_data when freeing images
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.
2026-01-28 10:29:46 +01:00
Basil L. Contovounesios
89dad01763 ; Fix last change to test/src/process-tests.el. 2026-01-28 10:29:46 +01:00
Yuan Fu
69dc5d3f0e
Fix tree-sitter traversal slowness (bug#80108)
* 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.
2026-01-28 01:08:52 -08:00
Daniel Mendler
32cffe1707 Customizable xref-references-in-directory backend
Optionally use find and grep directly instead of going through the
Semantic framework (bug#80246).

* lisp/progmodes/project.el (project--vc-ignores): Require 'vc' to
ensure that vc-default-ignore-completion-table is available.

* lisp/progmodes/xref.el (xref-references-in-directory-function):
New user option.
(xref-references-in-directory): Call it.
(xref-references-in-directory-grep): Implementation based on find/grep.
(xref-references-in-directory-semantic): Implementation using Semantic.
(xref-matches-in-directory): Add new argument DELIMITED.

Co-authored-by: Dmitry Gutov <dmitry@gutov.dev>
2026-01-28 04:38:58 +02:00
Michael Albinus
d09cedc9bf ; Instrument filenotify test
* test/lisp/filenotify-tests.el (file-notify-test08-backup):
Instrument test.
2026-01-27 18:49:37 +01:00
Michael Albinus
50bb4ae1eb ; * test/src/process-tests.el: Instrument for bug#80166. 2026-01-27 18:39:47 +01:00
Michael Albinus
7fa90d50c6 Organize tramp-adb-handle-make-process a little bit better
* lisp/net/tramp-adb.el (tramp-adb-handle-make-process):
Call `tramp-taint-remote-process-buffer' where it belongs to.
2026-01-27 18:25:05 +01:00
Stefan Monnier
6e2a4b8111 (pcase--subtype-bitsets): Make it a bit more precise
`null`, `booleanp`, and `symbolp` were treated as equivalent in
`pcase--subtype-bitsets`, which was not incorrect to the extent
that we currently use this table only to detect
mutual-exclusion, but made it incorrect to use that same table
to test things like inclusion.

* lisp/emacs-lisp/cl-preloaded.el (built-in-class): New slot
`non-abstract-supertype`.
(cl--define-built-in-type): Add corresponding keyword argument.
(symbol, boolean): Use it.

* lisp/emacs-lisp/pcase.el (pcase--subtype-bitsets): Use it.

* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Require `help`
before calling `help--docstring-quote`.  Fixes a corner case bootstrap
problem found along the way.
2026-01-27 11:17:37 -05:00
Przemysław Kryger
4fae092e2d Ensure skipped package-vc-tests are not installed (bug#80235)
* test/lisp/emacs-lisp/package-vc-tests.el
(package-vc-tests-packages): Add argument `full'.  When `full'
is non-nil, then return full entries.
(package-vc-test-deftest): Use `pkg-arg' for the name of
argument `in-body'.  Call `skip-when' and `skip-unless' before
`packgage-vc-tests-with-installed'.
2026-01-27 15:32:28 +01:00
Mattias Engdegård
19cd6972fa ; * lisp/files.el (file-name-version-regexp): typo in doc string 2026-01-27 15:30:21 +01:00
Stéphane Marks
99abaa70bf Document frame id related commands and tweak a return value (Bug#80192)
* doc/lispref/frames.texi (Input Focus): Document the commands
'select-frame-by-id' and 'undelete-frame-by-id'.
* lisp/frame.el (select-frame-by-id): Clarify return value and
add missing optional argument 'noerror' in sympathy with
'undelete-frame-by-id'.
2026-01-27 10:23:34 +01:00
Po Lu
53305372d0 ; Avoid warnings when neither GIF nor WebP are supported
* src/image.c (gif_clear_image): Render contingent on HAVE_GIF
|| HAVE_WEBP.
2026-01-27 11:01:35 +08:00
João Távora
b224605d30 Jsonrpc: avoid redisplay_internal calls from jsonrpc-request
The 'jsonrpc-request' function, when called with non-nil CANCEL-ON-INPUT,
relies on 'sit-for' to stop immediately when the user inputs something into
Emacs.  Although this behavior is working well, it has the hitherto
undiscovered side effect of invoking 'redisplay_internal', which triggers
expensive operations such as fontification.

This bug was noticied when using the 'breadcrumb' package in conjunction
with Eglot and a narrowed buffer.  To provide breadcrumbs for the current
context, breadcrumb.el invokes 'imenu--make-index-alist' on a timer.  That
function temporarily widens the buffer and then eventually calls
'redisplay_internal' (through 'eglot-imenu', 'jsonrpc-request', and
'sit-for').  This has the effect that the temporarily widened buffer is
re-rendered and displayed to the user until the LSP server answers the
request and 'imenu--make-index-alist' restores the restriction, an effect
that lasts between 0.5 and 2 seconds usually and is annoying and confusing.

To fix this, using a non-nil NODISP argument in the 'sit-for' is not enough
(though it's arguable it should be and maybe that's a separate bug).
Binding 'inhibit-redisplay' to 't' around 'sit-for' seems to fix the issue
robustly.

* lisp/jsonrpc.el (jsonrpc-request): Bind inhibit-redisplay to t and pass
  NODISP to sit-for.
2026-01-26 22:57:09 +00:00
Eli Zaretskii
3dbddb4497 Fix image.c compilation when HAVE_GIF is not defined
* src/image.c (gif_clear_image): Make it available for other image
types.  (Bug#80266)
2026-01-26 18:33:59 +02:00
Stefan Monnier
120a451c04 (read_char_minibuf_menu_prompt): Fix bug#80146
* 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.
2026-01-26 10:14:03 -05:00
Eli Zaretskii
9983b18935 Fix point-adjustment when overlays are specific to windows
* src/keyboard.c (adjust_point_for_property): Consider only
overlays associated with the selected window.  (Bug#80255)
2026-01-26 16:49:01 +02:00
Bastien Guerry
d5a0dc0bad Update TUTORIAL.translators
* etc/tutorials/TUTORIAL.translators (Maintainer): Add myself
as TUTORIAL.fr co-maintainer.
2026-01-26 14:45:48 +01:00
Eli Zaretskii
821928808c ; Improve last change
* lisp/cus-start.el (line-spacing): Add :tag's.  (Bug#76390)
2026-01-26 14:29:47 +02:00
Daniel Mendler
446177ce25 ; Update defcustom type of 'line-spacing'
* lisp/cus-start.el: Update type of `line-spacing'.  (Bug#76390)
2026-01-26 14:24:10 +02:00
Mattias Engdegård
fd9d685c63 Neater pcase predicate transform
Suggested by Stefan Monnier.

* lisp/emacs-lisp/pcase.el (pcase--macroexpand): Simplify.
* test/lisp/emacs-lisp/pcase-tests.el (pcase-pred-equiv): New test.
2026-01-26 12:22:44 +01:00
Daniel Mendler
0fcf100301
Use a custom buffer name for package review diffs
* lisp/emacs-lisp/package.el (package-review): Specify a buffer
using 'diff-no-select' instead of falling back to the default
"*Diff*".

(Bug#80249)
2026-01-25 12:32:24 +01:00
Philip Kaludercic
bff916d7f9
Have default 'compile-command' run make in parallel
* lisp/progmodes/compile.el (compile-command): Change default
value.

(Bug#80065)
2026-01-25 12:26:19 +01:00
F. Moukayed
2d1d2a48d1
Support `undo'ing user input after messages are received
* lisp/net/rcirc.el (rcirc-update-prompt): Don't track undo info.
(rcirc-send-input): Clear undo list after message is sent.
(rcirc-update-undo-list): Add new function (copied from erc.el).
(rcirc-print): Update (shift) undo list instead of clearing it.
2026-01-25 12:26:19 +01:00
Martin Rudalics
bbf1aab781 ; * src/buffer.h: Mention indirect buffers in 'buffer_window_count' comment 2026-01-25 09:50:35 +01:00
Stéphane Marks
6a071ad373 Add 'select-frame-by-id' and 'undelete-frame-by-id' (Bug#80192)
'select-frame-by-id' will also undelete a deleted frame ID.

* lisp/frame.el (select-frame-by-id, undelete-frame-by-id): New
commands.
(make-frame-ids-alist, frame-by-id, frame-id-live-p)
(undelete-frame-id-index): New defuns.
* etc/NEWS: Announce the commands.
2026-01-25 09:43:47 +01:00
Po Lu
0b4dbd631e Adjust Android build system for recent changes to package requirements
* m4/ndk-build.m4 (ndk_package_map): Map libwebp to webp.
2026-01-25 11:18:50 +08:00
Basil L. Contovounesios
df9f73839e ; * src/pdumper.c (dump_buffer): Update hash.
This follows the commit of 2026-01-24
"Support cons cell for 'line-spacing'".
2026-01-24 20:11:34 +01:00
Basil L. Contovounesios
2092516a74 Clarify libwebp configuration checks
* configure.ac [HAVE_WEBP]: Explicitly check for both libwebpdemux
and libwebp (where the former depends on the latter), since we use
both (bug#57420, bug#61988, bug#66221).  Check for WebPDecodeRGBA as
a representative of libwebp and libwebpdecoder now that we no longer
use WebPGetInfo elsewhere.  Prepend WEBP_LIBS to LIBS as per
AC_CHECK_LIB.  Clarify commentary.
2026-01-24 19:37:30 +01:00
Basil L. Contovounesios
72c53dcb13 Improve (WebP) image animation
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.
2026-01-24 19:37:30 +01:00
Basil L. Contovounesios
db413c9da7 Improve animation cache documentation
* 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.
2026-01-24 19:37:30 +01:00
Eli Zaretskii
f800f2300b Fix support of listing switches with whitespace in Dired
* lisp/dired.el (dired-sort-by-date-regexp)
(dired-sort-by-name-regexp): Allow quoted arguments with embedded
whitespace, per the doc string of 'dired-listing-switches'.
(Bug#80200)
2026-01-24 15:39:11 +02:00
Liu Hui
e1d65b3c22 Fix inconsistent definition and usage of 'calendar-buffer'
* lisp/calendar/calendar.el (calendar-buffer): Define it as a
variable.
* lisp/calendar/diary-lib.el (diary-mark-entries): Set
'calendar-buffer' as a string.  (bug#79994)
2026-01-24 14:09:59 +02:00
Manuel Giraud
dea8f11c09 Document 'C-u M-x compile' (bug#80156)
* doc/emacs/building.texi (Compilation): Document 'C-u M-x
compile'.
2026-01-24 13:46:39 +02:00
Eli Zaretskii
3ce57b05a2 ; Fix last change. 2026-01-24 13:39:23 +02:00
Daniel Mendler
e8f26d554b Support cons cell for 'line-spacing'
* 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>
2026-01-24 13:32:44 +02:00
Jacob S. Gordon
2145519734 ; calendar-bahai: Move tests and convert to ERT
* lisp/calendar/cal-bahai.el (calendar-bahai--nawruz-reference-dates)
(calendar-bahai--twin-birthdays-reference-dates): Move to test file.
(calendar-bahai--verify-nawruz)
(calendar-bahai--verify-twin-birthdays): Remove and adapt contents in
test file.
(calendar-bahai-verify-calculations, calendar-bahai-run-tests): Remove.
* test/lisp/calendar/cal-bahai-tests.el: Add file.
(calendar-bahai--nawruz-reference-dates)
(calendar-bahai--twin-birthdays-reference-dates): Add test data.
(calendar-bahai-verify-nawruz, calendar-bahai-verify-twin-birthdays):
Create ERT tests.  (Bug#80207)
2026-01-24 13:25:14 +02:00
Eli Zaretskii
f1b3343e3d ; Safer 'x-display-monitor-attributes-list'
* 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)
2026-01-24 12:54:30 +02:00
Eli Zaretskii
aa352804af Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2026-01-24 12:45:14 +02:00
Leo C. Stein
92072c887f Backslashify all open/close punctuation so we don't confuse indenter
* lisp/leim/quail/latin-ltx.el: Quote characters with general-category
Ps and Pe (Punctuation, Open and Punctuation, Close) with backslash,
otherwise lisp indentation code gets confused.
2026-01-24 12:44:37 +02:00
Leo C. Stein
11d26dccde Add a few missing mathematical brackets to TeX input method
* lisp/leim/quail/latin-ltx.el: Add a few more left/right brackets,
especially the ones whose names in ucs-names start with MATHEMATICAL.
The macro names are taken from unimath-symbols.pdf, available at
http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf
2026-01-24 12:43:57 +02:00
Leo C. Stein
4de7ddc837 Add unicode's mathematical alphabets to TeX input method
* lisp/leim/quail/latin-ltx.el: Add math "alphabets" that can be matched
with simple regexps; a few others are added by hand.  There are 13
variants: bf, it, bfit, bb, scr, bfscr, frak, bffrak, sf, bfsf, sfit,
bfsfit, and tt.
2026-01-24 12:43:18 +02:00