(Fread_file_name): Delete duplicates in
[bpt/emacs.git] / src / eval.c
index 5fb35ce..879f916 100644 (file)
@@ -204,7 +204,7 @@ init_eval_once ()
   specpdl_size = 50;
   specpdl = (struct specbinding *) xmalloc (specpdl_size * sizeof (struct specbinding));
   specpdl_ptr = specpdl;
-  max_specpdl_size = 600;
+  max_specpdl_size = 1000;
   max_lisp_eval_depth = 300;
 
   Vrun_hooks = Qnil;
@@ -573,7 +573,7 @@ optional argument, and making the `interactive' spec specify non-nil
 unconditionally for that argument.  (`p' is a good way to do this.)  */)
      ()
 {
-  return (INTERACTIVE && interactive_p (1)) ? Qt : Qnil;
+  return interactive_p (1) ? Qt : Qnil;
 }
 
 
@@ -595,7 +595,8 @@ interactive_p (exclude_subrs_p)
   /* If this isn't a byte-compiled function, there may be a frame at
      the top for Finteractive_p.  If so, skip it.  */
   fun = Findirect_function (*btp->function);
-  if (SUBRP (fun) && XSUBR (fun) == &Sinteractive_p)
+  if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p
+                     || XSUBR (fun) == &Scalled_interactively_p))
     btp = btp->next;
 
   /* If we're running an Emacs 18-style byte-compiled function, there
@@ -786,6 +787,21 @@ usage: (defvar SYMBOL &optional INITVALUE DOCSTRING)  */)
     {
       if (NILP (tem))
        Fset_default (sym, Feval (Fcar (tail)));
+      else
+       { /* Check if there is really a global binding rather than just a let
+            binding that shadows the global unboundness of the var.  */
+         volatile struct specbinding *pdl = specpdl_ptr;
+         while (--pdl >= specpdl)
+           {
+             if (EQ (pdl->symbol, sym) && !pdl->func
+                 && EQ (pdl->old_value, Qunbound))
+               {
+                 message_with_string ("Warning: defvar ignored because %s is let-bound",
+                                      SYMBOL_NAME (sym), 1);
+                 break;
+               }
+           }
+       }
       tail = Fcdr (tail);
       tem = Fcar (tail);
       if (!NILP (tem))
@@ -1158,9 +1174,10 @@ unwind_to_catch (catch, value)
   /* Save the value in the tag.  */
   catch->val = value;
 
-  /* Restore the polling-suppression count.  */
+  /* Restore certain special C variables.  */
   set_poll_suppress_count (catch->poll_suppress_count);
   interrupt_input_blocked = catch->interrupt_input_blocked;
+  handling_signal = 0;
 
   do
     {
@@ -1996,7 +2013,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
   struct backtrace backtrace;
   struct gcpro gcpro1, gcpro2, gcpro3;
 
-  if (handling_signal || INPUT_BLOCKED_P)
+  if (handling_signal)
     abort ();
 
   if (SYMBOLP (form))
@@ -3314,7 +3331,11 @@ Emacs could overflow the real C stack, and crash.  */);
 
   DEFVAR_LISP ("quit-flag", &Vquit_flag,
               doc: /* Non-nil causes `eval' to abort, unless `inhibit-quit' is non-nil.
-Typing C-g sets `quit-flag' non-nil, regardless of `inhibit-quit'.  */);
+If the value is t, that means do an ordinary quit.
+If the value equals `throw-on-input', that means quit by throwing
+to the tag specified in `throw-on-input'; it's for handling `while-no-input'.
+Typing C-g sets `quit-flag' to t, regardless of `inhibit-quit',
+but `inhibit-quit' non-nil prevents anything from taking notice of that.  */);
   Vquit_flag = Qnil;
 
   DEFVAR_LISP ("inhibit-quit", &Vinhibit_quit,