(Fset_buffer_multibyte): Don't make the current buffer as modified if
[bpt/emacs.git] / src / buffer.c
index cc376c9..e7f6db0 100644 (file)
@@ -1875,6 +1875,7 @@ but the contents viewed as characters do change.")
   int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
   int begv = BEGV, zv = ZV;
   int narrowed = (BEG != begv || Z != zv);
+  int modified_p = !NILP (Fbuffer_modified_p (Qnil));
 
   if (current_buffer->base_buffer)
     error ("Cannot do `set-buffer-multibyte' on an indirect buffer");
@@ -2105,6 +2106,10 @@ but the contents viewed as characters do change.")
        other->prevent_redisplay_optimizations_p = 1;
       }
 
+  /* Restore the modifiedness of the buffer.  */
+  if (!modified_p && !NILP (Fbuffer_modified_p (Qnil)))
+    Fset_buffer_modified_p (Qnil);
+
   return flag;
 }
 \f