(byte-compile-insert-header): If emacs-version
[bpt/emacs.git] / src / keyboard.c
index e9f6dc7..625e14b 100644 (file)
@@ -293,14 +293,12 @@ int last_point_position;
 /* The buffer that was current when the last command was started.  */
 Lisp_Object last_point_position_buffer;
 
-#ifdef MULTI_FRAME
 /* The frame in which the last input event occurred, or Qmacro if the
    last event came from a macro.  We use this to determine when to
    generate switch-frame events.  This may be cleared by functions
    like Fselect_frame, to make sure that a switch-frame event is
    generated by the next character.  */
 Lisp_Object internal_last_event_frame;
-#endif
 
 /* A user-visible version of the above, intended to allow users to
    figure out where the last event came from, if the event doesn't
@@ -521,9 +519,6 @@ int flow_control;
 #ifdef HAVE_WINDOW_SYSTEM
 #define POLL_FOR_INPUT
 #endif
-
-/* Non-nil enables Column Number mode.  */
-Lisp_Object Vcolumn_number_mode;
 \f
 /* Global variable declarations.  */
 
@@ -755,6 +750,10 @@ recursive_edit_1 ()
   val = command_loop ();
   if (EQ (val, Qt))
     Fsignal (Qquit, Qnil);
+  /* Handle throw from read_minibuf when using minibuffer
+     while it's active but we're in another window.  */
+  if (STRINGP (val))
+    Fsignal (Qerror, Fcons (val, Qnil));
 
   return unbind_to (count, Qnil);
 }
@@ -888,10 +887,23 @@ cmd_error (data)
      Lisp_Object data;
 {
   Lisp_Object old_level, old_length;
+  char macroerror[50];
+
+  if (!NILP (executing_macro))
+    {
+      if (executing_macro_iterations == 1)
+       sprintf (macroerror, "After 1 kbd macro iteration: ");
+      else
+       sprintf (macroerror, "After %d kbd macro iterations: ",
+                executing_macro_iterations);
+    }
+  else
+    *macroerror = 0;
 
   Vstandard_output = Qt;
   Vstandard_input = Qt;
   Vexecuting_macro = Qnil;
+  executing_macro = Qnil;
   current_kboard->Vprefix_arg = Qnil;
   cancel_echoing ();
 
@@ -900,7 +912,7 @@ cmd_error (data)
   old_length = Vprint_length;
   XSETFASTINT (Vprint_level, 10);
   XSETFASTINT (Vprint_length, 10);
-  cmd_error_internal (data, NULL);
+  cmd_error_internal (data, macroerror);
   Vprint_level = old_level;
   Vprint_length = old_length;
 
@@ -1144,7 +1156,6 @@ command_loop_1 ()
 #endif /* C_ALLOCA */
 
 #if 0
-#ifdef MULTI_FRAME
       /* Select the frame that the last event came from.  Usually,
         switch-frame events will take care of this, but if some lisp
         code swallows a switch-frame event, we'll fix things up here.
@@ -1152,7 +1163,6 @@ command_loop_1 ()
       if (FRAMEP (internal_last_event_frame)
          && XFRAME (internal_last_event_frame) != selected_frame)
        Fselect_frame (internal_last_event_frame, Qnil);
-#endif
 #endif
       /* If it has changed current-menubar from previous value,
         really recompute the menubar from the value.  */
@@ -1169,6 +1179,10 @@ command_loop_1 ()
       i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
                             Qnil, 0, 1);
 
