diff options
| author | Kenichi Handa | 2003-06-01 23:28:42 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-06-01 23:28:42 +0000 |
| commit | 458c8af4c61718ecfe10ad476e7399473361268c (patch) | |
| tree | f747c7ecdffd22a4d5b673efd1e3363567b0c54f /src/buffer.c | |
| parent | 3bb804d0795542dfaa4d130997f6a5569553dbb9 (diff) | |
| download | emacs-458c8af4c61718ecfe10ad476e7399473361268c.tar.gz emacs-458c8af4c61718ecfe10ad476e7399473361268c.zip | |
(Fset_buffer_multibyte): Correctly recover a narrowed
region when a buffer is changed to unibyte.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index 09542fc43a6..c4c85cf8623 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -2049,7 +2049,7 @@ but the contents viewed as characters do change. */) | |||
| 2049 | Lisp_Object tail, markers; | 2049 | Lisp_Object tail, markers; |
| 2050 | struct buffer *other; | 2050 | struct buffer *other; |
| 2051 | int undo_enabled_p = !EQ (current_buffer->undo_list, Qt); | 2051 | int undo_enabled_p = !EQ (current_buffer->undo_list, Qt); |
| 2052 | int begv = BEGV, zv = ZV; | 2052 | int begv, zv; |
| 2053 | int narrowed = (BEG != begv || Z != zv); | 2053 | int narrowed = (BEG != begv || Z != zv); |
| 2054 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); | 2054 | int modified_p = !NILP (Fbuffer_modified_p (Qnil)); |
| 2055 | 2055 | ||
| @@ -2068,6 +2068,11 @@ but the contents viewed as characters do change. */) | |||
| 2068 | /* If the cached position is for this buffer, clear it out. */ | 2068 | /* If the cached position is for this buffer, clear it out. */ |
| 2069 | clear_charpos_cache (current_buffer); | 2069 | clear_charpos_cache (current_buffer); |
| 2070 | 2070 | ||
| 2071 | if (NILP (flag)) | ||
| 2072 | begv = BEGV_BYTE, zv = ZV_BYTE; | ||
| 2073 | else | ||
| 2074 | begv = BEGV, zv = ZV; | ||
| 2075 | |||
| 2071 | if (narrowed) | 2076 | if (narrowed) |
| 2072 | Fwiden (); | 2077 | Fwiden (); |
| 2073 | 2078 | ||