From: Gerd Moellmann Date: Thu, 7 Dec 2000 15:53:18 +0000 (+0000) Subject: (read_process_output): Make sure the process marker's X-Git-Tag: emacs-pretest-21.0.93~95 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=926b7e5e3ec4ddb93aaf8d1357020a6b7e8a55a1;p=emacs.git (read_process_output): Make sure the process marker's position is valid when the process buffer is changed in after-change functions. W3 does that. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4f0d0d65093..ca92994f021 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -9,6 +9,10 @@ 2000-12-07 Gerd Moellmann + * process.c (read_process_output): Make sure the process marker's + position is valid when the process buffer is changed in + after-change functions. W3 does that. + * xfns.c (x_free_gcs): New function. * xterm.h (x_free_gcs): Add prototype. diff --git a/src/process.c b/src/process.c index cb51af92af3..c91ab2c24fc 100644 --- a/src/process.c +++ b/src/process.c @@ -3055,6 +3055,7 @@ read_process_output (proc, channel) int before, before_byte; int opoint_byte; Lisp_Object text; + struct buffer *b; odeactivate = Vdeactivate_mark; @@ -3120,7 +3121,14 @@ read_process_output (proc, channel) signal_after_change (before, 0, PT - before); update_compositions (before, PT, CHECK_BORDER); - set_marker_both (p->mark, p->buffer, PT, PT_BYTE); + /* Make sure the process marker's position is valid when the + process buffer is changed in the signal_after_change above. + W3 is known to do that. */ + if (BUFFERP (p->buffer) + && (b = XBUFFER (p->buffer), b != current_buffer)) + set_marker_both (p->mark, p->buffer, BUF_PT (b), BUF_PT_BYTE (b)); + else + set_marker_both (p->mark, p->buffer, PT, PT_BYTE); update_mode_lines++;