From: Richard M. Stallman Date: Fri, 9 Apr 1999 19:20:26 +0000 (+0000) Subject: (Fmake_indirect_buffer): Copy multibyte status from the base buffer. X-Git-Tag: emacs-20.4~345 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=abc9d9597cc0b221bef0abcec1f66d4e4337cb45;p=emacs.git (Fmake_indirect_buffer): Copy multibyte status from the base buffer. (Fset_buffer_multibyte): Copy new multibyte status into the buffer's indirect buffers. --- diff --git a/src/buffer.c b/src/buffer.c index 1089872ebe7..9c9653910b1 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -466,6 +466,9 @@ NAME should be a string which is not the name of an existing buffer.") b->mark = Fmake_marker (); b->name = name; + /* The multibyte status belongs to the base buffer. */ + b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters; + /* Make sure the base buffer has markers for its narrowing. */ if (NILP (b->base_buffer->pt_marker)) { @@ -1735,6 +1738,7 @@ but the contents viewed as characters do change.") Lisp_Object flag; { Lisp_Object tail, markers; + struct buffer *other; if (current_buffer->base_buffer) error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); @@ -1852,6 +1856,13 @@ but the contents viewed as characters do change.") set_intervals_multibyte (1); } + /* Copy this buffer's new multibyte status + into all of its indirect buffers. */ + for (other = all_buffers; other; other = other->next) + if (other->base_buffer == current_buffer && !NILP (other->name)) + other->enable_multibyte_characters + = current_buffer->enable_multibyte_characters; + return flag; }