• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/emacs-93/emacs/src/

Lines Matching +defs:key +defs:fun

48 Lisp_Object global_map;		/* default global key bindings */
93 /* Keymap mapping ASCII function key sequences onto their preferred forms.
98 /* Keymap mapping ASCII function key sequences onto their preferred forms. */
103 This is used to speed up recomputation of menu key equivalents
116 in a string key sequence is equivalent to prefixing with this
171 which binds the function key or mouse event SYMBOL to DEFINITION.
184 /* This function is used for installing the standard key bindings
192 initial_define_key (keymap, key, defname)
194 int key;
197 store_in_keymap (keymap, make_number (key), intern (defname));
226 when reading a key-sequence to be looked-up in this keymap. */)
455 /* SUBMAP is a cons that we found as a key binding.
456 Discard the other things found in a menu key binding. */
506 bindings; any key left unmentioned by other tables and bindings is
571 for this key sequence. */
601 Lisp_Object key = XCAR (binding);
603 if (EQ (key, idx))
608 && INTEGERP (key)
609 && (XINT (key) & CHAR_MODIFIER_MASK) == 0
611 && !SINGLE_BYTE_CHAR_P (XINT (key))
612 && CHAR_VALID_P (XINT (key), 1)
613 && !CHAR_VALID_P (XINT (key), 0)
614 && (CHAR_CHARSET (XINT (key))
623 else if (t_ok > 1 && EQ (key, Qt))
671 map_keymap_item (fun, args, key, val, data)
672 map_keymap_function_t fun;
673 Lisp_Object args, key, val;
680 (*fun) (key, val, args, data);
684 map_keymap_char_table_item (args, key, val)
685 Lisp_Object args, key, val;
689 map_keymap_function_t fun = XSAVE_VALUE (XCAR (args))->pointer;
691 map_keymap_item (fun, XCDR (args), key, val,
700 map_keymap (map, fun, args, data, autoload)
701 map_keymap_function_t fun;
719 map_keymap_item (fun, args, XCAR (binding), XCDR (binding), data);
729 map_keymap_item (fun, args, character, AREF (binding, c), data);
736 Fcons (make_save_value (fun, 0),
746 map_keymap_call (key, val, fun, dummy)
747 Lisp_Object key, val, fun;
750 call2 (fun, key, val);
851 /* Also remove the sublist that caches key equivalences, if any. */
892 error ("attempt to define a key in a non-keymap");
1019 /* Delete cache for key equivalences. */
1039 /* There may also be a list that caches key equivalences.
1069 Any key definitions that are subkeymaps are recursively copied.
1070 However, a key definition which is a symbol whose definition is a keymap
1111 DEFUN ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0,
1112 doc: /* In KEYMAP, define key sequence KEY as DEF.
1121 DEF is anything that can be a key's definition:
1122 nil (means key is undefined in this keymap),
1125 a keymap (to define a prefix key),
1126 a symbol (when the key is looked up, the symbol will stand for its
1138 (keymap, key, def)
1140 Lisp_Object key;
1151 GCPRO3 (keymap, key, def);
1154 CHECK_VECTOR_OR_STRING (key);
1156 length = XFASTINT (Flength (key));
1163 meta_bit = VECTORP (key) ? meta_modifier : 0x80;
1182 c = Faref (key, make_number (idx));
1214 /* If this key is undefined, make it a prefix. */
1220 /* We must use Fkey_description rather than just passing key to
1221 error; key might be a vector, not a string. */
1222 error ("Key sequence %s starts with non-prefix key %s",
1223 SDATA (Fkey_description (key, Qnil)),
1224 SDATA (Fkey_description (Fsubstring (key, make_number (0),
1273 DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0,
1274 doc: /* In keymap KEYMAP, look up key sequence KEY. Return the definition.
1275 A value of nil means undefined. See doc of `define-key'
1282 it takes to reach a non-prefix key.
1284 Normally, `lookup-key' ignores bindings for t, which act as default
1287 third optional argument ACCEPT-DEFAULT is non-nil, `lookup-key' will
1288 recognize the default bindings, just as `read-key-sequence' does. */)
1289 (keymap, key, accept_default)
1291 Lisp_Object key;
1301 GCPRO2 (keymap, key);
1304 CHECK_VECTOR_OR_STRING (key);
1306 length = XFASTINT (Flength (key));
1313 c = Faref (key, make_number (idx++));
1319 if (INTEGERP (c) && XINT (c) & 0x80 && STRINGP (key))
1323 includes the buffer name in the key sequence. */
1350 /* If this key is defined as a prefix in an inherited keymap,
1359 /* Append a key to the end of a key sequence. We always make a vector. */
1362 append_key (key_sequence, key)
1363 Lisp_Object key_sequence, key;
1369 args[1] = Fcons (key, Qnil);
1413 ? "To bind the key %s, use [?%s], not [%s]"
1414 : "To bind the key %s, use \"%s\", not [%s]"),
1437 for every key sequence read, so the nice lispy approach (return a
1442 back to the command loop, which would try to read a key sequence,
1445 list, let the key sequence be read, and hope some other piece of
1597 DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 4, 0,
1602 Normally, `key-binding' ignores bindings for t, which act as default
1605 optional second argument ACCEPT-DEFAULT is non-nil, `key-binding' does
1606 recognize the default bindings, just as `read-key-sequence' does.
1608 Like the normal command loop, `key-binding' will remap the command
1611 is non-nil, `key-binding' returns the unmapped command.
1613 If KEY is a key sequence initiated with the mouse, the used keymaps
1623 (key, accept_default, no_remap, position)
1624 Lisp_Object key, accept_default, no_remap, position;
1631 GCPRO2 (key, position);
1633 if (NILP (position) && VECTORP (key))
1638 = AREF (key, SYMBOLP (AREF (key, 0)) && ASIZE (key) > 1 ? 1 : 0);
1666 processing the key sequence. We don't use
1668 `read-key-sequence' to avoid saving point. Maybe this
1682 key, accept_default);
1688 value = Flookup_key (Voverriding_local_map, key, accept_default);
1758 value = Flookup_key (keymap, key, accept_default);
1770 value = Flookup_key (maps[i], key, accept_default);
1777 value = Flookup_key (local_map, key, accept_default);
1783 value = Flookup_key (current_global_map, key, accept_default);
1793 command, look for a key binding (ie. remapping) for that command. */
1807 DEFUN ("local-key-binding", Flocal_key_binding, Slocal_key_binding, 1, 2, 0,
1813 bindings; see the description of `lookup-key' for more details about this. */)
1826 DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0,
1830 This function's return values are the same as those of `lookup-key'
1834 bindings; see the description of `lookup-key' for more details about this. */)
1843 DEFUN ("minor-mode-key-binding", Fminor_mode_key_binding, Sminor_mode_key_binding, 1, 2, 0,
1854 bindings; see the description of `lookup-key' for more details about this. */)
1855 (key, accept_default)
1856 Lisp_Object key, accept_default;
1869 GCPRO2 (key, binding);
1873 && !NILP (binding = Flookup_key (maps[i], key, accept_default))
1962 accessible_keymaps_1 (key, cmd, maps, tail, thisseq, is_metized)
1963 Lisp_Object maps, tail, thisseq, key, cmd;
1964 int is_metized; /* If 1, `key' is assumed to be INTEGERP. */
1993 /* If the last key in thisseq is meta-prefix-char,
2004 Faset (tem, last, make_number (XINT (key) | meta_bit));
2014 tem = append_key (thisseq, key);
2038 An optional argument PREFIX, if non-nil, should be a key sequence;
2157 DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0,
2158 doc: /* Return a pretty description of key-sequence KEYS.
2171 Lisp_Object key;
2181 (mapconcat 'single-key-description keys " ")
2220 XSETFASTINT (key, c);
2224 key = AREF (list, i++);
2228 key = XCAR (list);
2235 if (!INTEGERP (key)
2236 || EQ (key, meta_prefix_char)
2237 || (XINT (key) & meta_modifier))
2241 if (EQ (key, meta_prefix_char))
2245 XSETINT (key, (XINT (key) | meta_modifier) & ~0x80);
2248 else if (EQ (key, meta_prefix_char))
2253 args[len++] = Fsingle_key_description (key, Qnil);
2395 DEFUN ("single-key-description", Fsingle_key_description,
2401 (key, no_angles)
2402 Lisp_Object key, no_angles;
2404 if (CONSP (key) && lucid_event_type_list_p (key))
2405 key = Fevent_convert_list (key);
2407 key = EVENT_HEAD (key);
2409 if (INTEGERP (key)) /* Normal character */
2412 int without_bits = XINT (key) & ~((-1) << CHARACTERBITS);
2423 sprintf (buf, "Invalid char code %d", XINT (key));
2449 end = push_key_description (XUINT (key), tem, 1);
2462 else if (SYMBOLP (key)) /* Function key or event-symbol */
2467 = (char *) alloca (SBYTES (SYMBOL_NAME (key)) + 5);
2468 sprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key)));
2472 return Fsymbol_name (key);
2474 else if (STRINGP (key)) /* Buffer names in the menubar. */
2475 return Fcopy_sequence (key);
2512 `single-key-description' which turns them into "C-char".
2514 whereas `single-key-description' uses the 2**27 bit for Meta.
2574 shadow_lookup (shadow, key, flag)
2575 Lisp_Object shadow, key, flag;
2581 value = Flookup_key (XCAR (tail), key, flag);
2585 Fsubstring (key, make_number (0), value), flag);
2623 /* If this command is remapped, then it has no key bindings
2668 Lisp_Object elt, key, binding;
2676 /* Set key and binding to the current key and binding, and
2686 XSETFASTINT (key, i);
2687 sequence = where_is_internal_1 (binding, key, definition,
2712 key = XCAR (elt);
2715 sequence = where_is_internal_1 (binding, key, definition,
2731 format [remap COMMAND], find the key sequences
2744 /* Verify that this key binding actually maps to the
2754 /* Verify that this key binding is not shadowed by another
2755 binding for the same key, before we say it exists.
2757 Mechanism: look for local definition of this key and if
2759 ignore this key.
2809 the keymaps without finding an all-ASCII key sequence. So just
2823 If optional 3rd arg FIRSTONLY is non-nil, return the first key sequence found,
2824 rather than a list of all possible key sequences.
2834 If optional 5th arg NO-REMAP is non-nil, don't search for key sequences
2890 /* Verify that the key bindings are not shadowed. Note that
2930 where_is_internal_2 (args, key, binding)
2931 Lisp_Object args, key, binding;
2938 GCPRO3 (args, key, binding);
2947 sequence = where_is_internal_1 (binding, key, definition, noindirect,
2960 where_is_internal_1 (binding, key, definition, noindirect, this, last,
2962 Lisp_Object binding, key, definition, noindirect, this, last;
2980 /* We have found a match. Construct the key sequence where we found it. */
2981 if (INTEGERP (key) && last_is_meta)
2984 Faset (sequence, last, make_number (XINT (key) | meta_modifier));
2987 sequence = append_key (this, key);
3006 The optional argument PREFIX, if non-nil, should be a key sequence;
3154 /* Print the function-key-map translations under this prefix. */
3157 "\f\nFunction key map translations", nomenu, 1, 0, 0);
3163 /* Insert a description of the key bindings in STARTMAP,
3174 If TRANSL is nonzero, the definitions are actually key translations
3199 key binding\n\
3481 because a local definition of the same key shadows it. */
3489 /* If both bindings are keymaps, this key is a prefix key,
3588 describe_vector_princ (elt, fun)
3589 Lisp_Object elt, fun;
3592 call1 (fun, elt);
3622 If the vector is in a keymap, ELT_PREFIX is a prefix key which
3633 If it is non-nil, then we look up the key in those maps
4063 DEFVAR_LISP ("define-key-rebound-commands", &Vdefine_key_rebound_commands,
4064 doc: /* List of commands given new key bindings recently.
4107 key sequences and look up bindings iff VARIABLE's value is non-nil.
4108 If two active keymaps bind the same key, the keymap appearing earlier
4129 DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
4130 doc: /* Keymap that translates key sequences to key sequences during input.
4131 This is used mainly for mapping ASCII function key sequences into
4132 real Emacs function key events (symbols).
4134 The `read-key-sequence' function replaces any subsequence bound by
4135 `function-key-map' with its binding. More precisely, when the active
4136 keymaps have no binding for the current key sequence but
4137 `function-key-map' binds a suffix of the sequence to a vector or string,
4138 `read-key-sequence' replaces the matching suffix with its binding, and
4142 and its return value (a key sequence) is used.
4144 The events that come from bindings in `function-key-map' are not
4145 themselves looked up in `function-key-map'.
4147 For example, suppose `function-key-map' binds `ESC O P' to [f1].
4148 Typing `ESC O P' to `read-key-sequence' would return [f1]. Typing
4150 key, typing `ESC O P x' would return [f1 x]. */);
4153 DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
4154 doc: /* Keymap of key translations that can override keymaps.
4155 This keymap works like `function-key-map', but comes after that,
4172 Qsingle_key_description = intern ("single-key-description");
4175 Qkey_description = intern ("key-description");