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.
This commit is contained in:
parent
b0126eac41
commit
198a7a97ff
18 changed files with 47 additions and 112 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ lisp = $(CURDIR)/../../lisp
|
|||
# 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
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -22,12 +22,6 @@ hardware (as true compiled code is), byte-code is completely
|
|||
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.
|
||||
|
||||
|
|
|
@ -367,13 +367,6 @@ example) is read without decoding, the text of the program will be
|
|||
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
|
||||
|
|
|
@ -102,9 +102,6 @@ it contains unibyte encoded text or binary non-text data.
|
|||
|
||||
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
|
||||
|
|
4
etc/NEWS
4
etc/NEWS
|
@ -59,6 +59,10 @@ automatically select it.
|
|||
|
||||
* 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
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ buildlisppath=${srcdir}/../lisp
|
|||
|
||||
# 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.
|
||||
|
|
|
@ -37,7 +37,7 @@ BUILT_EMACS = $(THISDIR)/$(dot)$(dot)/src/$(BLD)/emacs.exe
|
|||
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)
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -33,10 +33,9 @@ VPATH = $(srcdir)
|
|||
# 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 =
|
||||
|
|
|
@ -326,8 +326,7 @@ Return t if file exists."
|
|||
(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 @@ Return t if file exists."
|
|||
(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)
|
||||
|
|
|
@ -32,10 +32,9 @@ srcdir = $(CURDIR)/..
|
|||
|
||||
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 =
|
||||
|
|
|
@ -785,15 +785,16 @@ opening the first frame (e.g. open a connection to an X server).")
|
|||
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 @@ A fancy display is used on graphic displays, normal otherwise."
|
|||
(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
|
||||
|
|
|
@ -34,7 +34,7 @@ s|\([ ]\)echo|\1djecho|g
|
|||
|
||||
/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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -285,8 +285,7 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
|
|||
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,
|
||||
|
|
66
src/emacs.c
66
src/emacs.c
|
@ -1332,68 +1332,6 @@ main (int argc, char **argv)
|
|||
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 @@ const struct standard_args standard_args[] =
|
|||
{ "-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 },
|
||||
|
|
Loading…
Add table
Reference in a new issue