# HG changeset patch # User Andreas Schwab # Date 1241265283 0 # Node ID 9569175bb813e5119cc757cf446fe83495c47a2a # Parent 2f7395806731b8df18e5d6f26f63f25a6627d090 (read_process_output): Make sure the current buffer is always restored. diff -r 2f7395806731 -r 9569175bb813 src/ChangeLog --- a/src/ChangeLog Sat May 02 11:32:42 2009 +0000 +++ b/src/ChangeLog Sat May 02 11:54:43 2009 +0000 @@ -1,5 +1,8 @@ 2009-05-02 Andreas Schwab + * process.c (read_process_output): Make sure the current buffer is + always restored. + * coding.c (record_conversion_result): Don't modify Vlast_code_conversion_error for successful result. (alloc_destination): Don't clobber conversion result. (Bug#1650) diff -r 2f7395806731 -r 9569175bb813 src/process.c --- a/src/process.c Sat May 02 11:32:42 2009 +0000 +++ b/src/process.c Sat May 02 11:54:43 2009 +0000 @@ -5185,7 +5185,6 @@ register int nbytes; char *chars; register Lisp_Object outstream; - register struct buffer *old = current_buffer; register struct Lisp_Process *p = XPROCESS (proc); register int opoint; struct coding_system *coding = proc_decode_coding_system[channel]; @@ -5385,9 +5384,11 @@ int opoint_byte; Lisp_Object text; struct buffer *b; + int count = SPECPDL_INDEX (); odeactivate = Vdeactivate_mark; + record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); Fset_buffer (p->buffer); opoint = PT; opoint_byte = PT_BYTE; @@ -5490,7 +5491,7 @@ current_buffer->read_only = old_read_only; SET_PT_BOTH (opoint, opoint_byte); - set_buffer_internal (old); + unbind_to (count, Qnil); } return nbytes; }