changeset 102360:f7043754fd19

(Fcall_process): Bind inhibit-modification-hooks to t when decoding process output.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 02 Mar 2009 21:03:21 +0000
parents 562d1ff3feee
children 638b5200da7e
files src/callproc.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/callproc.c	Mon Mar 02 09:01:54 2009 +0000
+++ b/src/callproc.c	Mon Mar 02 21:03:21 2009 +0000
@@ -732,10 +732,18 @@
 	    else
 	      {			/* We have to decode the input.  */
 		Lisp_Object curbuf;
+		int count1 = SPECPDL_INDEX ();
 
 		XSETBUFFER (curbuf, current_buffer);
+		/* We cannot allow after-change-functions be run
+		   during decoding, because that might modify the
+		   buffer, while we rely on process_coding.produced to
+		   faithfully reflect inserted text until we
+		   TEMP_SET_PT_BOTH below.  */
+		specbind (Qinhibit_modification_hooks, Qt);
 		decode_coding_c_string (&process_coding, buf, nread,
 					curbuf);
+		unbind_to (count1, Qnil);
 		if (display_on_the_fly
 		    && CODING_REQUIRE_DETECTION (&saved_coding)
 		    && ! CODING_REQUIRE_DETECTION (&process_coding))