changeset 51391:61ea5c492ffb

(Fset_buffer_multibyte): Correctly recover a narrowed region when a buffer is changed to unibyte.
author Kenichi Handa <handa@m17n.org>
date Sun, 01 Jun 2003 23:27:34 +0000
parents e5fd0e74ccb2
children c887da7aa57a
files src/buffer.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/buffer.c	Sun Jun 01 23:07:31 2003 +0000
+++ b/src/buffer.c	Sun Jun 01 23:27:34 2003 +0000
@@ -2049,7 +2049,7 @@
   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 @@
   /* 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 ();