]> git.eshelyaron.com Git - emacs.git/commitdiff
(main): In the case of --unibyte, instead of aborting on
authorKenichi Handa <handa@m17n.org>
Mon, 19 Aug 2002 06:11:52 +0000 (06:11 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 19 Aug 2002 06:11:52 +0000 (06:11 +0000)
finding non-empty buffer, make it unibyte.

src/emacs.c

index 1157f0ee2dc7985b62effb7780782abe63406145..afbad1cd58ec5f35c57444da44b44f2cbd3a7514 100644 (file)
@@ -1270,12 +1270,15 @@ main (argc, argv, envp)
              Lisp_Object buffer;
 
              buffer = Fcdr (XCAR (tail));
-             /* Verify that all buffers are empty now, as they
-                ought to be.  */
-             if (BUF_Z (XBUFFER (buffer)) > BUF_BEG (XBUFFER (buffer)))
-               abort ();
-             /* It is safe to do this crudely in an empty buffer.  */
-             XBUFFER (buffer)->enable_multibyte_characters = Qnil;
+             /* Make all multibyte buffers unibyte.  */
+             if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
+               {
+                 struct buffer *current = current_buffer;
+
+                 set_buffer_temp (XBUFFER (buffer));
+                 Fset_buffer_multibyte (Qnil, Qnil);
+                 set_buffer_temp (current);
+               }
            }
        }
     }