Rmail-MIME decodes text of email, including removal of
CR characters, but that can segfault if the text of some
MIME part is empty.
* src/coding.c (decode_coding_raw_text):
* lisp/mail/rmailmm.el (rmail-mime-insert-decoded-text): Don't
attempt to decode empty text region.
* src/search.c (Freplace_match): Revert the search.c part of the
change from Apr 7, 2024, which aims to fix bug#65451, but causes
bug#73018. Do not merge to master.
* test/src/editfns-tests.el
(editfns-tests--before/after-change-functions): Expect this test
to fail.
* src/fontset.c (fontset_find_font) [!HAVE_ANDROID]: Don't
refuse to cache font objects whose registries do not agree with
the font specs. (bug#73363)
Do not merge to master.
* src/treesit.c (treesit_sync_visible_region): If the parser's original
ranges don't overlap with visible region, give it a zero range, rather
than don't set any range.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit): Test new
behavior.
Enable GC_REMEMBER_LAST_MARKED by default (it was disabled in Emacs 29)
to make it easier to debug difficult-to-reproduce GC problems
encountered by users. This increases GC costs by about 5 %, which can
be avoided by turning the mark trace buffer back off using the new
--disable-gc-mark-trace option.
See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2024-09/msg00240.html
* configure.ac (--disable-gc-mark-trace): New config option.
* etc/NEWS: Mention it.
* src/alloc.c: Enable it by default and avoid a compiler warning.
new_ranges_head
|
v
( )->( )->( )->( )->( )
^ ^
| |
| lisp_ranges (loop head)
|
prev_cons -> set cdr to nil to cut of the rest
result:
( )->( )
* src/treesit.c (treesit_sync_visible_region): Cut off this cons and the
rest, not set the current range's end to nil.
* test/src/treesit-tests.el:
(treesit-range-fixup-after-edit): Add tests for all cases.
Here by multibyte buffer I mean buffer that includes non-ASCII
characters.
The problem is illustrated by this comment, which I copied from the
source:
======================================================================
(ref:bytepos-range-pitfall) Suppose we have the following buffer
content ([ ] is a unibyte char, [ ] is a multibyte char):
[a][b][c][d][e][ f ]
and the following ranges (denoted by braces):
[a][b][c][d][e][ f ]
{ }{ }
So far so good, now user deletes a unibyte char at the beginning:
[b][c][d][e][ f ]
{ }{ }
Oops, now our range cuts into the multibyte char, bad!
======================================================================
* src/treesit.c (treesit_debug_print_parser_list): Minor fix.
(treesit_sync_visible_region): Change the way we fixup ranges, instead
of using the bytepos ranges from tree-sitter, we use the cached lisp
charpos ranges.
(treesit_make_ts_ranges): New function.
(Ftreesit_parser_set_included_ranges): Refactor out the new function
treesit_make_ts_ranges.
(Ftreesit_parser_included_ranges): Rather than getting the ranges from
tree-sitter, just return the cached lisp ranges.
* src/treesit.h (Lisp_TS_Parser): Add some comment.
* test/src/treesit-tests.el (treesit-range-fixup-after-edit): New test.
This reverts commit bf23382f1f.
We move around the gap, narrow regions, ralloc, etc, and don't have a
way to invalidate previously given range. So tree-sitter can't be given
the full range.
This was inadvertently broken when Windows 9X support was
fixed in June 2024.
* src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper): Set
'uniscribe_available' non-zero in non-Cygwin builds. (Bug#73159)
1. In treesit_sync_visible_region, reduce the ranges for a parser so it
doesn't go beyond the visible range.
2. To avoid possible infinite recursion, add a within_reparse field to
parsers. Previously we were using the need_reparse field to avoid
infinite recursion, but lisp programs in a parser's after change hook
might make some buffer edit which turns need_reparse to true. To avoid
that, we now use an explicit field. If a parser's after change function
makes a buffer edit, lisp program ends up with a desynced parse tree,
but that's better than possible infinite recursion. Also after change
function shouldn't edit the buffer.
3. In treesit_make_ranges, use parser's visible_beg instead of buffer's
BEGV. I mean technically whenever we make ranges, buffer's BEGV should
be equal to parser's visible_beg, but better not take that uncertainty,
also makes the code more readable.
4. In Ftreesit_parser_included_ranges, move visible region sync code
before the body of the function.
* src/treesit.c (treesit_sync_visible_region): Minimally fix ranges so
it doesn't exceed parser's visible range.
(treesit_call_after_change_functions): Update calling sigature to
treesit_make_ranges.
(treesit_ensure_parsed, make_treesit_parser): Use the new field
within_reparse.
(treesit_make_ranges): Use parser's visible_beg instead of buffer's
BEGV.
(Ftreesit_parser_included_ranges): Move visible region check before
function body.
* src/treesit.h (Lisp_TS_Parser): Add new field within_reparse.
The JSON format is defined as a byte sequence and will always be used as
such, so returning a multibyte string makes little sense.
* src/json.c (json_out_to_string): Remove.
(Fjson_serialize): Return unibyte string.
* test/src/json-tests.el (json-serialize/roundtrip)
(json-serialize/roundtrip-scalars, json-serialize/string):
Update tests.
* doc/lispref/text.texi (Parsing JSON): Document.
* etc/NEWS: Announce.
* doc/lispref/os.texi (Suspending Emacs):
* src/keyboard.c (Fsuspend_emacs): Document possible failures
in sending STUFFSTRING to the shell. (Bug#73100).
* src/xfaces.c (recompute_basic_faces): Force complete
recalculation of non-ASCII faces and their fontsets if any
non-ASCII faces are in the frame's face cache. (Bug#72692)
* src/xfaces.c (recompute_basic_faces): Revert the change which
caused recalculation of all the faces, as it made cursor motion
too slow. Reported by Juri Linkov <juri@linkov.net> (bug#72692).
* src/minibuf.c (minibuffer_unwind): Make sure that the buffer
referenced by the first element of the list of previous buffers
of the minibuffer window is live before assigning it to the
minibuffer window (Bug#72487).
* src/window.c (set_window_buffer): Assert that BUFFER is live.
* src/sfnt.c (sfnt_read_cmap_format_2): Properly compute
subtable count, and append the empty table at position 0.
(sfnt_lookup_glyph_2): Update commentary.
* src/fns.c (Fsecure_hash):
* doc/lispref/text.texi (Checksum/Hash):
* lisp/subr.el (sha1): Fix documentation wrt to the number of
bytes 'secure-hash' and its variants return when BINARY is
non-nil. Reported by Pip Cet <pipcet@protonmail.com>.
This code is untested as no font with a format 2 cmap could be found.
* src/sfnt.c (sfnt_lookup_glyph_2): Fix typos. Assume single-byte
encodings use character codes 0, 1, ..., 255 rather than 0, 256, ...,
65280.
Backport.
* src/sfnt.c (sfnt_transform_coordinates):
(sfnt_transform_f26dot6): Fix calculation of transformed coordinates in
the very rare case of arbitrary transformation matrices.
* src/nsterm.m (ns_set_vertical_scroll_bar): Use
WINDOW_SCROLL_AREA_WIDTH instead of NS_SCROLL_BAR_WIDTH.
(ns_set_horizontal_scroll_bar): Use WINDOW_SCROLL_AREA_HEIGHT
instead of NS_SCROLL_BAR_HEIGHT. Clear area differently if vertical
scroll bars are present.
* src/nsterm.h (NS_SCROLL_BAR_WIDTH, NS_SCROLL_BAR_HEIGHT): Remove.
* src/xdisp.c (get_large_narrowing_begv, get_large_narrowing_zv)
(get_medium_narrowing_begv, get_medium_narrowing_zv): Use
'ptrdiff_t' instead of 'int', to prevent integer overflow in
large buffers. (Bug#72497)