+      /* A filter may have run while we were reading the input.  */
+      if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer)
+       set_buffer_internal (XBUFFER (XWINDOW (selected_window)->buffer));
+
       ++num_input_keys;
 
       /* Now we have read a key sequence of length I,
@@ -1258,12 +1272,14 @@ command_loop_1 ()
                       : (lose >= 0x20 && lose < 0x7f))
                      && (XFASTINT (XWINDOW (selected_window)->last_modified)
                          >= MODIFF)
+                     && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
+                         >= OVERLAY_MODIFF)
                      && (XFASTINT (XWINDOW (selected_window)->last_point)
                          == PT - 1)
                      && !windows_or_buffers_changed
                      && EQ (current_buffer->selective_display, Qnil)
                      && !detect_input_pending ()
-                     && NILP (Vcolumn_number_mode)
+                     && NILP (XWINDOW (selected_window)->column_number_displayed)
                      && NILP (Vexecuting_macro))
                    no_redisplay = direct_output_forward_char (1);
                  goto directly_done;
@@ -1282,12 +1298,14 @@ command_loop_1 ()
                       : (lose >= 0x20 && lose < 0x7f))
                      && (XFASTINT (XWINDOW (selected_window)->last_modified)
                          >= MODIFF)
+                     && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
+                         >= OVERLAY_MODIFF)
                      && (XFASTINT (XWINDOW (selected_window)->last_point)
                          == PT + 1)
                      && !windows_or_buffers_changed
                      && EQ (current_buffer->selective_display, Qnil)
                      && !detect_input_pending ()
-                     && NILP (Vcolumn_number_mode)
+                     && NILP (XWINDOW (selected_window)->column_number_displayed)
                      && NILP (Vexecuting_macro))
                    no_redisplay = direct_output_forward_char (-1);
                  goto directly_done;
@@ -1311,13 +1329,15 @@ command_loop_1 ()
                    }
                  lose = ((XFASTINT (XWINDOW (selected_window)->last_modified)
                           < MODIFF)
+                         || (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
+                             < OVERLAY_MODIFF)
                          || (XFASTINT (XWINDOW (selected_window)->last_point)
                              != PT)
                          || MODIFF <= SAVE_MODIFF
                          || windows_or_buffers_changed
                          || !EQ (current_buffer->selective_display, Qnil)
                          || detect_input_pending ()
-                         || !NILP (Vcolumn_number_mode)
+                         || !NILP (XWINDOW (selected_window)->column_number_displayed)
                          || !NILP (Vexecuting_macro));
                  value = internal_self_insert (c, 0);
                  if (value)
@@ -1373,22 +1393,6 @@ command_loop_1 ()
        }
     directly_done: ;
 
-      /* Note that the value cell will never directly contain nil
-        if the symbol is a local variable.  */
-      if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
-       safe_run_hooks (Qpost_command_hook);
-
-      if (!NILP (Vdeferred_action_list))
-       safe_run_hooks (Qdeferred_action_function);
-
-      if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks))
-       {
-         if (NILP (Vunread_command_events)
-             && NILP (Vexecuting_macro)
-             && !NILP (sit_for (0, post_command_idle_delay, 0, 1)))
-           safe_run_hooks (Qpost_command_idle_hook);
-       }
-
       /* If there is a prefix argument,
         1) We don't want Vlast_command to be ``universal-argument''
         (that would be dumb), so don't set Vlast_command,
@@ -1410,6 +1414,22 @@ command_loop_1 ()
          this_single_command_key_start = 0;
        }
 
+      /* Note that the value cell will never directly contain nil
+        if the symbol is a local variable.  */
+      if (!NILP (Vpost_command_hook) && !NILP (Vrun_hooks))
+       safe_run_hooks (Qpost_command_hook);
+
+      if (!NILP (Vdeferred_action_list))
+       safe_run_hooks (Qdeferred_action_function);
+
+      if (!NILP (Vpost_command_idle_hook) && !NILP (Vrun_hooks))
+       {
+         if (NILP (Vunread_command_events)
+             && NILP (Vexecuting_macro)
+             && !NILP (sit_for (0, post_command_idle_delay, 0, 1)))
+           safe_run_hooks (Qpost_command_idle_hook);
+       }
+
       if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks))
        {
          if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode))
