]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
Merge from origin/emacs-25
[gnu-emacs] / src / keyboard.c
index b26cee246732710c2913cc8df0e593da906a3018..4d1072776348fa5e6386efc92821841d3b92655a 100644 (file)
@@ -3220,33 +3220,37 @@ record_char (Lisp_Object c)
   else
     store_kbd_macro_char (c);
 
-  if (!recorded)
-    {
-      total_keys += total_keys < NUM_RECENT_KEYS;
-      ASET (recent_keys, recent_keys_index, c);
-      if (++recent_keys_index >= NUM_RECENT_KEYS)
-       recent_keys_index = 0;
-    }
-  else if (recorded < 0)
+  /* recent_keys should not include events from keyboard macros.  */
+  if (NILP (Vexecuting_kbd_macro))
     {
-      /* We need to remove one or two events from recent_keys.
-         To do this, we simply put nil at those events and move the
-        recent_keys_index backwards over those events.  Usually,
-        users will never see those nil events, as they will be
-        overwritten by the command keys entered to see recent_keys
-        (e.g. C-h l).  */
-
-      while (recorded++ < 0 && total_keys > 0)
+      if (!recorded)
        {
-         if (total_keys < NUM_RECENT_KEYS)
-           total_keys--;
-         if (--recent_keys_index < 0)
-           recent_keys_index = NUM_RECENT_KEYS - 1;
-         ASET (recent_keys, recent_keys_index, Qnil);
+         total_keys += total_keys < NUM_RECENT_KEYS;
+         ASET (recent_keys, recent_keys_index, c);
+         if (++recent_keys_index >= NUM_RECENT_KEYS)
+           recent_keys_index = 0;
+       }
+      else if (recorded < 0)
+       {
+         /* We need to remove one or two events from recent_keys.
+            To do this, we simply put nil at those events and move the
+            recent_keys_index backwards over those events.  Usually,
+            users will never see those nil events, as they will be
+            overwritten by the command keys entered to see recent_keys
+            (e.g. C-h l).  */
+
+         while (recorded++ < 0 && total_keys > 0)
+           {
+             if (total_keys < NUM_RECENT_KEYS)
+               total_keys--;
+             if (--recent_keys_index < 0)
+               recent_keys_index = NUM_RECENT_KEYS - 1;
+             ASET (recent_keys, recent_keys_index, Qnil);
+           }
        }
-    }
 
-  num_nonmacro_input_events++;
+      num_nonmacro_input_events++;
+    }
 
   /* Write c to the dribble file.  If c is a lispy event, write
      the event's symbol to the dribble file, in <brackets>.  Bleaugh.
@@ -7141,9 +7145,6 @@ struct user_signal_info
 /* List of user signals.  */
 static struct user_signal_info *user_signals = NULL;
 
-/* Function called when handling user signals.  */
-void (*handle_user_signal_hook) (int);
-
 void
 add_user_signal (int sig, const char *name)
 {
@@ -7192,8 +7193,6 @@ handle_user_signal (int sig)
           }
 
        p->npending++;
-       if (handle_user_signal_hook)
-         (*handle_user_signal_hook) (sig);
 #ifdef USABLE_SIGIO
        if (interrupt_input)
          handle_input_available_signal (sig);
@@ -10300,13 +10299,16 @@ handle_interrupt (bool in_signal_handler)
         is used.  Note that [Enter] is not echoed by dos.  */
       cursor_to (SELECTED_FRAME (), 0, 0);
 #endif
+
+      write_stdout ("Emacs is resuming after an emergency escape.\n");
+
       /* It doesn't work to autosave while GC is in progress;
         the code used for auto-saving doesn't cope with the mark bit.  */
       if (!gc_in_progress)
        {
          write_stdout ("Auto-save? (y or n) ");
          c = read_stdin ();
-         if ((c & 040) == 'Y')
+         if (c == 'y' || c == 'Y')
            {
              Fdo_auto_save (Qt, Qnil);
 #ifdef MSDOS
@@ -10338,7 +10340,7 @@ handle_interrupt (bool in_signal_handler)
       write_stdout ("Abort (and dump core)? (y or n) ");
 #endif
       c = read_stdin ();
-      if ((c & ~040) == 'Y')
+      if (c == 'y' || c == 'Y')
        emacs_abort ();
       while (c != '\n')
        c = read_stdin ();
@@ -11620,10 +11622,10 @@ It's called with one argument, the help string to display.  */);
   DEFVAR_LISP ("disable-point-adjustment", Vdisable_point_adjustment,
               doc: /* If non-nil, suppress point adjustment after executing a command.
 
-After a command is executed, if point is moved into a region that has
-special properties (e.g. composition, display), we adjust point to
-the boundary of the region.  But, when a command sets this variable to
-non-nil, we suppress the point adjustment.
+After a command is executed, if point moved into a region that has
+special properties (e.g. composition, display), Emacs adjusts point to
+the boundary of the region.  But when a command binds this variable to
+non-nil, this point adjustment is suppressed.
 
 This variable is set to nil before reading a command, and is checked
 just after executing the command.  */);
@@ -11631,9 +11633,9 @@ just after executing the command.  */);
 
   DEFVAR_LISP ("global-disable-point-adjustment",
               Vglobal_disable_point_adjustment,
-              doc: /* If non-nil, always suppress point adjustment.
+              doc: /* If non-nil, always suppress point adjustments.
 
-The default value is nil, in which case, point adjustment are
+The default value is nil, in which case point adjustments are
 suppressed only after special commands that set
 `disable-point-adjustment' (which see) to non-nil.  */);
   Vglobal_disable_point_adjustment = Qnil;