use dynwind_begin and dynwind_end
[bpt/emacs.git] / src / callint.c
index d46ab23..a036f44 100644 (file)
@@ -297,7 +297,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
   Lisp_Object teml;
   Lisp_Object up_event;
   Lisp_Object enable;
-  ptrdiff_t speccount = SPECPDL_INDEX ();
+  dynwind_begin ();
 
   /* The index of the next element of this_command_keys to examine for
      the 'e' interactive code.  */
@@ -412,11 +412,13 @@ invoke it.  If KEYS is omitted or nil, the return value of
       kset_last_command (current_kboard, save_last_command);
 
       {
-       Lisp_Object args[3];
+       Lisp_Object tem0, args[3];
        args[0] = Qfuncall_interactively;
        args[1] = function;
        args[2] = specs;
-       return unbind_to (speccount, Fapply (3, args));
+       tem0 = Fapply (3, args);
+        dynwind_end ();
+        return tem0;
       }
     }
 
@@ -617,7 +619,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
 
        case 'k':               /* Key sequence.  */
          {
-           ptrdiff_t speccount1 = SPECPDL_INDEX ();
+           dynwind_begin ();
            specbind (Qcursor_in_echo_area, Qt);
            /* Prompt in `minibuffer-prompt' face.  */
            Fput_text_property (make_number (0),
@@ -625,7 +627,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
                                Qface, Qminibuffer_prompt, callint_message);
            args[i] = Fread_key_sequence (callint_message,
                                          Qnil, Qnil, Qnil, Qnil);
-           unbind_to (speccount1, Qnil);
+           dynwind_end ();
            teml = args[i];
            visargs[i] = Fkey_description (teml, Qnil);
 
@@ -649,7 +651,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
 
        case 'K':               /* Key sequence to be defined.  */
          {
-           ptrdiff_t speccount1 = SPECPDL_INDEX ();
+           dynwind_begin ();
            specbind (Qcursor_in_echo_area, Qt);
            /* Prompt in `minibuffer-prompt' face.  */
            Fput_text_property (make_number (0),
@@ -659,7 +661,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
                                                 Qnil, Qt, Qnil, Qnil);
            teml = args[i];
            visargs[i] = Fkey_description (teml, Qnil);
-           unbind_to (speccount1, Qnil);
+           dynwind_end ();
 
            /* If the key sequence ends with a down-event,
               discard the following up-event.  */
@@ -824,7 +826,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
       if (tem) tem++;
       else tem = "";
     }
-  unbind_to (speccount, Qnil);
+  dynwind_end ();
 
   QUIT;
 
@@ -871,7 +873,8 @@ invoke it.  If KEYS is omitted or nil, the return value of
   {
     Lisp_Object val = Ffuncall (nargs, args);
     UNGCPRO;
-    return unbind_to (speccount, val);
+    dynwind_end ();
+    return val;
   }
 }