emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master bfa951cdfa: Fix invalid current buffer after print-unreadable-fun


From: Po Lu
Subject: master bfa951cdfa: Fix invalid current buffer after print-unreadable-function signals
Date: Wed, 27 Jul 2022 05:42:40 -0400 (EDT)

branch: master
commit bfa951cdfad482a106bed11e4f11cedfad58570a
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix invalid current buffer after print-unreadable-function signals
    
    * src/print.c (PRINTPREPARE): Remove `old' and
    record_unwind_current_buffer instead.
    (PRINTFINISH): Stop restoring `old'.  (bug#56773)
---
 src/print.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/print.c b/src/print.c
index b5a621f80a..6218c76224 100644
--- a/src/print.c
+++ b/src/print.c
@@ -98,7 +98,6 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
    or call strout to output a block of characters.  */
 
 #define PRINTPREPARE                                                   \
-   struct buffer *old = current_buffer;                                        
\
    ptrdiff_t old_point = -1, start_point = -1;                         \
    ptrdiff_t old_point_byte = -1, start_point_byte = -1;               \
    specpdl_ref specpdl_count = SPECPDL_INDEX ();                       \
@@ -106,6 +105,7 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
    bool multibyte                                                      \
      = !NILP (BVAR (current_buffer, enable_multibyte_characters));     \
    Lisp_Object original = printcharfun;                                        
\
+   record_unwind_current_buffer ();                                    \
    if (NILP (printcharfun)) printcharfun = Qt;                         \
    if (BUFFERP (printcharfun))                                         \
      {                                                                 \
@@ -192,8 +192,7 @@ bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
      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)); \
-   set_buffer_internal (old);
+                                   ? PT_BYTE - start_point_byte : 0));
 
 /* This is used to restore the saved contents of print_buffer
    when there is a recursive call to print.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]