GNU bug report logs - #37819
[PATCH] Make 'load-dangerous-libraries' obsolete

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefan <at> marxist.se>

Date: Sat, 19 Oct 2019 00:11:02 UTC

Severity: minor

Tags: patch

Fixed in version 28.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37819 in the body.
You can then email your comments to 37819 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Sat, 19 Oct 2019 00:11:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Kangas <stefan <at> marxist.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 19 Oct 2019 00:11:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Sat, 19 Oct 2019 02:09:59 +0200
[Message part 1 (text/plain, inline)]
I suspect that 'load-dangerous-libraries' is largely irrelevant
nowadays.  Is this correct?  If yes, here is a patch which would
ignore it and declare it obsolete.

Best regards,
Stefan Kangas
[0001-Make-load-dangerous-libraries-obsolete.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Sat, 19 Oct 2019 06:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Sat, 19 Oct 2019 09:30:12 +0300
> From: Stefan Kangas <stefan <at> marxist.se>
> Date: Sat, 19 Oct 2019 02:09:59 +0200
> 
> I suspect that 'load-dangerous-libraries' is largely irrelevant
> nowadays.  Is this correct?  If yes, here is a patch which would
> ignore it and declare it obsolete.

What is the purpose of declaring this obsolete?  I'd argue we should
keep this "forever", since it can never do any harm, and sometimes
might do an important job.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Sat, 19 Oct 2019 08:34:02 GMT) Full text and rfc822 format available.

Message #11 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37819 <at> debbugs.gnu.org, Stefan Kangas <stefan <at> marxist.se>
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Sat, 19 Oct 2019 10:33:40 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I suspect that 'load-dangerous-libraries' is largely irrelevant
>> nowadays.  Is this correct?  If yes, here is a patch which would
>> ignore it and declare it obsolete.
>
> What is the purpose of declaring this obsolete?  I'd argue we should
> keep this "forever", since it can never do any harm, and sometimes
> might do an important job.

The patch just makes Emacs refuse to load .elc files compiled by XEmacs
permanently, so it looks like the right thing to me.  But perhaps for
Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Sat, 19 Oct 2019 11:56:02 GMT) Full text and rfc822 format available.

Message #14 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Sat, 19 Oct 2019 13:55:35 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> I suspect that 'load-dangerous-libraries' is largely irrelevant
> >> nowadays.  Is this correct?  If yes, here is a patch which would
> >> ignore it and declare it obsolete.
> >
> > What is the purpose of declaring this obsolete?  I'd argue we should
> > keep this "forever", since it can never do any harm, and sometimes
> > might do an important job.
>
> The patch just makes Emacs refuse to load .elc files compiled by XEmacs
> permanently, so it looks like the right thing to me.

That is my understanding too.  The use-case of loading XEmacs byte
code is, I think, not very relevant.

Is it used for anything else?  If yes, I think we should change the
documentation to discuss that instead.  If no, I believe making it
obsolete makes sense.

> But perhaps for Emacs 28.

I have nothing against that.  (We'd also have to announce this in
NEWS; I didn't do that yet.)

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Fri, 17 Jan 2020 06:26:02 GMT) Full text and rfc822 format available.

