emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/lread.c


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/lread.c
Date: Sat, 24 Nov 2001 21:13:13 -0500

Index: emacs/src/lread.c
diff -u emacs/src/lread.c:1.272 emacs/src/lread.c:1.273
--- emacs/src/lread.c:1.272     Sun Nov 11 15:10:28 2001
+++ emacs/src/lread.c   Sat Nov 24 21:13:13 2001
@@ -181,10 +181,6 @@
 
 static Lisp_Object Vloads_in_progress;
 
-/* Limit of the depth of recursive loads.  */
-
-Lisp_Object Vrecursive_load_depth_limit;
-
 /* Non-zero means load dangerous compiled Lisp files.  */
 
 int load_dangerous_libraries;
@@ -734,16 +730,18 @@
 
      Also, just loading a file recursively is not always an error in
      the general case; the second load may do something different.  */
-  if (INTEGERP (Vrecursive_load_depth_limit)
-      && XINT (Vrecursive_load_depth_limit) > 0)
-    {
-      Lisp_Object len = Flength (Vloads_in_progress);
-      if (XFASTINT (len) > XFASTINT (Vrecursive_load_depth_limit))
-       Fsignal (Qerror, Fcons (build_string ("Recursive load suspected"),
-                               Fcons (found, Vloads_in_progress)));
-      record_unwind_protect (record_load_unwind, Vloads_in_progress);
-      Vloads_in_progress = Fcons (found, Vloads_in_progress);
-    }
+  {
+    int count = 0;
+    Lisp_Object tem;
+    for (tem = Vloads_in_progress; CONSP (tem); tem = XCDR (tem))
+      if (!NILP (Fequal (found, XCAR (tem))))
+       count++;
+    if (count > 3)
+      Fsignal (Qerror, Fcons (build_string ("Recursive load"),
+                             Fcons (found, Vloads_in_progress)));
+    record_unwind_protect (record_load_unwind, Vloads_in_progress);
+    Vloads_in_progress = Fcons (found, Vloads_in_progress);
+  }
 
   if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]),
             ".elc", 4))
@@ -3657,12 +3655,6 @@
 to load.  See also `load-dangerous-libraries'.  */);
   Vbytecomp_version_regexp
     = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
-
-  DEFVAR_LISP ("recursive-load-depth-limit", &Vrecursive_load_depth_limit,
-              doc: /* Limit for depth of recursive loads.
-Value should be either an integer > 0 specifying the limit, or nil for
-no limit.  */);
-  Vrecursive_load_depth_limit = make_number (50);
 
   /* Vsource_directory was initialized in init_lread.  */
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]