dynwind fixes
authorRobin Templeton <robin@terpri.org>
Wed, 9 Jul 2014 09:45:38 +0000 (05:45 -0400)
committerRobin Templeton <robin@terpri.org>
Sat, 18 Apr 2015 22:49:12 +0000 (18:49 -0400)
src/callint.c
src/doc.c
src/term.c
src/w32fns.c
src/window.c
src/xmenu.c

index a036f44..bccea7f 100644 (file)
@@ -261,13 +261,15 @@ return non-nil.
 usage: (funcall-interactively FUNCTION &rest ARGUMENTS)  */)
      (ptrdiff_t nargs, Lisp_Object *args)
 {
-  ptrdiff_t speccount = SPECPDL_INDEX ();
+  dynwind_begin ();
   temporarily_switch_to_single_kboard (NULL);
 
   /* Nothing special to do here, all the work is inside
      `called-interactively-p'.  Which will look for us as a marker in the
      backtrace.  */
-  return unbind_to (speccount, Ffuncall (nargs, args));
+  Lisp_Object tem = Ffuncall (nargs, args);
+  dynwind_end ();
+  return tem;
 }
 
 DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
@@ -827,6 +829,7 @@ invoke it.  If KEYS is omitted or nil, the return value of
       else tem = "";
     }
   dynwind_end ();
+  dynwind_begin ();
 
   QUIT;
 
index 2eaaffa..5a19029 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -844,7 +844,7 @@ Otherwise, return a new string.  */)
          /* This is for computing the SHADOWS arg for describe_map_tree.  */
          Lisp_Object active_maps = Fcurrent_active_maps (Qnil, Qnil);
          Lisp_Object earlier_maps;
-         ptrdiff_t count = SPECPDL_INDEX ();
+          dynwind_begin ();
 
          changed = 1;
          strp += 2;            /* skip \{ or \< */
@@ -909,7 +909,7 @@ Otherwise, return a new string.  */)
          tem = Fbuffer_string ();
          Ferase_buffer ();
          set_buffer_internal (oldbuf);
-         unbind_to (count, Qnil);
+          dynwind_end ();
 
        subst_string:
          start = SDATA (tem);
index f374e2b..e2c7781 100644 (file)
@@ -3615,7 +3615,7 @@ tty_menu_show (struct frame *f, int x, int y, int menuflags,
       return Qnil;
     }
 
-  specpdl_count = SPECPDL_INDEX ();
+  dynwind_begin ();
 
   /* Avoid crashes if, e.g., another client will connect while we
      are in a menu.  */
@@ -3849,7 +3849,7 @@ tty_menu_show (struct frame *f, int x, int y, int menuflags,
 
  tty_menu_end:
 
-  unbind_to (specpdl_count, Qnil);
+  dynwind_end ();
   return entry;
 }
 
index a848b23..ae335e1 100644 (file)
@@ -4532,7 +4532,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
      could get an infloop in next_frame since the frame is not yet in
      Vframe_list.  */
   {
-    ptrdiff_t count2 = SPECPDL_INDEX ();
+    dynwind_begin ();
 
     record_unwind_protect (unwind_create_frame_1, inhibit_lisp_code);
     inhibit_lisp_code = Qt;
@@ -4560,7 +4560,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
                         ? make_number (0) : make_number (1),
                         NULL, NULL, RES_TYPE_NUMBER);
 
-    unbind_to (count2, Qnil);
+    dynwind_end ();
   }
 
   x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
index 2fa89e8..bf8d8b1 100644 (file)
@@ -6084,7 +6084,7 @@ the return value is nil.  Otherwise the value is t.  */)
       int n_leaf_windows;
       ptrdiff_t k;
       int i, n;
-      ptrdiff_t count = SPECPDL_INDEX ();
+      dynwind_begin ();
       /* If the frame has been resized since this window configuration was
         made, we change the frame to the size specified in the
         configuration, restore the configuration, and then resize it
@@ -6364,7 +6364,7 @@ the return value is nil.  Otherwise the value is t.  */)
 
       adjust_frame_glyphs (f);
       unblock_input ();
-      unbind_to (count, Qnil);
+      dynwind_end ();
 
       /* Scan dead buffer windows.  */
       for (; CONSP (dead_windows); dead_windows = XCDR (dead_windows))
index 92f293b..aa208f8 100644 (file)
@@ -1921,7 +1921,7 @@ xw_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
   Lisp_Object title;
   const char *error_name;
   Lisp_Object selection;
-  ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+  dynwind_begin ();
 
   check_window_system (f);
 
@@ -1943,7 +1943,7 @@ xw_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
   selection = x_dialog_show (f, title, header, &error_name);
   unblock_input ();
 
-  unbind_to (specpdl_count, Qnil);
+  dynwind_end ();
   discard_menu_items ();
 
   if (error_name) error ("%s", error_name);