@@ -1713,7 +1733,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
 
   if (!NILP (Vexecuting_macro))
     {
-#ifdef MULTI_FRAME
       /* We set this to Qmacro; since that's not a frame, nobody will
         try to switch frames on us, and the selected window will
         remain unchanged.
@@ -1725,7 +1744,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
         events read from a macro should never cause a new frame to be
         selected. */
       Vlast_event_frame = internal_last_event_frame = Qmacro;
-#endif
 
       /* Exit the macro if we are at the end.
         Also, some things replace the macro with t
@@ -1800,10 +1818,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
   if (_setjmp (local_getcjmp))
     {
       XSETINT (c, quit_char);
-#ifdef MULTI_FRAME
       XSETFRAME (internal_last_event_frame, selected_frame);
       Vlast_event_frame = internal_last_event_frame;
-#endif
       /* If we report the quit char as an event,
         don't do so more than once.  */
       if (!NILP (Vinhibit_quit))
@@ -1950,12 +1966,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
          if (NILP (current_kboard->kbd_queue))
            current_kboard->kbd_queue_has_data = 0;
          input_pending = readable_events (0);
-#ifdef MULTI_FRAME
          if (EVENT_HAS_PARAMETERS (c)
              && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qswitch_frame))
            internal_last_event_frame = XCONS (XCONS (c)->cdr)->car;
          Vlast_event_frame = internal_last_event_frame;
-#endif
        }
     }
 
@@ -2465,7 +2479,6 @@ kbd_buffer_store_event (event)
            }
 #endif
 
-#ifdef MULTI_FRAME
          /* If this results in a quit_char being returned to Emacs as
             input, set Vlast_event_frame properly.  If this doesn't
             get returned to Emacs as an event, the next event read
@@ -2479,7 +2492,6 @@ kbd_buffer_store_event (event)
            internal_last_event_frame = focus;
            Vlast_event_frame = focus;
          }
-#endif
 
          last_event_timestamp = event->timestamp;
          interrupt_signal ();
@@ -2697,7 +2709,8 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
        {
          kbd_fetch_ptr = event + 1;
          input_pending = readable_events (0);
-         x_activate_menubar (XFRAME (event->frame_or_window));
+         if (FRAME_LIVE_P (XFRAME (event->frame_or_window)))
+           x_activate_menubar (XFRAME (event->frame_or_window));
        }
 #endif
       /* Just discard these, by returning nil.
@@ -2713,7 +2726,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
         time, and leave the event in the queue for next time.  */
       else
        {
-#ifdef MULTI_FRAME
          Lisp_Object frame;
          Lisp_Object focus;
 
@@ -2731,7 +2743,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
              && XFRAME (frame) != selected_frame)
            obj = make_lispy_switch_frame (frame);
          internal_last_event_frame = frame;
-#endif /* MULTI_FRAME */
 
          /* If we didn't decide to make a switch-frame event, go ahead
             and build a real event from the queue entry.  */
@@ -2778,7 +2789,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
 
       obj = Qnil;
 
-#ifdef MULTI_FRAME
       /* Decide if we should generate a switch-frame event.  Don't
         generate switch-frame events for motion outside of all Emacs
         frames.  */
@@ -2795,7 +2805,6 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
            obj = make_lispy_switch_frame (frame);
          internal_last_event_frame = frame;
        }
-#endif
 
       /* If we didn't decide to make a switch-frame event, go ahead and
         return a mouse-motion event.  */
@@ -2810,9 +2819,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
 
   input_pending = readable_events (0);
 
-#ifdef MULTI_FRAME
   Vlast_event_frame = internal_last_event_frame;
-#endif
 
   return (obj);
 }
@@ -3761,7 +3768,7 @@ make_lispy_event (event)
            else
              {
                int pixcolumn, pixrow;
-               column -= XINT (XWINDOW (window)->left);
+               column -= WINDOW_LEFT_MARGIN (XWINDOW (window));
                row -= XINT (XWINDOW (window)->top);
                glyph_to_pixel_coords (f, column, row, &pixcolumn, &pixrow);
                XSETINT (event->x, pixcolumn);
@@ -3913,7 +3920,7 @@ make_lispy_event (event)
       }
 
 #ifdef WINDOWSNT
-    case win32_scroll_bar_click:
+    case w32_scroll_bar_click:
       {
        int button = event->code;
        int is_double;
@@ -3941,7 +3948,7 @@ make_lispy_event (event)
                                        Fcons (part, Qnil)))));
        }
 