Message #17 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Fri, 17 Jan 2020 07:25:34 +0100
[Message part 1 (text/plain, inline)]
Stefan Kangas <stefan <at> marxist.se> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> I suspect that 'load-dangerous-libraries' is largely irrelevant
>> >> nowadays.  Is this correct?  If yes, here is a patch which would
>> >> ignore it and declare it obsolete.
>> >
>> > What is the purpose of declaring this obsolete?  I'd argue we should
>> > keep this "forever", since it can never do any harm, and sometimes
>> > might do an important job.
>>
>> The patch just makes Emacs refuse to load .elc files compiled by XEmacs
>> permanently, so it looks like the right thing to me.
>
> That is my understanding too.  The use-case of loading XEmacs byte
> code is, I think, not very relevant.
>
> Is it used for anything else?  If yes, I think we should change the
> documentation to discuss that instead.  If no, I believe making it
> obsolete makes sense.
>
>> But perhaps for Emacs 28.
>
> I have nothing against that.  (We'd also have to announce this in
> NEWS; I didn't do that yet.)

I have attached an updated patch with a NEWS entry.

Does anyone have any objections to installing this on master?

Best regards,
Stefan Kangas

[0001-Make-load-dangerous-libraries-obsolete-Bug-37819.patch (text/x-diff, inline)]
From c428ffb949a8cf786e61afb24b8d4bb992049b95 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefankangas <at> gmail.com>
Date: Sat, 19 Oct 2019 02:05:50 +0200
Subject: [PATCH] Make 'load-dangerous-libraries' obsolete (Bug#37819)

* lisp/subr.el (load-dangerous-libraries): Declare obsolete.
* src/lread.c (Fload): Ignore its value.
(syms_of_lread): Update doc string of 'bytecomp-version-regexp' to not
refer to it.
* doc/emacs/building.texi (Lisp Libraries): Remove its documentation.
---
 doc/emacs/building.texi | 7 -------
 etc/NEWS                | 5 +++++
 lisp/subr.el            | 3 +++
 src/lread.c             | 7 ++-----
 4 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 02f18865f3..272b08d08e 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1528,13 +1528,6 @@ Lisp Libraries
 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
diff --git a/etc/NEWS b/etc/NEWS
index f5740c8b3c..6d5cac333d 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -67,6 +67,11 @@ Formerly it made an exception for integer components of SOA records,
 because SOA serial numbers can exceed fixnum ranges on 32-bit platforms.
 Emacs now supports bignums so this old glitch is no longer needed.
 
+** The 'load-dangerous-libraries' variable is now obsolete.
+It was used to allow loading Lisp libraries compiled by XEmacs, a
+modified version by 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
 
diff --git a/lisp/subr.el b/lisp/subr.el
index 0e09228f6f..8f73614d0a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1621,6 +1621,9 @@ log10
 (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.
 
diff --git a/src/lread.c b/src/lread.c
index 290b3d3d64..3ba13bd1ec 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1337,10 +1337,7 @@ DEFUN ("load", Fload, Sload, 1, 5, 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;
@@ -5022,7 +5019,7 @@ syms_of_lread (void)
 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\\)");
 
-- 
2.20.1


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Wed, 22 Jan 2020 13:23:02 GMT) Full text and rfc822 format available.

Message #20 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Wed, 22 Jan 2020 14:22:48 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Does anyone have any objections to installing this on master?

Looks good to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Fri, 24 Jan 2020 19:44:01 GMT) Full text and rfc822 format available.

Message #23 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Thu, 23 Jan 2020 18:12:48 +0100
[Message part 1 (text/plain, inline)]
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>> Does anyone have any objections to installing this on master?
>
> Looks good to me.

I realized that we can also remove some now extraneous warnings that
will never happen with the patch (since Fload errors out before them).
Please find attached an updated patch.

Best regards,
Stefan Kangas

[0001-Make-load-dangerous-libraries-obsolete-Bug-37819.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Wed, 19 Feb 2020 13:14:02 GMT) Full text and rfc822 format available.

Message #26 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Wed, 19 Feb 2020 14:12:57 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

>>> Does anyone have any objections to installing this on master?
>>
>> Looks good to me.
>
> I realized that we can also remove some now extraneous warnings that
> will never happen with the patch (since Fload errors out before them).
> Please find attached an updated patch.

Looks even better.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37819; Package emacs. (Sun, 01 Mar 2020 00:21:02 GMT) Full text and rfc822 format available.

Message #29 received at 37819 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37819 <at> debbugs.gnu.org
Subject: Re: bug#37819: [PATCH] Make 'load-dangerous-libraries' obsolete
Date: Sun, 01 Mar 2020 01:20:22 +0100
close 37819 28.1
thanks

Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Kangas <stefan <at> marxist.se> writes:
>
>>>> Does anyone have any objections to installing this on master?
>>>
>>> Looks good to me.
>>
>> I realized that we can also remove some now extraneous warnings that
>> will never happen with the patch (since Fload errors out before them).
>> Please find attached an updated patch.
>
> Looks even better.  :-)

Thanks, now pushed to master as commit e98ee8ddac.

Best regards,
Stefan Kangas




bug marked as fixed in version 28.1, send any further explanations to 37819 <at> debbugs.gnu.org and Stefan Kangas <stefan <at> marxist.se> Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Sun, 01 Mar 2020 00:21:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 29 Mar 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.