diff options
| author | Andreas Schwab | 2009-05-02 11:54:43 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2009-05-02 11:54:43 +0000 |
| commit | 59c4c60fb1b371be5566e44b3fa6cb377001f958 (patch) | |
| tree | a72afa9535467b70948ff81da5e4629a02d00229 /src/process.c | |
| parent | 409ea3a1dd530feabeb8f7f21dfd9c4aa2eb7a43 (diff) | |
| download | emacs-59c4c60fb1b371be5566e44b3fa6cb377001f958.tar.gz emacs-59c4c60fb1b371be5566e44b3fa6cb377001f958.zip | |
(read_process_output): Make sure the current buffer is
always restored.
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c index 635f44466df..5fb3662532d 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -5185,7 +5185,6 @@ read_process_output (proc, channel) | |||
| 5185 | register int nbytes; | 5185 | register int nbytes; |
| 5186 | char *chars; | 5186 | char *chars; |
| 5187 | register Lisp_Object outstream; | 5187 | register Lisp_Object outstream; |
| 5188 | register struct buffer *old = current_buffer; | ||
| 5189 | register struct Lisp_Process *p = XPROCESS (proc); | 5188 | register struct Lisp_Process *p = XPROCESS (proc); |
| 5190 | register int opoint; | 5189 | register int opoint; |
| 5191 | struct coding_system *coding = proc_decode_coding_system[channel]; | 5190 | struct coding_system *coding = proc_decode_coding_system[channel]; |
| @@ -5385,9 +5384,11 @@ read_process_output (proc, channel) | |||
| 5385 | int opoint_byte; | 5384 | int opoint_byte; |
| 5386 | Lisp_Object text; | 5385 | Lisp_Object text; |
| 5387 | struct buffer *b; | 5386 | struct buffer *b; |
| 5387 | int count = SPECPDL_INDEX (); | ||
| 5388 | 5388 | ||
| 5389 | odeactivate = Vdeactivate_mark; | 5389 | odeactivate = Vdeactivate_mark; |
| 5390 | 5390 | ||
| 5391 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 5391 | Fset_buffer (p->buffer); | 5392 | Fset_buffer (p->buffer); |
| 5392 | opoint = PT; | 5393 | opoint = PT; |
| 5393 | opoint_byte = PT_BYTE; | 5394 | opoint_byte = PT_BYTE; |
| @@ -5490,7 +5491,7 @@ read_process_output (proc, channel) | |||
| 5490 | 5491 | ||
| 5491 | current_buffer->read_only = old_read_only; | 5492 | current_buffer->read_only = old_read_only; |
| 5492 | SET_PT_BOTH (opoint, opoint_byte); | 5493 | SET_PT_BOTH (opoint, opoint_byte); |
| 5493 | set_buffer_internal (old); | 5494 | unbind_to (count, Qnil); |
| 5494 | } | 5495 | } |
| 5495 | return nbytes; | 5496 | return nbytes; |
| 5496 | } | 5497 | } |