Commit graph

182263 commits

Author SHA1 Message Date
Paul Eggert
c80d22dcfc Remove stray inrange_pipe comment 2026-05-19 11:54:25 -07:00
Paul Eggert
efb83df331 Don’t trust RLIMIT_NOFILE in src/process.c
Problem discovered on Fedora 44 x86-64 when using GCC 16.1.1 with
-fsanitize=address, with test/src/process-tests.el tests that use
process-tests--with-raised-rlimit.  This function overrides the
default of 1024 for the maximum number of open files, which causes
undefined behavior (subscript errors) in src/process.c.
* src/process.c (inrange_fd, inrange_pipe): New functions.
(allocate_pty, create_process, create_pty, Fmake_pipe_process)
(Fmake_serial_process, connect_network_socket)
(network_interface_info, server_accept_connection)
(Fprocess_send_eof, child_signal_init):
Check that all newly allocated file descriptors are less than
FD_SETSIZE; close them and fail otherwise.
(create_pty, Fmake_pipe_process, Fmake_serial_process)
(connect_network_socket, server_accept_connection)
(child_signal_init): Remove no-longer-needed comparisons
to FD_SETSIZE, now that inrange_fd and inrange_pipe
do the checking for us.
2026-05-18 23:10:42 -07:00
Paul Eggert
71336e837a Pacify GCC 16.1.1 -Wanalyzer-null-dereference
* src/regex-emacs.c (forall_firstchar):
Avoid undefined behavior in the 2nd eassert when !bufp && !pend.
This pacifies GCC 16.1.1 20260501 (Red Hat 16.1.1-1) x86-64
when Emacs is configured with --enable-gcc-warnings.
2026-05-18 23:10:42 -07:00
Paul Eggert
07fe0b297b Fix undefined behavior in maybe_resize_hash_table
Problem discovered with GCC 16.1.1 -fsanitize=undefined.
* src/fns.c (maybe_resize_hash_table): Avoid undefined
behavior when h->key_and_value or h->hash are null pointers,
in which case we call memcpy (destination, NULL, 0)
which has undefined behavior in C89 through C23.
2026-05-18 23:10:42 -07:00
Paul Eggert
7587bb2654 Simplify module_extract_big_integer size calcs
* src/emacs-module.c (module_bignum_count_max):
Now of type ptrdiff_t, instead of likely being of type size_t.
(module_extract_big_integer): Omit now-unnecessary prefix +, a
now-unnecessary eassert against PTRDIFF_MAX, and and an
unnecessary cast to ptrdiff_t.
2026-05-18 23:10:42 -07:00
Paul Eggert
b9e20e3995 Avoid malloc/free pairs in emit_static_object
* src/comp.c (emit_static_object): Avoid an malloc/free of
a 1 KiB buffer; just put it on the stack.  Use strnlen+mempcpy
instead of strncpy as there is no need to zero-fill buff.
Use int for values that must fit in int since we are
passing them to gcc_jit_context_new_rvalue_from_int.
2026-05-18 23:10:42 -07:00
Paul Eggert
f5c3ddd9ad Prefer singed type to size_t in Fdefine_charset_internal
* src/charset.c (Fdefine_charset_internal):
Prefer int to size_t for a variable that has only int values.
2026-05-18 23:10:42 -07:00
Paul Eggert
56ae704e5b Fix (ash -1 1) undefined behavior
Problem discovered with GCC 16.1.1 -fsanitize=undefined.
* src/data.c (Fash): Don’t left-shift a negative number;
behavior is undefined (ISO C23 § 6.5.8 ¶ 4).
2026-05-18 23:10:42 -07:00
Stefan Monnier
8c71b0d6b8 shr.el: Don't insert image at outdated destination (bug#80945)
When fetching images asynchronously, keep track of the
destination region and refrain from inserting the image if
that region has been modified in the mean time.

