# HG changeset patch # User Chong Yidong # Date 1172701285 0 # Node ID f8d6199cdf000195e308ca2fbd6b57e1cfd6721c # Parent 05970829819e7b9e2f1f6bd7c66574526a4ac8cd (Fcombine_after_change_execute): Return nil if combine_after_change_buffer has been invalidated. diff -r 05970829819e -r f8d6199cdf00 src/insdel.c --- a/src/insdel.c Wed Feb 28 22:18:37 2007 +0000 +++ b/src/insdel.c Wed Feb 28 22:21:25 2007 +0000 @@ -2351,6 +2351,17 @@ 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);