aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-04-23 21:19:34 +0000
committerRichard M. Stallman1998-04-23 21:19:34 +0000
commita08a816a25b1a958c9be56ebb9ceeb3651d5de4c (patch)
tree57f1c1bf87e84ec12152b5c6f51dff7159298b78 /src
parent225c215740bc2e03d05ba473996c6edcc975bba6 (diff)
downloademacs-a08a816a25b1a958c9be56ebb9ceeb3651d5de4c.tar.gz
emacs-a08a816a25b1a958c9be56ebb9ceeb3651d5de4c.zip
Include buffer.h
(main): Move the --unibyte code below the most basic initializations. Clear out *Messages* at that point. (main): When handling --unibyte, mark all existing buffers as unibyte; but don't handle it when dumping.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c85
1 files changed, 58 insertions, 27 deletions
diff --git a/src/emacs.c b/src/emacs.c
index ee38b192a1e..26d1f519bba 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. */
39#include "lisp.h" 39#include "lisp.h"
40#include "commands.h" 40#include "commands.h"
41#include "intervals.h" 41#include "intervals.h"
42#include "buffer.h"
42 43
43#include "systty.h" 44#include "systty.h"
44#include "blockinput.h" 45#include "blockinput.h"
@@ -741,29 +742,6 @@ main (argc, argv, envp)
741 742
742 inhibit_window_system = 0; 743 inhibit_window_system = 0;
743 744
744 {
745 int inhibit_unibyte = 0;
746
747 /* --multibyte overrides EMACS_UNIBYTE. */
748 if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
749 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args))
750 inhibit_unibyte = 1;
751
752 /* --unibyte requests that we set up to do everything with single-byte
753 buffers and strings. We need to handle this before calling
754 init_lread, init_editfns and other places that generate Lisp strings
755 from text in the environment. */
756 if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
757 || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
758 || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
759 {
760 Lisp_Object symbol;
761 symbol = intern ("default-enable-multibyte-characters");
762 Fset (symbol, Qnil);
763 Fset_default (symbol, Qnil);
764 }
765 }
766
767 /* Handle the -t switch, which specifies filename to use as terminal */ 745 /* Handle the -t switch, which specifies filename to use as terminal */
768 { 746 {
769 char *term; 747 char *term;
@@ -998,6 +976,59 @@ the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]);
998 init_data (); 976 init_data ();
999 running_asynch_code = 0; 977 running_asynch_code = 0;
1000 978
979 /* Handle --unibyte and the EMACS_UNIBYTE envvar,
980 but not while dumping. */
981 if (
982#ifndef CANNOT_DUMP
983 ! noninteractive || initialized
984#else
985 1
986#endif
987 )
988 {
989 int inhibit_unibyte = 0;
990
991 /* --multibyte overrides EMACS_UNIBYTE. */
992 if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
993 || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args))
994 inhibit_unibyte = 1;
995
996 /* --unibyte requests that we set up to do everything with single-byte
997 buffers and strings. We need to handle this before calling
998 init_lread, init_editfns and other places that generate Lisp strings
999 from text in the environment. */
1000 if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
1001 || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
1002 || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
1003 {
1004 Lisp_Object old_log_max;
1005 Lisp_Object symbol, tail;
1006
1007 symbol = intern ("default-enable-multibyte-characters");
1008 Fset (symbol, Qnil);
1009
1010 /* Erase pre-dump messages in *Messages* now so no abort. */
1011 old_log_max = Vmessage_log_max;
1012 XSETFASTINT (Vmessage_log_max, 0);
1013 message_dolog ("", 0, 1, 0);
1014 Vmessage_log_max = old_log_max;
1015
1016 for (tail = Fbuffer_list (); CONSP (tail);
1017 tail = XCONS (tail)->cdr)
1018 {
1019 Lisp_Object buffer;
1020
1021 buffer = XCONS (tail)->car;
1022 /* Verify that all buffers are empty now, as they
1023 ought to be. */
1024 if (BUF_Z (XBUFFER (buffer)) > BUF_BEG (XBUFFER (buffer)))
1025 abort ();
1026 /* It is safe to do this crudely in an empty buffer. */
1027 XBUFFER (buffer)->enable_multibyte_characters = Qnil;
1028 }
1029 }
1030 }
1031
1001#ifdef MSDOS 1032#ifdef MSDOS
1002 /* Call early 'cause init_environment needs it. */ 1033 /* Call early 'cause init_environment needs it. */
1003 init_dosfns (); 1034 init_dosfns ();
@@ -1265,13 +1296,13 @@ struct standard_args standard_args[] =
1265#ifdef VMS 1296#ifdef VMS
1266 { "-map", "--map-data", 100, 0 }, 1297 { "-map", "--map-data", 100, 0 },
1267#endif 1298#endif
1268 { "-no-unibyte", "--no-unibyte", 96, 0 },
1269 { "-multibyte", "--multibyte", 96, 0 },
1270 { "-unibyte", "--unibyte", 95, 0 },
1271 { "-no-multibyte", "--no-multibyte", 95, 0 },
1272 { "-t", "--terminal", 90, 1 }, 1299 { "-t", "--terminal", 90, 1 },
1273 { "-d", "--display", 80, 1 }, 1300 { "-d", "--display", 80, 1 },
1274 { "-display", 0, 80, 1 }, 1301 { "-display", 0, 80, 1 },
1302 { "-no-unibyte", "--no-unibyte", 76, 0 },
1303 { "-multibyte", "--multibyte", 76, 0 },
1304 { "-unibyte", "--unibyte", 75, 0 },
1305 { "-no-multibyte", "--no-multibyte", 75, 0 },
1275 { "-nw", "--no-windows", 70, 0 }, 1306 { "-nw", "--no-windows", 70, 0 },
1276 { "-batch", "--batch", 60, 0 }, 1307 { "-batch", "--batch", 60, 0 },
1277 { "-q", "--no-init-file", 50, 0 }, 1308 { "-q", "--no-init-file", 50, 0 },