* lisp/net/shr.el (shr--image-fetched, shr--async-put-image): New functions.
(shr-insert-image, shr-zoom-image, shr-image-displayer, shr-tag-img):
Use them.

* lisp/mail/rmailmm.el (rmail-mime-render-html-shr): Add FIXME.
2026-05-18 22:26:12 -04:00
Sean Whitton
641754e870 Merge from origin/emacs-31
28a13b01c7 vc-refresh-state: Override default-directory for backend ...
389874c533 Eglot: unbreak for treesit-less builds
10e91e096d Get selected item in newsticker list view
6bd73af241 ; * test/lisp/jsonrpc-tests.el: Adjust timeouts for CI EM...
eb90c528f3 ; * lisp/progmodes/eglot.el (eglot-code-action-indication...
1d7d6ffedb ; * etc/PROBLEMS: Fix entries about display of Emoji on T...
6c1829bf4c Eglot: fix thinko in recent markdown-related commit (bug#...
36036e71c0 Jsonrpc: migrate more tests to Python subprocess fixtures
0977d5915d Eglot: add left-fringe code action indicator (bug#80326)
b7825c3a27 Fix auth-source-backends-parse
d89054627c Fix updates of embedded formulas by 'calc-embedded-update...
1832a93547 ; * src/fns.c (Fequal): Doc fix.
f68e7a0a41 ; Improve documentation of commands that move by compilat...
2026-05-18 22:16:46 +01:00
Sean Whitton
28a13b01c7 vc-refresh-state: Override default-directory for backend functions
I ran into the issue described in the comment with the current
code in project-find-file-in and project-find-dir, when using
'C-x p p' to switch between projects.

* lisp/vc/vc-hooks.el (vc-refresh-state): When calling into the
backend, override any let-bindings of default-directory.
2026-05-18 22:15:29 +01:00
João Távora
389874c533 Eglot: unbreak for treesit-less builds
* lisp/progmodes/eglot.el
(eglot--builtin-mdown-p): New helper.
(eglot--accepted-formats)
(eglot--format-markup): Use it.
2026-05-18 20:53:15 +01:00
Joshua Murphy
10e91e096d Get selected item in newsticker list view
* lisp/net/newst-treeview.el
(newsticker--treeview-get-selected-item): If an item is already
selected, use it.  (Bug#80972)

Copyright-paperwork-exempt: yes
2026-05-18 19:51:04 +03:00
João Távora
6bd73af241 ; * test/lisp/jsonrpc-tests.el: Adjust timeouts for CI EMBA testing 2026-05-18 17:22:30 +01:00
Jim Porter
d4cb550dba ; Improve last change
* test/src/process-tests.el (process-tests/broken-pipe): Use
CONNECTION-TYPE.
(process-tests/broken-pipe/pipe-all)
(process-tests/broken-pipe/pipe-stdin): Skip via 'skip-when'.
(process-tests/broken-pipe/pty)
(process-tests/broken-pipe/pty-stdin): Remove these invalid tests; EPIPE
from a PTY doesn't make sense.
2026-05-18 08:37:42 -07:00
João Távora
eb90c528f3 ; * lisp/progmodes/eglot.el (eglot-code-action-indications): Tweak. 2026-05-18 16:27:35 +01:00
Eli Zaretskii
1d7d6ffedb ; * etc/PROBLEMS: Fix entries about display of Emoji on TTY (bug#81052). 2026-05-18 16:36:05 +03:00
Jim Porter
e381cf1fc9 Allow child processes to continue after EPIPE
This ensures that if the child process closed its stdin and Emacs tries
to write to it, the process can still do any remaining work and exit
normally.  In practice, this can occur with commands like "head(1)"
(bug#79079).

* src/fileio.c (file_for_stream): New function, extracted from...
(Fset_binary_mode): ... here.
(Ffile__close_stream): New function.

* src/process.c (send_process): When encountering EPIPE, only close the
fd for the pipe to the child process's stdin.

* lisp/eshell/esh-io.el (eshell-output-object-to-target): Don't check
for process liveness anymore.

* test/src/process-tests.el (process-tests/broken-pipe): New function.
(process-tests/broken-pipe/pipe, process-tests/broken-pipe/pty)
(process-tests/broken-pipe/pipe-stdin)
(process-tests/broken-pipe/pty-stdin): New tests.

* etc/NEWS: Announce this change.
2026-05-17 17:24:10 -07:00
Jim Porter
a557bf69b4 Ensure that process-tests clean up test processes
* test/src/process-tests.el (start-process-should-not-modify-arguments):
Clean up test process.
(process-test--check-pipe-process): New macro...
(process-test-make-pipe-process-no-buffer): ... call it.
2026-05-17 17:24:10 -07:00
Paul Eggert
7626993c6f Remove SAFE_ALLOCA_LISP_EXTRA
* src/lisp.h (SAFE_ALLOCA_LISP_EXTRA): Remove.  It is no longer
used, it makes life more difficult in the feature/igc3 branch,
and having it around tempted me to start using it again.
2026-05-17 12:57:18 -07:00
Paul Eggert
24f9e6a693 Make styled_format more compatible with igc
* src/editfns.c (styled_format): Don’t call SAFE_ALLOCA_LISP_EXTRA,
as this makes life more difficult in the feature/igc3 branch.
Also, allocate another byte for the format string trailing '\0',
so that we don’t rely in the str2num trick with trailing '\1'.
Problems reported by Pip Cet (Bug#81057#32).
Also, check alloca size more exactly.  Ameliorate the extra
conditional branches by doing all the internal size calculations
before a conditional branch on overflow.
2026-05-17 12:57:18 -07:00
Brian Leung
6c1829bf4c Eglot: fix thinko in recent markdown-related commit (bug#81063)
* lisp/progmodes/eglot.el (eglot--format-markup): Correct return value
for gfm-view-mode.
2026-05-17 19:28:16 +01:00
João Távora
36036e71c0 Jsonrpc: migrate more tests to Python subprocess fixtures
All tests now use 'jsonrpc--with-python-fixture' with a Python3
subprocess instead of the in-Emacs TCP server.  Changed the "harakiri"
method to be a request instead of a notification for to reduce chance of
"Sentinel hasn't run" warning.

The two in-Emacs-RPC-specific error tests ('errors-with--32601' and
'signals-an--32603-JSONRPC-error') are dropped with the fixture itself,
as the error paths they exercise are internal to the Emacs Lisp
dispatcher and have no direct Python equivalent.  They will have to be
re-done later on in other form.

* test/lisp/jsonrpc-resources/server-emacsrpc.py: New file.

* test/lisp/jsonrpc-resources/server-anxious-nested.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-emacsrpc.py: Use new harakiri.

* test/lisp/jsonrpc-resources/server-harakiri.py: Use new harakiri.

* test/lisp/jsonrpc-resources/server-remote-during-sync-1.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-remote-during-sync-2.py: Use new
  harakiri.

* test/lisp/jsonrpc-resources/server-remote-error.py: Use new harakiri.

* test/lisp/jsonrpc-resources/common.py (harakiri): New definition.

* test/lisp/jsonrpc-tests.el
(jsonrpc--with-python-fixture): Rework, move up.
(jsonrpc-connection-ready-p): Move up.
(jsonrpc--call-with-emacsrpc-fixture)
(jsonrpc--with-emacsrpc-fixture)
(errors-with--32601)
(signals-an--32603-JSONRPC-error): Remove.
(returns-3, times-out, doesnt-time-out, stretching-it-but-works)
(deferred-action-toolate, deferred-action-intime)
(deferred-action-complex-tests): Migrate to Python fixture.
(scontrol-remote-during-sync-1, scontrol-remote-during-sync-2)
(scontrol-anxious-nested, scontrol-remote-error)
(shutdown-clean-after-notification): Tweak.
2026-05-17 19:28:07 +01:00
João Távora
0977d5915d Eglot: add left-fringe code action indicator (bug#80326)
The fringe indicator uses a custom lightning-bolt bitmap, an alternative
to the margin indicator on GUI frames.  It is non-interactive, however.

* lisp/progmodes/eglot.el (eglot--fringe-action): New fringe bitmap.

(eglot-code-action-indications): Add 'left-fringe' to default value
and to docstring.  Update incompatibility note.

(eglot-code-action-suggestion): Handle 'left-fringe' indication.
2026-05-17 19:24:53 +01:00
Michael Albinus
b7825c3a27 Fix auth-source-backends-parse
* lisp/auth-source.el (auth-source-backend-parse): Drop backends
of type `ignore'.  (Bug#81024)
(auth-source-backends): Drop duplicate backends.
2026-05-17 18:21:49 +02:00
Paul Eggert
f599a92277 Shrink styled_format's frame quite a bit
Problem reported by Helmut Eller (Bug#81057).
On x86-64 this patch shrinks USEFUL_PRECISION_MAX
from 16382 to 1074, SPRINTF_BUFSIZE from 21318 to 1386,
and sizeof initial_buffer from 22318 to 2386.
This also fixes a problem reported privately by Pip Cet:
exactly formatting the smallest positive IEEE double 2**-1074
with %f	needs %.1074f and 1074 is DBL_MANT_DIG - DBL_MIN_EXP,
not merely 1 - DBL_MIN_EXP.
* src/editfns.c (USEFUL_PRECISION_MAX, SPRINTF_BUFSIZE):
Base these on double, not long double, since long double
is not the worst case (it is used only for converted u?intmax_t).
(USEFUL_PRECISION_MAX): Add DBL_MANT_DIG - 1 as per Pip Cet.
2026-05-17 01:26:20 -07:00
Paul Eggert
cf693ce059 Grow styled_format's frame somewhat
* src/editfns.c (styled_format): Don’t subtract
sizeof initial_buffer from sa_avail (bug#81057).
2026-05-17 01:26:20 -07:00
Paul Eggert
1fae14a022 Streamline styled_format aux allocation
* src/editfns.c (styled_format): Streamline allocation of
auxiliary tables, by allocating them all in one go
rather than via separate alloca / mallocs.
2026-05-17 01:26:20 -07:00
Eli Zaretskii
d89054627c Fix updates of embedded formulas by 'calc-embedded-update-formula'
* lisp/calc/calc-embed.el (calc-embedded-update): Use
'buffer-substring' to better track the string representation of
the formula when it is being edited.  Suggested by
gnu@publik.slmail.me.  Also, update commentary.  (Bug#80901)
2026-05-17 10:57:53 +03:00
Eli Zaretskii
1832a93547 ; * src/fns.c (Fequal): Doc fix. 2026-05-17 10:37:01 +03:00
Eli Zaretskii
f68e7a0a41 ; Improve documentation of commands that move by compilation errors
* lisp/simple.el (next-error):
* lisp/progmodes/compile.el (compilation-next-error)
(compilation-previous-error): Doc fixes.
2026-05-17 09:05:13 +03:00
Eli Zaretskii
84e646f0b3 ; * etc/NEWS: Fix last change. 2026-05-16 18:18:54 +03:00
Philip Kaludercic
b13450973a
Copy changes from tarballs when installing VC packages
* etc/NEWS: Document change.
* lisp/emacs-lisp/package-vc.el (package-vc--clone): Implement
logic to find and copy files from a previous installation.
(package-vc-install): Indicate the effect of the prefix argument
in the prompt.
2026-05-16 16:31:48 +02:00
Eli Zaretskii
407b5ce7ab Merge from origin/emacs-31
cf96e9cb5a ; Fix byte-compilation warnings in non-Tree-Sitter builds
23575adc7b ; * doc/lispref/variables.texi (Local Variables): Fix typ...
8b6fb2f646 ; * doc/lispref/variables.texi (Local Variables): Fix 'na...
d3c72b8389 ; * src/xdisp.c (display_line): Fix commentary (bug#80693).
a981517b72 Fill margins with 'margin' face on truncated screen lines
8e37499035 ; * doc/lispref/os.texi (Init File): Fix markup (bug#81049).
f4c326c378 ; * src/sfnt.c (sfnt_read_cmap_format_12): Assert there's...
bf89ee6d07 ; * etc/PROBLEMS: Cursor not shown on Windows with system...
20500d6200 ; htmlfontify: Handle 'reset' face attribute value (bug#8...
d0d657fa90 ; Minor Tramp cleanup
93ea0d7d28 ; Improve documentation of VC commands in Dired
318084829c Eglot: adjust reference to completion frontends in manual
2a166c2dbd Eldoc: display documentation in visual-line-mode
aba60ad0c5 Eglot: prefer markdown-ts-view-mode for markup rendering ...
689c3bd508 Use 'read-multiple-choice' in 'markdown-ts-mode' (bug#81027)
71809ee5df Fix 'markdown-ts-code-span' face (bug#81026)
286833e401 Add read-only 'markdown-ts-view-mode' (bug#81023)
b39c123490 Fix strikethrough in 'markdown-ts-mode' (bug#80991)
0be998d4bc Fix code-span in headings in 'markdown-ts-mode' (bug#80979)
a00beb3a31 Make 'markdown-ts-inline-images' buffer local and test fo...
a0c05029fd * etc/NEWS: Mention new user option tramp-propagate-emacs...
2e71d2c709 Propagate EMACSCLIENT_TRAMP to remote hosts with Tramp
ff96db93f2 keyboard-tests.el: Try and fix the failure on EMBA
ce3098752c doc: Remove long obsolete references to `package-initialize`
9bc04b001a vc-next-action: Call vc-delete-file on FILESET-ONLY-FILES
13039e3442 ; touch-up last commit: copyright and comments
c2a24dcec8 ; update msys2 build helper for Emacs 31 & UCRT
3630baae72 hideshow: Support new 'margin' face for margin indicators...
20d17df3f4 Use the new 'margin' face in Flymake (bug#80693)
07f2bbc905 vc-dir-resynch-file: Pass down non-truename'd FILE
2026-05-16 07:24:17 -04:00
Eli Zaretskii
21cda148c7 ; Merge from origin/emacs-31
The following commit was skipped:

a8f67a1f06 Change ERC version for Emacs 31 to 5.6.2.31.1
2026-05-16 07:17:51 -04:00
Eli Zaretskii
87e4687749 Merge from origin/emacs-31
7eab6ef3ce Fix 'sgml-parse-tag-backward' to handle tags in comments
09dc864b0b Fix eww-submit for forms with no action (bug#80918)
0e7a24d931 * lisp/progmodes/hideshow.el (hs--set-variable): Use 'set...
f12b01582d Fix Completions buffer disappearing with tmm-menubar (bug...
519fd83211 Fix secrets.el when Emacs is a flatpak
9e4ea934f2 Fix 'prepare-user-lisp' to follow symlinks
e613e38021 Update "timeout" to 2.1.6
196fd80689 [GTK3, HiDPI] Fix width/height round-trip through Configu...
acc07f1a03 [GTK3] On Expose, repaint the border before the content
5323eebcff Test read-passwd behavior (bug#80838)
01c5990dd0 Fix nested read-passwd calls (bug#80838)
027043df25 ; * lisp/gnus/message.el (message-server-alist): Doc fix ...
3b608b233e Fix terminal emulation of "ESC [ K" sequence
6a605c65a8 Fix vertical-motion across overlay strings with embedded ...
e4d529c67b ; Fix last change
d54faa0f1b Mark gnus-dbus.el as obsolete
9bf2a19bb2 Move gnus-dbus.el to obsolete/gnus-dbus.el
984024daf3 Gnus: Use new sleep library
d7c130972e ; * lisp/term/pgtk-win.el (icon-map-list): Fix :type.
5579893ed7 ; Don't block/unblock input in text_extents methods
547b1ee7b6 Fix Rmail behavior wrt globalized minor modes
6ba05106f4 Fix display images in the display margins
56f27dd9f0 Eglot: fix eglot--sig-info with non-UTF-32 positionEncoding
543d8a7a9d [NS] Fix deprecated variable (bug#80985)

# Conflicts:
#	etc/NEWS
2026-05-16 07:17:51 -04:00
Eli Zaretskii
cf96e9cb5a ; Fix byte-compilation warnings in non-Tree-Sitter builds
* lisp/progmodes/eglot.el (treesit-grammar-location):
* lisp/treesit.el (treesit-grammar-location): Declare.
2026-05-16 14:13:56 +03:00
Eli Zaretskii
23575adc7b ; * doc/lispref/variables.texi (Local Variables): Fix types (bug#81004). 2026-05-16 13:43:53 +03:00
Eli Zaretskii
8b6fb2f646 ; * doc/lispref/variables.texi (Local Variables): Fix 'named-let'. 2026-05-16 13:16:09 +03:00
Eli Zaretskii
d3c72b8389 ; * src/xdisp.c (display_line): Fix commentary (bug#80693). 2026-05-16 11:54:43 +03:00
Andrea Alberti
a981517b72 Fill margins with 'margin' face on truncated screen lines
* src/xdisp.c (display_line): Remove the unnecessary condition that
row->used of the margin areas is zero, for when we call
'extend_face_to_end_of_line'.  (Bug#80693)
2026-05-16 11:48:34 +03:00
Manuel Giraud
8e37499035 ; * doc/lispref/os.texi (Init File): Fix markup (bug#81049). 2026-05-15 15:27:23 +03:00
Eli Zaretskii
f4c326c378 ; * src/sfnt.c (sfnt_read_cmap_format_12): Assert there's no overflow. 2026-05-15 15:00:35 +03:00
Eli Zaretskii
bf89ee6d07 ; * etc/PROBLEMS: Cursor not shown on Windows with system caret (bug#81047). 2026-05-15 10:20:31 +03:00
Philip Kaludercic
025ecf9e7b
* lisp/net/rcirc.el (rcirc-monospace-text): Inherit 'fixed-pitch' 2026-05-14 22:13:33 +02:00
Richard Stallman
0fb9d096e3 The summary scan should include the current msg and run to end.
* lisp/mail/rmailsum.el (rmail-new-summary-1): If we are before,
or close to, msg number rmail-summary-starting-message,
start the search a little before there.
2026-05-14 11:16:35 -04:00
Eshel Yaron
20500d6200
; htmlfontify: Handle 'reset' face attribute value (bug#81032)
* lisp/htmlfontify.el (hfy-face-to-style-i): Add special
handling for the 'reset' face attribute value.
2026-05-14 17:11:43 +02:00
Michael Albinus
d0d657fa90 ; Minor Tramp cleanup
* lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Do not
expand remote file names w/o a localname.

* test/lisp/net/tramp-tests.el
(tramp--test-supports-environment-variables-p): New defun.
(tramp-test33-environment-variables): Use it.
2026-05-14 12:31:04 +02:00
Eli Zaretskii
93ea0d7d28 ; Improve documentation of VC commands in Dired
* doc/emacs/dired.texi (Misc Dired Features): Move VC reference
from here...
(Operating on Files): ...to here.  Add other VC commands supported
by Dired.
* doc/emacs/maintaining.texi (Old Revisions, VC Change Log): Fix
cross-references.
2026-05-14 13:12:21 +03:00
João Távora
318084829c Eglot: adjust reference to completion frontends in manual
* doc/misc/eglot.texi (Eglot Features): Rework.
2026-05-14 11:05:30 +01:00