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.
* 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.
* 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.
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).
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.
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.
* lisp/net/newst-treeview.el
(newsticker--treeview-get-selected-item): If an item is already
selected, use it. (Bug#80972)
Copyright-paperwork-exempt: yes
* 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.
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.
* 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.
* 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.
* 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.
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.
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.
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.
* src/editfns.c (styled_format): Streamline allocation of
auxiliary tables, by allocating them all in one go
rather than via separate alloca / mallocs.
* 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)
* 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.
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
* 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)
* 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.
* 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.
Documentation is overwhelmingly prose and intended to be viewed,
not edited. Using visual-line-mode allows members of
'eldoc-doc-functions' to provide long lines that correctly fill
to the window width.
* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Use
visual-line-mode.
Eglot previously needed gfm-view-mode from markdown-mode.el to render
Markdown from LSP servers. It now prefers markdown-ts-view-mode when
available.
* lisp/progmodes/eglot.el (eglot--accepted-formats): Recognize
markdown-ts-view-mode as a Markdown renderer.
(eglot--format-markup): Rework with cl-labels; prefer
markdown-ts-view-mode over gfm-view-mode.
* doc/misc/eglot.texi (Eglot Features): Don't mention
markdown-mode directly.
* etc/EGLOT-NEWS: Mention change
Replace the "c" character-prompt interactive spec with
'read-multiple-choice', which presents named options instead of
requiring users to decode the prompt string and type a single
character.
* lisp/textmodes/markdown-ts-mode.el
(markdown-ts-table-align-column): Use 'read-multiple-choice'.
Adjust ALIGN docstring punctuation.
* lisp/textmodes/markdown-ts-mode-x.el
(markdown-ts-toc-insert-template): Use 'read-multiple-choice'.