]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fcombine_after_change_execute): Return nil if
authorChong Yidong <cyd@stupidchicken.com>
Wed, 28 Feb 2007 22:21:25 +0000 (22:21 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Wed, 28 Feb 2007 22:21:25 +0000 (22:21 +0000)
combine_after_change_buffer has been invalidated.

src/insdel.c

index 08043147cdf6ebf15454cb8c4096a7e05bd0a3e2..7f15f7de52d40249758f1ffbe86f7303cb44b88d 100644 (file)
@@ -2351,6 +2351,17 @@ DEFUN ("combine-after-change-execute", Fcombine_after_change_execute,
   if (NILP (combine_after_change_list))
     return Qnil;
 
+  /* It is rare for combine_after_change_buffer to be invalid, but
+     possible.  It can happen when combine-after-change-calls is
+     non-nil, and insertion calls a file handler (e.g. through
+     lock_file) which scribbles into a temp file -- cyd  */
+  if (!BUFFERP (combine_after_change_buffer)
+      || NILP (XBUFFER (combine_after_change_buffer)->name))
+    {
+      combine_after_change_list = Qnil;
+      return Qnil;
+    }
+
   record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
 
   Fset_buffer (combine_after_change_buffer);