changeset 109956:ce960720ed3f

Make obsolete --unibyte argument do nothing (Bug#6886). * src/emacs.c (main): Remove --unibyte handling (Bug#6886). * lisp/startup.el (command-line-1): Issue warning for ignored arguments --unibyte, etc (Bug#6886). * doc/lispref/nonascii.texi (Text Representations): * doc/lispref/loading.texi (Loading Non-ASCII): * doc/lispref/compile.texi (Byte Compilation): Don't mention obsolete --unibyte command-line argument.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 22 Aug 2010 17:15:20 -0400
parents 4ed076eb5529
children 083f3bd6ac6e 87dd0fd298be
files admin/unidata/Makefile.in admin/unidata/makefile.w32-in doc/lispref/ChangeLog doc/lispref/compile.texi doc/lispref/loading.texi doc/lispref/nonascii.texi etc/NEWS leim/Makefile.in leim/makefile.w32-in lisp/ChangeLog lisp/Makefile.in lisp/international/mule.el lisp/makefile.w32-in lisp/startup.el msdos/sedleim.inp src/ChangeLog src/doc.c src/emacs.c
diffstat 18 files changed, 47 insertions(+), 112 deletions(-) [+]
line wrap: on
line diff
--- a/admin/unidata/Makefile.in	Sun Aug 22 16:04:34 2010 -0400
+++ b/admin/unidata/Makefile.in	Sun Aug 22 17:15:20 2010 -0400
@@ -21,7 +21,7 @@
 
 EMACS = ../../src/emacs
 DSTDIR = ../../lisp/international
-RUNEMACS = ${EMACS} -Q --multibyte -batch
+RUNEMACS = ${EMACS} -Q -batch
 
 all: ${DSTDIR}/charprop.el ../../src/biditype.h ../../src/bidimirror.h
 
--- a/admin/unidata/makefile.w32-in	Sun Aug 22 16:04:34 2010 -0400
+++ b/admin/unidata/makefile.w32-in	Sun Aug 22 17:15:20 2010 -0400
@@ -27,7 +27,7 @@
 # lisp/subdirs.el is not generated yet when the commands below run.
 EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp
 # Quote EMACS so it could be a file name with embedded whitespace
-RUNEMACS = "$(EMACS)" -Q --multibyte -batch
+RUNEMACS = "$(EMACS)" -Q -batch
 
 all: $(DSTDIR)/charprop.el ../../src/biditype.h ../../src/bidimirror.h
 
--- a/doc/lispref/ChangeLog	Sun Aug 22 16:04:34 2010 -0400
+++ b/doc/lispref/ChangeLog	Sun Aug 22 17:15:20 2010 -0400
@@ -1,3 +1,10 @@
+2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nonascii.texi (Text Representations):
+	* loading.texi (Loading Non-ASCII):
+	* compile.texi (Byte Compilation): Don't mention obsolete
+	--unibyte command-line argument.
+
 2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
 
 	* modes.texi (Defining Minor Modes): Doc fix (Bug#6880).
--- a/doc/lispref/compile.texi	Sun Aug 22 16:04:34 2010 -0400
+++ b/doc/lispref/compile.texi	Sun Aug 22 17:15:20 2010 -0400
@@ -22,12 +22,6 @@
 transportable from machine to machine without recompilation.  It is not,
 however, as fast as true compiled code.
 
-  Compiling a Lisp file with the Emacs byte compiler always reads the
-file as multibyte text, even if Emacs was started with @samp{--unibyte},
-unless the file specifies otherwise.  This is so that compilation gives
-results compatible with running the same file without compilation.
-@xref{Loading Non-ASCII}.
-
   In general, any version of Emacs can run byte-compiled code produced
 by recent earlier versions of Emacs, but the reverse is not true.
 
--- a/doc/lispref/loading.texi	Sun Aug 22 16:04:34 2010 -0400
+++ b/doc/lispref/loading.texi	Sun Aug 22 17:15:20 2010 -0400
@@ -367,13 +367,6 @@
 unibyte text, and its string constants will be unibyte strings.
 @xref{Coding Systems}.
 
-  To make the results more predictable, Emacs always performs decoding
-into the multibyte representation when loading Lisp files, even if it
-was started with the @samp{--unibyte} option.  This means that string
-constants with non-@acronym{ASCII} characters translate into multibyte
-strings.  The only exception is when a particular file specifies no
-decoding.
-
   The reason Emacs is designed this way is so that Lisp programs give
 predictable results, regardless of how Emacs was started.  In addition,
 this enables programs that depend on using multibyte text to work even
--- a/doc/lispref/nonascii.texi	Sun Aug 22 16:04:34 2010 -0400
+++ b/doc/lispref/nonascii.texi	Sun Aug 22 17:15:20 2010 -0400
@@ -102,9 +102,6 @@
 
 You cannot set this variable directly; instead, use the function
 @code{set-buffer-multibyte} to change a buffer's representation.
-
-The @samp{--unibyte} command line option does its job by setting the
-default value to @code{nil} early in startup.
 @end defvar
 
 @defun position-bytes position
--- a/etc/NEWS	Sun Aug 22 16:04:34 2010 -0400
+++ b/etc/NEWS	Sun Aug 22 17:15:20 2010 -0400
@@ -59,6 +59,10 @@
 
 * Startup Changes in Emacs 24.1
 
+** The --unibyte, --multibyte, --no-multibyte, and --no-unibyte
+command line arguments no longer have any effect.  (They were declared
+obsolete in Emacs 23.)
+
 
 * Changes in Emacs 24.1
 
--- a/leim/Makefile.in	Sun Aug 22 16:04:34 2010 -0400
+++ b/leim/Makefile.in	Sun Aug 22 17:15:20 2010 -0400
@@ -48,7 +48,7 @@
 
 # How to run Emacs.
 RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \
-	${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte
+	${BUILT-EMACS} -batch --no-init-file --no-site-file
 
 # Subdirectories to be made if ${srcdir} is different from the current
 # directory.
--- a/leim/makefile.w32-in	Sun Aug 22 16:04:34 2010 -0400
+++ b/leim/makefile.w32-in	Sun Aug 22 17:15:20 2010 -0400
@@ -37,7 +37,7 @@
 buildlisppath=$(CURDIR)/$(dot)$(dot)/lisp
 
 # How to run Emacs.
-RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file --multibyte
+RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file
 
 # Set EMACSLOADPATH correctly (already defined in environment).
 EMACSLOADPATH=$(buildlisppath)
--- a/lisp/ChangeLog	Sun Aug 22 16:04:34 2010 -0400
+++ b/lisp/ChangeLog	Sun Aug 22 17:15:20 2010 -0400
@@ -1,3 +1,8 @@
+2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (command-line-1): Issue warning for ignored arguments
+	--unibyte, etc (Bug#6886).
+
 2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
 
 	* emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880).
--- a/lisp/Makefile.in	Sun Aug 22 16:04:34 2010 -0400
+++ b/lisp/Makefile.in	Sun Aug 22 17:15:20 2010 -0400
@@ -33,10 +33,9 @@
 # to use an absolute file name.
 EMACS = ${abs_top_builddir}/src/emacs
 
-# Command line flags for Emacs.  This must include --multibyte,
-# otherwise some files will not compile.
+# Command line flags for Emacs.
 
-EMACSOPT = -batch --no-site-file --multibyte
+EMACSOPT = -batch --no-site-file
 
 # Extra flags to pass to the byte compiler
 BYTE_COMPILE_EXTRA_FLAGS =
--- a/lisp/international/mule.el	Sun Aug 22 16:04:34 2010 -0400
+++ b/lisp/international/mule.el	Sun Aug 22 17:15:20 2010 -0400
@@ -326,8 +326,7 @@
 	    (with-current-buffer buffer
               ;; So that we don't get completely screwed if the
               ;; file is encoded in some complicated character set,
-              ;; read it with real decoding, as a multibyte buffer,
-              ;; even if this is a --unibyte Emacs session.
+              ;; read it with real decoding, as a multibyte buffer.
               (set-buffer-multibyte t)
 	      ;; Don't let deactivate-mark remain set.
 	      (let (deactivate-mark)
@@ -346,12 +345,7 @@
 	    (eval-buffer buffer nil
 			 ;; This is compatible with what `load' does.
 			 (if purify-flag file fullname)
-			 ;; If this Emacs is running with --unibyte,
-			 ;; convert multibyte strings to unibyte
-			 ;; after reading them.
-;;			 (not (default-value 'enable-multibyte-characters))
-			 nil t
-			 ))
+			 nil t))
 	(let (kill-buffer-hook kill-buffer-query-functions)
 	  (kill-buffer buffer)))
       (do-after-load-evaluation fullname)
--- a/lisp/makefile.w32-in	Sun Aug 22 16:04:34 2010 -0400
+++ b/lisp/makefile.w32-in	Sun Aug 22 17:15:20 2010 -0400
@@ -32,10 +32,9 @@
 
 EMACS = $(THISDIR)/../bin/emacs.exe
 
-# Command line flags for Emacs.  This must include --multibyte,
-# otherwise some files will not compile.
+# Command line flags for Emacs.
 
-EMACSOPT = -batch --no-init-file --no-site-file --multibyte
+EMACSOPT = -batch --no-init-file --no-site-file
 
 # Extra flags to pass to the byte compiler
 BYTE_COMPILE_EXTRA_FLAGS =
--- a/lisp/startup.el	Sun Aug 22 16:04:34 2010 -0400
+++ b/lisp/startup.el	Sun Aug 22 17:15:20 2010 -0400
@@ -785,15 +785,16 @@
                 argi (match-string 1 argi)))
 	(when (string-match "\\`--." orig-argi)
 	  (let ((completion (try-completion argi longopts)))
-	    (if (eq completion t)
-		(setq argi (substring argi 1))
-	      (if (stringp completion)
-		  (let ((elt (assoc completion longopts)))
-		    (or elt
-			(error "Option `%s' is ambiguous" argi))
-		    (setq argi (substring (car elt) 1)))
-		(setq argval nil
-                      argi orig-argi)))))
+	    (cond ((eq completion t)
+		   (setq argi (substring argi 1)))
+		  ((stringp completion)
+		   (let ((elt (assoc completion longopts)))
+		     (unless elt
+		       (error "Option `%s' is ambiguous" argi))
+		     (setq argi (substring (car elt) 1))))
+		  (t
+		   (setq argval nil
+			 argi orig-argi)))))
 	(cond
 	 ;; The --display arg is handled partly in C, partly in Lisp.
 	 ;; When it shows up here, we just put it back to be handled
@@ -2231,6 +2232,11 @@
 		     (move-to-column (1- cl1-column)))
 		   (setq cl1-column 0))
 
+		  ;; These command lines now have no effect.
+		  ((string-match "\\`--?\\(no-\\)?\\(uni\\|multi\\)byte$" argi)
+		   (display-warning 'initialization
+				    (format "Ignoring obsolete arg %s" argi)))
+
 		  ((equal argi "--")
 		   (setq just-files t))
 		  (t
--- a/msdos/sedleim.inp	Sun Aug 22 16:04:34 2010 -0400
+++ b/msdos/sedleim.inp	Sun Aug 22 17:15:20 2010 -0400
@@ -34,7 +34,7 @@
 
 /RUN-EMACS *=/,/^$/c\
 export EMACSLOADPATH=${buildlisppath}\
-RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte
+RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file
 
 /^	cd ../c\
 	${MAKE} -C ../src ${MFLAGS} emacs
--- a/src/ChangeLog	Sun Aug 22 16:04:34 2010 -0400
+++ b/src/ChangeLog	Sun Aug 22 17:15:20 2010 -0400
@@ -1,3 +1,7 @@
+2010-08-22  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs.c (main): Remove handling of --unibyte arg (Bug#6886).
+
 2010-08-22  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP
--- a/src/doc.c	Sun Aug 22 16:04:34 2010 -0400
+++ b/src/doc.c	Sun Aug 22 17:15:20 2010 -0400
@@ -285,8 +285,7 @@
 				to - (get_doc_string_buffer + offset));
   else
     {
-      /* Let the data determine whether the string is multibyte,
-	 even if Emacs is running in --unibyte mode.  */
+      /* The data determines whether the string is multibyte.  */
       int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset,
 					    to - (get_doc_string_buffer + offset));
       return make_string_from_bytes (get_doc_string_buffer + offset,
--- a/src/emacs.c	Sun Aug 22 16:04:34 2010 -0400
+++ b/src/emacs.c	Sun Aug 22 17:15:20 2010 -0400
@@ -1332,68 +1332,6 @@
   init_atimer ();
   running_asynch_code = 0;
 
-  /* 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");
-	}
-    }
-
   no_loadup
     = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
 
@@ -1792,10 +1730,6 @@
   { "-script", "--script", 100, 1 },
   { "-daemon", "--daemon", 99, 0 },
   { "-help", "--help", 90, 0 },
-  { "-no-unibyte", "--no-unibyte", 83, 0 },
-  { "-multibyte", "--multibyte", 82, 0 },
-  { "-unibyte", "--unibyte", 81, 0 },
-  { "-no-multibyte", "--no-multibyte", 80, 0 },
   { "-nl", "--no-loadup", 70, 0 },
   /* -d must come last before the options handled in startup.el.  */
   { "-d", "--display", 60, 1 },