diff options
| author | Richard M. Stallman | 1999-04-09 19:20:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-04-09 19:20:26 +0000 |
| commit | abc9d9597cc0b221bef0abcec1f66d4e4337cb45 (patch) | |
| tree | 3185a7a5d2c0fc9dc7621ebcd963f53369e03ffe /src/buffer.c | |
| parent | 3b72e81d86fc75c1ed4934e6c9ff924223fa77e8 (diff) | |
| download | emacs-abc9d9597cc0b221bef0abcec1f66d4e4337cb45.tar.gz emacs-abc9d9597cc0b221bef0abcec1f66d4e4337cb45.zip | |
(Fmake_indirect_buffer): Copy multibyte status from the base buffer.
(Fset_buffer_multibyte): Copy new multibyte status
into the buffer's indirect buffers.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
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.") | |||
| 466 | b->mark = Fmake_marker (); | 466 | b->mark = Fmake_marker (); |
| 467 | b->name = name; | 467 | b->name = name; |
| 468 | 468 | ||
| 469 | /* The multibyte status belongs to the base buffer. */ | ||
| 470 | b->enable_multibyte_characters = b->base_buffer->enable_multibyte_characters; | ||
| 471 | |||
| 469 | /* Make sure the base buffer has markers for its narrowing. */ | 472 | /* Make sure the base buffer has markers for its narrowing. */ |
| 470 | if (NILP (b->base_buffer->pt_marker)) | 473 | if (NILP (b->base_buffer->pt_marker)) |
| 471 | { | 474 | { |
| @@ -1735,6 +1738,7 @@ but the contents viewed as characters do change.") | |||
| 1735 | Lisp_Object flag; | 1738 | Lisp_Object flag; |
| 1736 | { | 1739 | { |
| 1737 | Lisp_Object tail, markers; | 1740 | Lisp_Object tail, markers; |
| 1741 | struct buffer *other; | ||
| 1738 | 1742 | ||
| 1739 | if (current_buffer->base_buffer) | 1743 | if (current_buffer->base_buffer) |
| 1740 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); | 1744 | error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); |
| @@ -1852,6 +1856,13 @@ but the contents viewed as characters do change.") | |||
| 1852 | set_intervals_multibyte (1); | 1856 | set_intervals_multibyte (1); |
| 1853 | } | 1857 | } |
| 1854 | 1858 | ||
| 1859 | /* Copy this buffer's new multibyte status | ||
| 1860 | into all of its indirect buffers. */ | ||
| 1861 | for (other = all_buffers; other; other = other->next) | ||
| 1862 | if (other->base_buffer == current_buffer && !NILP (other->name)) | ||
| 1863 | other->enable_multibyte_characters | ||
| 1864 | = current_buffer->enable_multibyte_characters; | ||
| 1865 | |||
| 1855 | return flag; | 1866 | return flag; |
| 1856 | } | 1867 | } |
| 1857 | 1868 | ||