-       /* Always treat Win32 scroll bar events as clicks. */
+       /* Always treat W32 scroll bar events as clicks. */
        event->modifiers |= click_modifier;
 
        {
@@ -3987,7 +3994,6 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
      Lisp_Object x, y;
      unsigned long time;
 {
-#ifdef MULTI_FRAME
   /* Is it a scroll bar movement?  */
   if (frame && ! NILP (bar_window))
     {
@@ -4006,18 +4012,13 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
 
   /* Or is it an ordinary mouse movement?  */
   else
-#endif /* MULTI_FRAME */
     {
       int area;
       Lisp_Object window;
       Lisp_Object posn;
       int column, row;
 
-#ifdef MULTI_FRAME
       if (frame)
-#else
-      if (1)
-#endif
        {
          /* It's in a frame; which window on that frame?  */
          pixel_to_glyph_coords (frame, XINT (x), XINT (y), &column, &row,
@@ -4030,7 +4031,7 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
       if (WINDOWP (window))
        {
          int pixcolumn, pixrow;
-         column -= XINT (XWINDOW (window)->left);
+         column -= WINDOW_LEFT_MARGIN (XWINDOW (window));
          row -= XINT (XWINDOW (window)->top);
          glyph_to_pixel_coords (frame, column, row, &pixcolumn, &pixrow);
          XSETINT (x, pixcolumn);
@@ -4044,13 +4045,11 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
            XSETINT (posn,
                     buffer_posn_from_coords (XWINDOW (window), column, row));
        }
-#ifdef MULTI_FRAME
       else if (frame != 0)
        {
          XSETFRAME (window, frame);
          posn = Qnil;
        }
-#endif
       else
        {
          window = Qnil;
@@ -4484,7 +4483,7 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist,
        }
 
       if (CONSP (*symbol_table))
-       *symbol_table = Fcons (value, *symbol_table);
+        *symbol_table = Fcons (Fcons (symbol_int, value), *symbol_table);
       else
        XVECTOR (*symbol_table)->contents[symbol_num] = value;
 
@@ -4706,7 +4705,7 @@ gobble_input (expected)
   if (interrupt_input)
     {
       SIGMASKTYPE mask;
-      mask = sigblockx (SIGIO);
+      mask = sigblock (sigmask (SIGIO));
       read_avail_input (expected);
       sigsetmask (mask);
     }
@@ -4715,7 +4714,7 @@ gobble_input (expected)
   if (read_socket_hook && !interrupt_input && poll_suppress_count == 0)
     {
       SIGMASKTYPE mask;
-      mask = sigblockx (SIGALRM);
+      mask = sigblock (sigmask (SIGALRM));
       read_avail_input (expected);
       sigsetmask (mask);
     }
@@ -4755,7 +4754,7 @@ record_asynch_buffer_change ()
   if (interrupt_input)
     {
       SIGMASKTYPE mask;
-      mask = sigblockx (SIGIO);
+      mask = sigblock (sigmask (SIGIO));
       kbd_buffer_store_event (&event);
       sigsetmask (mask);
     }
@@ -4792,8 +4791,7 @@ read_avail_input (expected)
 
   if (read_socket_hook)
     /* No need for FIONREAD or fcntl; just say don't wait.  */
-    nread = (*read_socket_hook) (input_fd, buf, KBD_BUFFER_SIZE,
-                                expected, expected);
+    nread = (*read_socket_hook) (input_fd, buf, KBD_BUFFER_SIZE, expected);
   else
     {
       /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
@@ -4890,11 +4888,7 @@ read_avail_input (expected)
            cbuf[i] &= ~0x80;
 
          buf[i].code = cbuf[i];
-#ifdef MULTI_FRAME
          XSETFRAME (buf[i].frame_or_window, selected_frame);
-#else
-         buf[i].frame_or_window = Qnil;
-#endif
        }
     }
 
@@ -4926,7 +4920,7 @@ input_available_signal (signo)
   extern int select_alarmed;
 #endif
 
-#ifdef USG
+#if defined (USG) && !defined (POSIX_SIGNALS)
   /* USG systems forget handlers when they are used;
      must reestablish each time */
   signal (signo, input_available_signal);
@@ -5222,6 +5216,10 @@ menu_bar_item (key, item_string, def)
   Lisp_Object enabled;
   int i;
 
+  /* Skip menu-bar equiv keys data.  */
+  if (CONSP (def) && CONSP (XCONS (def)->car))
+    def = XCONS (def)->cdr;
+
   if (EQ (def, Qundefined))
     {
       /* If a map has an explicit `undefined' as definition,
@@ -6869,7 +6867,13 @@ a special event, so ignore the prefix argument and don't clear it.")
       final = Findirect_function (cmd);
 
       if (CONSP (final) && (tem = Fcar (final), EQ (tem, Qautoload)))
-       do_autoload (final, cmd);
+       {
+         struct gcpro gcpro1, gcpro2;
+
+         GCPRO2 (cmd, prefixarg);
+         do_autoload (final, cmd);
+         UNGCPRO;
+       }
       else
        break;
     }
@@ -6913,12 +6917,13 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
   Lisp_Object function;
   char buf[40];
   Lisp_Object saved_keys;
-  struct gcpro gcpro1;
+  Lisp_Object bindings, value;
+  struct gcpro gcpro1, gcpro2;
 
   saved_keys = Fvector (this_command_key_count,
                        XVECTOR (this_command_keys)->contents);
   buf[0] = 0;
-  GCPRO1 (saved_keys);
+  GCPRO2 (saved_keys, prefixarg);
 
   if (EQ (prefixarg, Qminus))
     strcpy (buf, "- ");
@@ -6995,24 +7000,46 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
   if (!NILP (Vsuggest_key_bindings)
       && NILP (Vexecuting_macro)
       && SYMBOLP (function))
-    {
-      Lisp_Object bindings;
+    bindings = Fwhere_is_internal (function, Voverriding_local_map,
+                                  Qt, Qnil);
+  else
+    bindings = Qnil;
 
-      bindings = Fwhere_is_internal (function, Voverriding_local_map,
-                                    Qt, Qnil);
+  value = Qnil;
+  GCPRO2 (bindings, value);
+  value = Fcommand_execute (function, Qt, Qnil, Qnil);
 
-      if (!NILP (bindings))
+  /* If the command has a key binding, print it now.  */
+  if (!NILP (bindings))
+    {
+      /* But first wait, and skip the message if there is input.  */
+      if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings)
+                           ? Vsuggest_key_bindings : make_number (2)),
+                          Qnil, Qnil)))
        {
-         message ("You can run the command `%s' by typing %s",
+         Lisp_Object binding;
+         char *newmessage;
+         char *oldmessage = echo_area_glyphs;
+         int oldmessage_len = echo_area_glyphs_length;
+
+         binding = Fkey_description (bindings);
+
+         newmessage
+           = (char *) alloca (XSYMBOL (function)->name->size
+                              + XSTRING (binding)->size
+                              + 100);
+         sprintf (newmessage, "You can run the command `%s' by typing %s",
                   XSYMBOL (function)->name->data,
-                  XSTRING (Fkey_description (bindings))->data);
-         Fsit_for ((NUMBERP (Vsuggest_key_bindings)
-                    ? Vsuggest_key_bindings : make_number (2)),
-                   Qnil, Qnil);
+                  XSTRING (binding)->data);
+         message1_nolog (newmessage);
+         if (!NILP (Fsit_for ((NUMBERP (Vsuggest_key_bindings)
+                               ? Vsuggest_key_bindings : make_number (2)),
+                              Qnil, Qnil)))
+           message2_nolog (oldmessage, oldmessage_len);
        }
     }
 
-  return Fcommand_execute (function, Qt, Qnil, Qnil);
+  RETURN_UNGCPRO (value);
 }
 
 /* Find the set of keymaps now active.
@@ -7066,8 +7093,7 @@ detect_input_pending ()
   return input_pending;
 }
 
-/* Return nonzero if input events are pending.
-   Execute timers immediately; don't make events for them.  */
+/* Return nonzero if input events are pending, and run any pending timers.  */
 
 detect_input_pending_run_timers (do_display)
      int do_display;
