- /* Handle --unibyte and the EMACS_UNIBYTE envvar,
- but not while dumping. */
- if (1)
- {
- int inhibit_unibyte = 0;
-
- /* --multibyte overrides EMACS_UNIBYTE. */
- if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
- || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args)
- /* Ignore EMACS_UNIBYTE before dumping. */
- || (!initialized && noninteractive))
- inhibit_unibyte = 1;
-
- /* --unibyte requests that we set up to do everything with single-byte
- buffers and strings. We need to handle this before calling
- init_lread, init_editfns and other places that generate Lisp strings
- from text in the environment. */
- /* Actually this shouldn't be needed as of 20.4 in a generally
- unibyte environment. As handa says, environment values
- aren't now decoded; also existing buffers are now made
- unibyte during startup if .emacs sets unibyte. Tested with
- 8-bit data in environment variables and /etc/passwd, setting
- unibyte and Latin-1 in .emacs. -- Dave Love */
- if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
- || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
- || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
- {
- Lisp_Object old_log_max;
- Lisp_Object symbol, tail;
-
- symbol = intern_c_string ("enable-multibyte-characters");
- Fset_default (symbol, Qnil);
-
- if (initialized)
- {
- /* Erase pre-dump messages in *Messages* now so no abort. */
- old_log_max = Vmessage_log_max;
- XSETFASTINT (Vmessage_log_max, 0);
- message_dolog ("", 0, 1, 0);
- Vmessage_log_max = old_log_max;
- }
-
- for (tail = Vbuffer_alist; CONSP (tail);
- tail = XCDR (tail))
- {
- Lisp_Object buffer;
-
- buffer = Fcdr (XCAR (tail));
- /* Make a multibyte buffer 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);
- set_buffer_temp (current);
- }
- }
- message ("Warning: unibyte sessions are obsolete and will disappear");
- }
- }
-