1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 12:21:25 -08:00

Make 'load-dangerous-libraries' obsolete (Bug#37819)

When 'load-dangerous-libraries' was t, Emacs allowed loading .elc
files compiled by XEmacs.  This patch removes the support for that use
case, and declares the variable obsolete.

* lisp/subr.el (load-dangerous-libraries): Declare obsolete.
* src/lread.c (Fload): Ignore its value, and thereby refuse to load
files byte compiled by XEmacs.
(syms_of_lread): Update doc string of 'bytecomp-version-regexp' to not
refer to it.
* doc/emacs/building.texi (Lisp Libraries): Remove its documentation.
This commit is contained in:
Stefan Kangas 2020-03-01 01:19:23 +01:00
parent 79fe320566
commit e98ee8ddac
4 changed files with 13 additions and 25 deletions

View file

@ -1528,13 +1528,6 @@ Automatic loading also occurs when completing names for
prefix being completed. To disable this feature, change the variable
@code{help-enable-completion-autoload} to @code{nil}.
@vindex load-dangerous-libraries
@cindex Lisp files byte-compiled by XEmacs
By default, Emacs refuses to load compiled Lisp files which were
compiled with XEmacs, a modified version of Emacs---they can cause
Emacs to crash. Set the variable @code{load-dangerous-libraries} to
@code{t} if you want to try loading them.
@node Lisp Eval
@section Evaluating Emacs Lisp Expressions
@cindex Emacs Lisp mode

View file

@ -202,6 +202,11 @@ Emacs now supports bignums so this old glitch is no longer needed.
'previous-system-time-locale' have been removed, as they were created
by mistake and were not useful to Lisp code.
** The 'load-dangerous-libraries' variable is now obsolete.
It was used to allow loading Lisp libraries compiled by XEmacs, a
modified version of Emacs which is no longer actively maintained.
This is no longer supported, and setting this variable has no effect.
* Lisp Changes in Emacs 28.1

View file

@ -1621,6 +1621,9 @@ be a list of the form returned by `event-start' and `event-end'."
(defvaralias 'messages-buffer-max-lines 'message-log-max)
(define-obsolete-variable-alias 'inhibit-null-byte-detection
'inhibit-nul-byte-detection "27.1")
(make-obsolete-variable 'load-dangerous-libraries
"no longer used." "27.1")
;;;; Alternate names for functions - these are not being phased out.

View file

@ -979,9 +979,7 @@ lisp_file_lexically_bound_p (Lisp_Object readcharfun)
/* Value is a version number of byte compiled code if the file
associated with file descriptor FD is a compiled Lisp file that's
safe to load. Only files compiled with Emacs are safe to load.
Files compiled with XEmacs can lead to a crash in Fbyte_code
because of an incompatible change in the byte compiler. */
safe to load. Only files compiled with Emacs can be loaded. */
static int
safe_to_load_version (int fd)
@ -1135,7 +1133,6 @@ Return t if the file exists and loads successfully. */)
/* True means we are loading a compiled file. */
bool compiled = 0;
Lisp_Object handler;
bool safe_p = 1;
const char *fmode = "r" FOPEN_TEXT;
int version;
@ -1318,11 +1315,7 @@ Return t if the file exists and loads successfully. */)
if (version < 0
&& ! (version = safe_to_load_version (fd)))
{
safe_p = 0;
if (!load_dangerous_libraries)
error ("File `%s' was not compiled in Emacs", SDATA (found));
else if (!NILP (nomessage) && !force_load_messages)
message_with_string ("File `%s' not compiled in Emacs", found, 1);
error ("File `%s' was not compiled in Emacs", SDATA (found));
}
compiled = 1;
@ -1429,10 +1422,7 @@ Return t if the file exists and loads successfully. */)
if (NILP (nomessage) || force_load_messages)
{
if (!safe_p)
message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...",
file, 1);
else if (is_module)
if (is_module)
message_with_string ("Loading %s (module)...", file, 1);
else if (!compiled)
message_with_string ("Loading %s (source)...", file, 1);
@ -1492,10 +1482,7 @@ Return t if the file exists and loads successfully. */)
if (!noninteractive && (NILP (nomessage) || force_load_messages))
{
if (!safe_p)
message_with_string ("Loading %s (compiled; note unsafe, not compiled in Emacs)...done",
file, 1);
else if (is_module)
if (is_module)
message_with_string ("Loading %s (module)...done", file, 1);
else if (!compiled)
message_with_string ("Loading %s (source)...done", file, 1);
@ -4975,7 +4962,7 @@ This overrides the value of the NOMESSAGE argument to `load'. */);
When Emacs loads a compiled Lisp file, it reads the first 512 bytes
from the file, and matches them against this regular expression.
When the regular expression matches, the file is considered to be safe
to load. See also `load-dangerous-libraries'. */);
to load. */);
Vbytecomp_version_regexp
= build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");