]> code.delx.au - gnu-emacs/blobdiff - src/keymap.c
(Fkey_description): Move side effect outside of macro call.
[gnu-emacs] / src / keymap.c
index b6243594beb9755499bba37a46d2b971c6e93a41..e91df88aaff806bb96f68d5f9abc57c50f29fdea 100644 (file)
@@ -1,7 +1,7 @@
 /* Manipulation of keymaps
    Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995,
                  1998, 1999, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -1280,9 +1280,9 @@ remapping in all currently active keymaps.  */)
     {
       Lisp_Object maps, binding;
 
-      for (maps = keymaps; !NILP (maps); maps = Fcdr (maps))
+      for (maps = keymaps; CONSP (maps); maps = XCDR (maps))
        {
-         binding = Flookup_key (Fcar (maps), command_remapping_vector, Qnil);
+         binding = Flookup_key (XCAR (maps), command_remapping_vector, Qnil);
          if (!NILP (binding) && !INTEGERP (binding))
            return binding;
        }
@@ -2047,7 +2047,8 @@ If KEYMAP is nil, that means no local keymap.  */)
 }
 
 DEFUN ("current-local-map", Fcurrent_local_map, Scurrent_local_map, 0, 0, 0,
-       doc: /* Return current buffer's local keymap, or nil if it has none.  */)
+       doc: /* Return current buffer's local keymap, or nil if it has none.
+Normally the local keymap is set by the major mode with `use-local-map'.  */)
      ()
 {
   return current_buffer->keymap;
@@ -2303,7 +2304,7 @@ spaces are put between sequence elements, etc.  */)
        }
       else if (VECTORP (list))
        {
-         key = AREF (list, i++);
+         key = AREF (list, i); i++;
        }
       else
        {
@@ -2653,7 +2654,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
       && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
     RETURN_UNGCPRO (Qnil);
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       /* Key sequence to reach map, and the map that it reaches */
       register Lisp_Object this, map, tem;
@@ -2665,8 +2666,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
       Lisp_Object last;
       int last_is_meta;
 
-      this = Fcar (Fcar (maps));
-      map  = Fcdr (Fcar (maps));
+      this = Fcar (XCAR (maps));
+      map  = Fcdr (XCAR (maps));
       last = make_number (XINT (Flength (this)) - 1);
       last_is_meta = (XINT (last) >= 0
                      && EQ (Faref (this, last), meta_prefix_char));
@@ -3155,11 +3156,11 @@ key             binding\n\
       Lisp_Object list;
 
       /* Delete from MAPS each element that is for the menu bar.  */
-      for (list = maps; !NILP (list); list = XCDR (list))
+      for (list = maps; CONSP (list); list = XCDR (list))
        {
          Lisp_Object elt, prefix, tem;
 
-         elt = Fcar (list);
+         elt = XCAR (list);
          prefix = Fcar (elt);
          if (XVECTOR (prefix)->size >= 1)
            {
@@ -3186,11 +3187,11 @@ key             binding\n\
       something = 1;
     }
 
-  for (; !NILP (maps); maps = Fcdr (maps))
+  for (; CONSP (maps); maps = XCDR (maps))
     {
       register Lisp_Object elt, prefix, tail;
 
-      elt = Fcar (maps);
+      elt = XCAR (maps);
       prefix = Fcar (elt);
 
       sub_shadows = Qnil;