Commit 458c8af4 authored by Kenichi Handa's avatar Kenichi Handa
Browse files

(Fset_buffer_multibyte): Correctly recover a narrowed

region when a buffer is changed to unibyte.
parent 3bb804d0
......@@ -5,6 +5,9 @@
2003-05-31 Kenichi Handa <handa@m17n.org>
* buffer.c (Fset_buffer_multibyte): Correctly recover a narrowed
region when a buffer is changed to unibyte.
* charset.h (VALID_LEADING_CODE_P): New macro.
(UNIBYTE_STR_AS_MULTIBYTE_P): Check more rigidly.
......
......@@ -2049,7 +2049,7 @@ but the contents viewed as characters do change. */)
Lisp_Object tail, markers;
struct buffer *other;
int undo_enabled_p = !EQ (current_buffer->undo_list, Qt);
int begv = BEGV, zv = ZV;
int begv, zv;
int narrowed = (BEG != begv || Z != zv);
int modified_p = !NILP (Fbuffer_modified_p (Qnil));
......@@ -2068,6 +2068,11 @@ but the contents viewed as characters do change. */)
/* If the cached position is for this buffer, clear it out. */
clear_charpos_cache (current_buffer);
if (NILP (flag))
begv = BEGV_BYTE, zv = ZV_BYTE;
else
begv = BEGV, zv = ZV;
if (narrowed)
Fwiden ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment