]> git.eshelyaron.com Git - emacs.git/commitdiff
* keyboard.c (cancel_hourglass_unwind): New function.
authorJan Djärv <jan.h.d@swipnet.se>
Sun, 23 Feb 2003 22:11:20 +0000 (22:11 +0000)
committerJan Djärv <jan.h.d@swipnet.se>
Sun, 23 Feb 2003 22:11:20 +0000 (22:11 +0000)
(command_loop_1): Cancel hourglass with unwind-protect.

src/ChangeLog
src/keyboard.c

index 88d4dd3222ae48cfbb36fdab11bc5c5674caefcd..3e056ced267714f0ed2174fc78f5db3ee122a5f2 100644 (file)
@@ -1,3 +1,8 @@
+2003-02-23  Jan Dj\e,Ad\e(Brv  <jan.h.d@swipnet.se>
+
+       * keyboard.c (cancel_hourglass_unwind): New function.
+       (command_loop_1): Cancel hourglass with unwind-protect.
+
 2003-02-23  Richard M. Stallman  <rms@gnu.org>
 
        * callint.c (fix_command): New subroutine, from Fcall_interactively.
index ec723e3c6581d7c00446019de1991aebef1876e4..17cc6787f7f7011c46ae773769760fe2da0de080 100644 (file)
@@ -1353,6 +1353,15 @@ static int read_key_sequence P_ ((Lisp_Object *, int, Lisp_Object,
 void safe_run_hooks P_ ((Lisp_Object));
 static void adjust_point_for_property P_ ((int, int));
 
+/* Cancel hourglass from protect_unwind.
+   ARG is not used.  */
+static Lisp_Object
+cancel_hourglass_unwind (arg)
+     Lisp_Object arg;
+{
+  cancel_hourglass ();
+}
+
 Lisp_Object
 command_loop_1 ()
 {
@@ -1724,16 +1733,22 @@ command_loop_1 ()
 
          /* Here for a command that isn't executed directly */
 
+          {
 #ifdef HAVE_X_WINDOWS
-         if (display_hourglass_p
-             && NILP (Vexecuting_macro))
-           start_hourglass ();
+            int scount = SPECPDL_INDEX ();
+
+            if (display_hourglass_p
+                && NILP (Vexecuting_macro))
+              {
+                record_unwind_protect (cancel_hourglass_unwind, Qnil);
+                start_hourglass ();
+              }
 #endif
 
-         nonundocount = 0;
-         if (NILP (current_kboard->Vprefix_arg))
-           Fundo_boundary ();
-         Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
+            nonundocount = 0;
+            if (NILP (current_kboard->Vprefix_arg))
+              Fundo_boundary ();
+            Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
 
 #ifdef HAVE_X_WINDOWS
          /* Do not check display_hourglass_p here, because
@@ -1742,8 +1757,9 @@ command_loop_1 ()
             But don't cancel the hourglass within a macro
             just because a command in the macro finishes.  */
          if (NILP (Vexecuting_macro))
-           cancel_hourglass ();
+            unbind_to (scount, Qnil);
 #endif
+          }
        }
     directly_done: ;
       current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;