Merge from trunk
[bpt/emacs.git] / src / keyboard.c
index 05b6abe..63e7573 100644 (file)
@@ -1135,7 +1135,7 @@ command_loop_2 (Lisp_Object ignore)
 static Lisp_Object
 top_level_2 (void)
 {
-  return Feval (Vtop_level);
+  return Feval (Vtop_level, Qnil);
 }
 
 Lisp_Object
@@ -2942,7 +2942,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
        keys = Fcopy_sequence (this_command_keys);
       else
        keys = Qnil;
-      GCPRO1_VAR (keys, inner_gcpro1);
+      GCPRO1_VAR (keys, inner_gcpro);
 
       /* Clear out this_command_keys.  */
       this_command_key_count = 0;
@@ -2980,7 +2980,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
       if (saved_immediate_echo)
        echo_now ();
 
-      UNGCPRO_VAR (inner_gcpro1);
+      UNGCPRO_VAR (inner_gcpro);
 
       /* The input method can return no events.  */
       if (! CONSP (tem))
@@ -3060,7 +3060,7 @@ read_char (int commandflag, int nmaps, Lisp_Object *maps, Lisp_Object prev_event
                 help_form_saved_window_configs);
       record_unwind_protect (read_char_help_form_unwind, Qnil);
 
-      tem0 = Feval (Vhelp_form);
+      tem0 = Feval (Vhelp_form, Qnil);
       if (STRINGP (tem0))
        internal_with_output_to_temp_buffer ("*Help*", print_help, tem0);
 
@@ -7541,6 +7541,12 @@ menu_item_eval_property_1 (Lisp_Object arg)
   return Qnil;
 }
 
+static Lisp_Object
+eval_dyn (Lisp_Object form)
+{
+  return Feval (form, Qnil);
+}
+
 /* Evaluate an expression and return the result (or nil if something
    went wrong).  Used to evaluate dynamic parts of menu items.  */
 Lisp_Object
@@ -7549,7 +7555,7 @@ menu_item_eval_property (Lisp_Object sexpr)
   int count = SPECPDL_INDEX ();
   Lisp_Object val;
   specbind (Qinhibit_redisplay, Qt);
-  val = internal_condition_case_1 (Feval, sexpr, Qerror,
+  val = internal_condition_case_1 (eval_dyn, sexpr, Qerror,
                                   menu_item_eval_property_1);
   return unbind_to (count, val);
 }
@@ -8963,7 +8969,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
 
   struct gcpro outer_gcpro1;
 
-  GCPRO1_VAR (fake_prefixed_keys, outer_gcpro1);
+  GCPRO1_VAR (fake_prefixed_keys, outer_gcpro);
   raw_keybuf_count = 0;
 
   last_nonmenu_event = Qnil;
@@ -9258,7 +9264,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
          if (EQ (key, Qt))
            {
              unbind_to (count, Qnil);
-             UNGCPRO_VAR (outer_gcpro1);
+             UNGCPRO_VAR (outer_gcpro);
              return -1;
            }
 
@@ -9836,7 +9842,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
          && /* indec.start >= t && fkey.start >= t && */ keytran.start >= t
          && INTEGERP (key)
          && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
-              && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK))
+              && uppercasep (XINT (key) & ~CHAR_MODIFIER_MASK))
              || (XINT (key) & shift_modifier)))
        {
          Lisp_Object new_key;
@@ -9847,7 +9853,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
          if (XINT (key) & shift_modifier)
            XSETINT (new_key, XINT (key) & ~shift_modifier);
          else
-           XSETINT (new_key, (DOWNCASE (XINT (key) & ~CHAR_MODIFIER_MASK)
+           XSETINT (new_key, (downcase (XINT (key) & ~CHAR_MODIFIER_MASK)
                               | (XINT (key) & CHAR_MODIFIER_MASK)));
 
          /* We have to do this unconditionally, regardless of whether
@@ -9875,13 +9881,13 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
              || (INTEGERP (key)
                  && (KEY_TO_CHAR (key)
                      < XCHAR_TABLE (BVAR (current_buffer, downcase_table))->size)
-                 && UPPERCASEP (KEY_TO_CHAR (key))))
+                 && uppercasep (KEY_TO_CHAR (key))))
            {
              Lisp_Object new_key
                = (modifiers & shift_modifier
                   ? apply_modifiers (modifiers & ~shift_modifier,
                                      XCAR (breakdown))
-                  : make_number (DOWNCASE (KEY_TO_CHAR (key)) | modifiers));
+                  : make_number (downcase (KEY_TO_CHAR (key)) | modifiers));
 
              original_uppercase = key;
              original_uppercase_position = t - 1;
@@ -9941,7 +9947,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt,
       add_command_key (keybuf[t]);
     }
 
-  UNGCPRO_VAR (outer_gcpro1);
+  UNGCPRO_VAR (outer_gcpro);
   return t;
 }