]> git.eshelyaron.com Git - emacs.git/commitdiff
Correctly set marker position after specpdl is unwound during printing
authorPo Lu <luangruo@yahoo.com>
Thu, 28 Jul 2022 11:25:46 +0000 (19:25 +0800)
committerPo Lu <luangruo@yahoo.com>
Thu, 28 Jul 2022 11:28:23 +0000 (19:28 +0800)
* src/print.c (PRINTFINISH): Don't call set_marker_both with the
wrong current_buffer.  Reported by Lars Ingebrigtsen
<larsi@gnus.org>.

src/print.c

index 5ad4d4fbb58c50ebf41c7af587908ff0e851d066..7bb905b26997aedec27f3c56f73b64bdbdddad48 100644 (file)
@@ -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.  */