comparison src/keymap.c @ 267:966663fcf606 r20-5b32

Import from CVS: tag r20-5b32
author cvs
date Mon, 13 Aug 2007 10:26:29 +0200
parents 8efd647ea9ca
children c5d627a313b1
comparison
equal deleted inserted replaced
266:18d185df8c54 267:966663fcf606
285 if (print_readably) 285 if (print_readably)
286 error ("printing unreadable object #<keymap 0x%x>", keymap->header.uid); 286 error ("printing unreadable object #<keymap 0x%x>", keymap->header.uid);
287 write_c_string ("#<keymap ", printcharfun); 287 write_c_string ("#<keymap ", printcharfun);
288 if (!NILP (keymap->name)) 288 if (!NILP (keymap->name))
289 print_internal (keymap->name, printcharfun, 1); 289 print_internal (keymap->name, printcharfun, 1);
290 /* #### Yuck! This is no way to form plural! --hniksic */
290 sprintf (buf, "%s%d entr%s 0x%x>", 291 sprintf (buf, "%s%d entr%s 0x%x>",
291 ((NILP (keymap->name)) ? "" : " "), 292 ((NILP (keymap->name)) ? "" : " "),
292 size, 293 size,
293 ((size == 1) ? "y" : "ies"), 294 ((size == 1) ? "y" : "ies"),
294 keymap->header.uid); 295 keymap->header.uid);
1717 static void 1718 static void
1718 ensure_meta_prefix_char_keymapp (Lisp_Object keys, int indx, 1719 ensure_meta_prefix_char_keymapp (Lisp_Object keys, int indx,
1719 Lisp_Object keymap) 1720 Lisp_Object keymap)
1720 { 1721 {
1721 /* This function can GC */ 1722 /* This function can GC */
1722 char buf [255];
1723 Lisp_Object new_keys; 1723 Lisp_Object new_keys;
1724 int i; 1724 int i;
1725 Lisp_Object mpc_binding; 1725 Lisp_Object mpc_binding;
1726 struct key_data meta_key; 1726 struct key_data meta_key;
1727 1727
1744 for (i = 0; i < indx; i++) 1744 for (i = 0; i < indx; i++)
1745 XVECTOR_DATA (new_keys) [i] = XVECTOR_DATA (keys) [i]; 1745 XVECTOR_DATA (new_keys) [i] = XVECTOR_DATA (keys) [i];
1746 } 1746 }
1747 else 1747 else
1748 abort (); 1748 abort ();
1749
1749 if (EQ (keys, new_keys)) 1750 if (EQ (keys, new_keys))
1750 sprintf (buf, GETTEXT ("can't bind %s: %s has a non-keymap binding"), 1751 error_with_frob (mpc_binding,
1751 (char *) XSTRING_DATA (Fkey_description (keys)), 1752 "can't bind %s: %s has a non-keymap binding",
1752 (char *) XSTRING_DATA (Fsingle_key_description 1753 (char *) XSTRING_DATA (Fkey_description (keys)),
1753 (Vmeta_prefix_char))); 1754 (char *) XSTRING_DATA (Fsingle_key_description
1755 (Vmeta_prefix_char)));
1754 else 1756 else
1755 sprintf (buf, GETTEXT ("can't bind %s: %s %s has a non-keymap binding"), 1757 error_with_frob (mpc_binding,
1756 (char *) XSTRING_DATA (Fkey_description (keys)), 1758 "can't bind %s: %s %s has a non-keymap binding",
1757 (char *) XSTRING_DATA (Fkey_description (new_keys)), 1759 (char *) XSTRING_DATA (Fkey_description (keys)),
1758 (char *) XSTRING_DATA (Fsingle_key_description 1760 (char *) XSTRING_DATA (Fkey_description (new_keys)),
1759 (Vmeta_prefix_char))); 1761 (char *) XSTRING_DATA (Fsingle_key_description
1760 signal_simple_error (buf, mpc_binding); 1762 (Vmeta_prefix_char)));
1761 } 1763 }
1762 1764
1763 DEFUN ("define-key", Fdefine_key, 3, 3, 0, /* 1765 DEFUN ("define-key", Fdefine_key, 3, 3, 0, /*
1764 Define key sequence KEYS, in KEYMAP, as DEF. 1766 Define key sequence KEYS, in KEYMAP, as DEF.
1765 KEYMAP is a keymap object. 1767 KEYMAP is a keymap object.