From 163424e04b7f75a1655fd263ba4b6d6d4fa880b2 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 28 Jul 2022 19:25:46 +0800 Subject: [PATCH] Correctly set marker position after specpdl is unwound during printing * src/print.c (PRINTFINISH): Don't call set_marker_both with the wrong current_buffer. Reported by Lars Ingebrigtsen . --- src/print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/print.c b/src/print.c index 5ad4d4fbb58..7bb905b2699 100644 --- a/src/print.c +++ b/src/print.c @@ -180,14 +180,14 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1; print_buffer_pos_byte, 0, 1, 0); \ signal_after_change (PT - print_buffer_pos, 0, print_buffer_pos);\ } \ - unbind_to (specpdl_count, Qnil); \ if (MARKERP (original)) \ set_marker_both (original, Qnil, PT, PT_BYTE); \ if (old_point >= 0) \ SET_PT_BOTH (old_point + (old_point >= start_point \ ? PT - start_point : 0), \ old_point_byte + (old_point_byte >= start_point_byte \ - ? PT_BYTE - start_point_byte : 0)); + ? PT_BYTE - start_point_byte : 0)); \ + unbind_to (specpdl_count, Qnil); \ /* This is used to free the print buffer; we don't simply record xfree since print_buffer can be reallocated during the printing. */ -- 2.39.2