]> code.delx.au - gnu-emacs/blobdiff - src/eval.c
(set_text_properties): New function. Like
[gnu-emacs] / src / eval.c
index c879ecb7ec43bb3c7508543bbfeb0de8a5d0f075..f911433e7120668db6f1a4b1661d98547676b0a8 100644 (file)
@@ -1,5 +1,5 @@
 /* Evaluator for GNU Emacs Lisp interpreter.
-   Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995 Free Software Foundation, Inc.
+   Copyright (C) 1985, 86, 87, 93, 94, 95, 1999 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -21,10 +21,6 @@ Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
 
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#endif
-
 #include "lisp.h"
 #include "blockinput.h"
 
@@ -85,10 +81,16 @@ struct catchtag
     int lisp_eval_depth;
     int pdlcount;
     int poll_suppress_count;
+    struct byte_stack *byte_stack;
   };
 
 struct catchtag *catchlist;
 
+#ifdef DEBUG_GCPRO
+/* Count levels of GCPRO to detect failure to UNGCPRO.  */
+int gcpro_level;
+#endif
+
 Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp, Qdefun;
 Lisp_Object Qinhibit_quit, Vinhibit_quit, Vquit_flag;
 Lisp_Object Qmocklisp_arguments, Vmocklisp_arguments, Qmocklisp;
@@ -189,6 +191,9 @@ init_eval ()
   Vquit_flag = Qnil;
   debug_on_next_call = 0;
   lisp_eval_depth = 0;
+#ifdef DEBUG_GCPRO
+  gcpro_level = 0;
+#endif
   /* This is less than the initial value of num_nonmacro_input_events.  */
   when_entered_debugger = -1;
 }
@@ -918,6 +923,7 @@ internal_catch (tag, func, arg)
   c.pdlcount = specpdl_ptr - specpdl;
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
+  c.byte_stack = byte_stack_list;
   catchlist = &c;
 
   /* Call FUNC.  */
@@ -970,7 +976,14 @@ unwind_to_catch (catch, value)
     }
   while (! last_time);
 
+  byte_stack_list = catch->byte_stack;
   gcprolist = catch->gcpro;
+#ifdef DEBUG_GCPRO
+  if (gcprolist != 0)
+    gcpro_level = gcprolist->level + 1;
+  else
+    gcpro_level = 0;
+#endif
   backtrace_list = catch->backlist;
   lisp_eval_depth = catch->lisp_eval_depth;
   
@@ -1075,6 +1088,7 @@ See also the function `signal' for more info.")
   c.pdlcount = specpdl_ptr - specpdl;
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
+  c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
     {
       if (!NILP (h.var))
@@ -1135,6 +1149,7 @@ internal_condition_case (bfun, handlers, hfun)
   c.pdlcount = specpdl_ptr - specpdl;
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
+  c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
     {
       return (*hfun) (c.val);
@@ -1174,6 +1189,7 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
   c.pdlcount = specpdl_ptr - specpdl;
   c.poll_suppress_count = poll_suppress_count;
   c.gcpro = gcprolist;
+  c.byte_stack = byte_stack_list;
   if (_setjmp (c.jmp))
     {
       return (*hfun) (c.val);