@@ -7091,6 +7117,18 @@ clear_input_pending ()
   input_pending = 0;
 }
 
+/* Return nonzero if there are pending requeued events.
+   This isn't used yet.  The hope is to make wait_reading_process_input
+   call it, and return return if it runs Lisp code that unreads something.
+   The problem is, kbd_buffer_get_event needs to be fixed to know what
+   to do in that case.  It isn't trivial.  */
+
+requeued_events_pending_p ()
+{
+  return (!NILP (Vunread_command_events) || unread_command_char != -1);
+}
+
+
 DEFUN ("input-pending-p", Finput_pending_p, Sinput_pending_p, 0, 0, 0,
   "T if command input is currently available with no waiting.\n\
 Actually, the value is nil only if we can be sure that no input is available.")
@@ -7286,7 +7324,7 @@ stuff_buffered_input (stuffstring)
      Lisp_Object stuffstring;
 {
 /* stuff_char works only in BSD, versions 4.2 and up.  */
-#ifdef BSD
+#ifdef BSD_SYSTEM
 #ifndef BSD4_1
   register unsigned char *p;
 
@@ -7316,7 +7354,7 @@ stuff_buffered_input (stuffstring)
     }
   input_pending = 0;
 #endif
-#endif /* BSD and not BSD4_1 */
+#endif /* BSD_SYSTEM and not BSD4_1 */
 }
 \f
 set_waiting_for_input (time_to_clear)
@@ -7360,7 +7398,7 @@ interrupt_signal (signalnum)      /* If we don't have an argument, */
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
 
-#ifdef USG
+#if defined (USG) && !defined (POSIX_SIGNALS)
   if (!read_socket_hook && NILP (Vwindow_system))
     {
       /* USG systems forget handlers when they are used;
@@ -7500,12 +7538,10 @@ quit_throw_to_read_char ()
     abort ();
 #endif
 #endif
-#ifdef MULTI_FRAME
   if (FRAMEP (internal_last_event_frame)
       && XFRAME (internal_last_event_frame) != selected_frame)
     do_switch_frame (make_lispy_switch_frame (internal_last_event_frame),
                     Qnil, 0);
-#endif
 
   _longjmp (getcjmp, 1);
 }
@@ -7682,12 +7718,10 @@ init_keyboard ()
 #endif
   input_pending = 0;
 
-#ifdef MULTI_FRAME
   /* This means that command_loop_1 won't try to select anything the first
      time through.  */
   internal_last_event_frame = Qnil;
   Vlast_event_frame = internal_last_event_frame;
-#endif
 
 #ifdef MULTI_KBOARD
   current_kboard = initial_kboard;
@@ -7894,6 +7928,12 @@ syms_of_keyboard ()
   unread_switch_frame = Qnil;
   staticpro (&unread_switch_frame);
 
+  internal_last_event_frame = Qnil;
+  staticpro (&internal_last_event_frame);
+
+  read_key_sequence_cmd = Qnil;
+  staticpro (&read_key_sequence_cmd);
+
   defsubr (&Sevent_convert_list);
   defsubr (&Sread_key_sequence);
   defsubr (&Srecursive_edit);
@@ -8000,7 +8040,9 @@ by position only.");
   inhibit_local_menu_bar_menus = 0;
 
   DEFVAR_INT ("num-input-keys", &num_input_keys,
-    "Number of complete keys read from the keyboard so far.");
+    "Number of complete key sequences read from the keyboard so far.\n\
+This includes key sequences read from keyboard macros.\n\
+The number is effectively the number of interactive command invocations.");
   num_input_keys = 0;
 
   DEFVAR_LISP ("last-event-frame", &Vlast_event_frame,
@@ -8167,10 +8209,6 @@ The value can be a length of time to show the message for.\n\
 If the value is non-nil and not a number, we wait 2 seconds.");
   Vsuggest_key_bindings = Qt;
 
-  DEFVAR_LISP ("column-number-mode", &Vcolumn_number_mode,
-    "Non-nil enables display of the current column number in the mode line.");
-  Vcolumn_number_mode = Qnil;
-
   DEFVAR_LISP ("timer-list", &Vtimer_list,
     "List of active absolute time timers in order of increasing time");
   Vtimer_list = Qnil;