diff options
| author | Joakim Verona | 2011-02-05 11:23:09 +0100 |
|---|---|---|
| committer | Joakim Verona | 2011-02-05 11:23:09 +0100 |
| commit | 4bd51ad5c3445b644dfb017d5b57b10a90aa325f (patch) | |
| tree | 894801e7308ce4ecc34933f959e28f4b9cff9533 /src/keymap.c | |
| parent | 13cfe8df462ab8da9f0028e16cc84dcaceaca3d1 (diff) | |
| parent | 9bcaafce5351d270ac514e23cb69ff1a5fd35229 (diff) | |
| download | emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.tar.gz emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.zip | |
merge from upstream. currently seems to have bitroted and i get segfaults
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 66 |
1 files changed, 14 insertions, 52 deletions
diff --git a/src/keymap.c b/src/keymap.c index cc25d350d44..1e6b76a4642 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | /* Manipulation of keymaps | 1 | /* Manipulation of keymaps |
| 2 | Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, | 2 | Copyright (C) 1985-1988, 1993-1995, 1998-2011 Free Software Foundation, Inc. |
| 3 | 1998, 1999, 2000, 2001, 2002, 2003, 2004, | ||
| 4 | 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | ||
| 5 | 3 | ||
| 6 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 7 | 5 | ||
| @@ -51,49 +49,16 @@ Lisp_Object meta_map; /* The keymap used for globally bound | |||
| 51 | Lisp_Object control_x_map; /* The keymap used for globally bound | 49 | Lisp_Object control_x_map; /* The keymap used for globally bound |
| 52 | C-x-prefixed default commands */ | 50 | C-x-prefixed default commands */ |
| 53 | 51 | ||
| 54 | /* was MinibufLocalMap */ | ||
| 55 | Lisp_Object Vminibuffer_local_map; | ||
| 56 | /* The keymap used by the minibuf for local | 52 | /* The keymap used by the minibuf for local |
| 57 | bindings when spaces are allowed in the | 53 | bindings when spaces are allowed in the |
| 58 | minibuf */ | 54 | minibuf */ |
| 59 | 55 | ||
| 60 | /* was MinibufLocalNSMap */ | ||
| 61 | Lisp_Object Vminibuffer_local_ns_map; | ||
| 62 | /* The keymap used by the minibuf for local | 56 | /* The keymap used by the minibuf for local |
| 63 | bindings when spaces are not encouraged | 57 | bindings when spaces are not encouraged |
| 64 | in the minibuf */ | 58 | in the minibuf */ |
| 65 | 59 | ||
| 66 | /* keymap used for minibuffers when doing completion */ | 60 | /* keymap used for minibuffers when doing completion */ |
| 67 | /* was MinibufLocalCompletionMap */ | ||
| 68 | Lisp_Object Vminibuffer_local_completion_map; | ||
| 69 | |||
| 70 | /* keymap used for minibuffers when doing completion in filenames */ | ||
| 71 | Lisp_Object Vminibuffer_local_filename_completion_map; | ||
| 72 | |||
| 73 | /* keymap used for minibuffers when doing completion in filenames | ||
| 74 | with require-match*/ | ||
| 75 | Lisp_Object Vminibuffer_local_filename_must_match_map; | ||
| 76 | |||
| 77 | /* keymap used for minibuffers when doing completion and require a match */ | 61 | /* keymap used for minibuffers when doing completion and require a match */ |
| 78 | /* was MinibufLocalMustMatchMap */ | ||
| 79 | Lisp_Object Vminibuffer_local_must_match_map; | ||
| 80 | |||
| 81 | /* Alist of minor mode variables and keymaps. */ | ||
| 82 | Lisp_Object Vminor_mode_map_alist; | ||
| 83 | |||
| 84 | /* Alist of major-mode-specific overrides for | ||
| 85 | minor mode variables and keymaps. */ | ||
| 86 | Lisp_Object Vminor_mode_overriding_map_alist; | ||
| 87 | |||
| 88 | /* List of emulation mode keymap alists. */ | ||
| 89 | Lisp_Object Vemulation_mode_map_alists; | ||
| 90 | |||
| 91 | /* A list of all commands given new bindings since a certain time | ||
| 92 | when nil was stored here. | ||
| 93 | This is used to speed up recomputation of menu key equivalents | ||
| 94 | when Emacs starts up. t means don't record anything here. */ | ||
| 95 | Lisp_Object Vdefine_key_rebound_commands; | ||
| 96 | |||
| 97 | Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap; | 62 | Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap; |
| 98 | Lisp_Object QCadvertised_binding; | 63 | Lisp_Object QCadvertised_binding; |
| 99 | 64 | ||
| @@ -122,6 +87,7 @@ static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, | |||
| 122 | Lisp_Object, Lisp_Object, int *, | 87 | Lisp_Object, Lisp_Object, int *, |
| 123 | int, int, int); | 88 | int, int, int); |
| 124 | static void silly_event_symbol_error (Lisp_Object); | 89 | static void silly_event_symbol_error (Lisp_Object); |
| 90 | static Lisp_Object get_keyelt (Lisp_Object, int); | ||
| 125 | 91 | ||
| 126 | /* Keymap object support - constructors and predicates. */ | 92 | /* Keymap object support - constructors and predicates. */ |
| 127 | 93 | ||
| @@ -758,7 +724,7 @@ usage: (map-keymap FUNCTION KEYMAP) */) | |||
| 758 | 724 | ||
| 759 | This can GC because menu_item_eval_property calls Feval. */ | 725 | This can GC because menu_item_eval_property calls Feval. */ |
| 760 | 726 | ||
| 761 | Lisp_Object | 727 | static Lisp_Object |
| 762 | get_keyelt (Lisp_Object object, int autoload) | 728 | get_keyelt (Lisp_Object object, int autoload) |
| 763 | { | 729 | { |
| 764 | while (1) | 730 | while (1) |
| @@ -2709,8 +2675,6 @@ where_is_internal (Lisp_Object definition, Lisp_Object keymaps, | |||
| 2709 | return data.sequences; | 2675 | return data.sequences; |
| 2710 | } | 2676 | } |
| 2711 | 2677 | ||
| 2712 | static Lisp_Object Vwhere_is_preferred_modifier; | ||
| 2713 | |||
| 2714 | /* This function can GC if Flookup_key autoloads any keymaps. */ | 2678 | /* This function can GC if Flookup_key autoloads any keymaps. */ |
| 2715 | 2679 | ||
| 2716 | DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, | 2680 | DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0, |
| @@ -3856,48 +3820,48 @@ syms_of_keymap (void) | |||
| 3856 | Qnil))))); | 3820 | Qnil))))); |
| 3857 | staticpro (&exclude_keys); | 3821 | staticpro (&exclude_keys); |
| 3858 | 3822 | ||
| 3859 | DEFVAR_LISP ("define-key-rebound-commands", &Vdefine_key_rebound_commands, | 3823 | DEFVAR_LISP ("define-key-rebound-commands", Vdefine_key_rebound_commands, |
| 3860 | doc: /* List of commands given new key bindings recently. | 3824 | doc: /* List of commands given new key bindings recently. |
| 3861 | This is used for internal purposes during Emacs startup; | 3825 | This is used for internal purposes during Emacs startup; |
| 3862 | don't alter it yourself. */); | 3826 | don't alter it yourself. */); |
| 3863 | Vdefine_key_rebound_commands = Qt; | 3827 | Vdefine_key_rebound_commands = Qt; |
| 3864 | 3828 | ||
| 3865 | DEFVAR_LISP ("minibuffer-local-map", &Vminibuffer_local_map, | 3829 | DEFVAR_LISP ("minibuffer-local-map", Vminibuffer_local_map, |
| 3866 | doc: /* Default keymap to use when reading from the minibuffer. */); | 3830 | doc: /* Default keymap to use when reading from the minibuffer. */); |
| 3867 | Vminibuffer_local_map = Fmake_sparse_keymap (Qnil); | 3831 | Vminibuffer_local_map = Fmake_sparse_keymap (Qnil); |
| 3868 | 3832 | ||
| 3869 | DEFVAR_LISP ("minibuffer-local-ns-map", &Vminibuffer_local_ns_map, | 3833 | DEFVAR_LISP ("minibuffer-local-ns-map", Vminibuffer_local_ns_map, |
| 3870 | doc: /* Local keymap for the minibuffer when spaces are not allowed. */); | 3834 | doc: /* Local keymap for the minibuffer when spaces are not allowed. */); |
| 3871 | Vminibuffer_local_ns_map = Fmake_sparse_keymap (Qnil); | 3835 | Vminibuffer_local_ns_map = Fmake_sparse_keymap (Qnil); |
| 3872 | Fset_keymap_parent (Vminibuffer_local_ns_map, Vminibuffer_local_map); | 3836 | Fset_keymap_parent (Vminibuffer_local_ns_map, Vminibuffer_local_map); |
| 3873 | 3837 | ||
| 3874 | DEFVAR_LISP ("minibuffer-local-completion-map", &Vminibuffer_local_completion_map, | 3838 | DEFVAR_LISP ("minibuffer-local-completion-map", Vminibuffer_local_completion_map, |
| 3875 | doc: /* Local keymap for minibuffer input with completion. */); | 3839 | doc: /* Local keymap for minibuffer input with completion. */); |
| 3876 | Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil); | 3840 | Vminibuffer_local_completion_map = Fmake_sparse_keymap (Qnil); |
| 3877 | Fset_keymap_parent (Vminibuffer_local_completion_map, Vminibuffer_local_map); | 3841 | Fset_keymap_parent (Vminibuffer_local_completion_map, Vminibuffer_local_map); |
| 3878 | 3842 | ||
| 3879 | DEFVAR_LISP ("minibuffer-local-filename-completion-map", | 3843 | DEFVAR_LISP ("minibuffer-local-filename-completion-map", |
| 3880 | &Vminibuffer_local_filename_completion_map, | 3844 | Vminibuffer_local_filename_completion_map, |
| 3881 | doc: /* Local keymap for minibuffer input with completion for filenames. */); | 3845 | doc: /* Local keymap for minibuffer input with completion for filenames. */); |
| 3882 | Vminibuffer_local_filename_completion_map = Fmake_sparse_keymap (Qnil); | 3846 | Vminibuffer_local_filename_completion_map = Fmake_sparse_keymap (Qnil); |
| 3883 | Fset_keymap_parent (Vminibuffer_local_filename_completion_map, | 3847 | Fset_keymap_parent (Vminibuffer_local_filename_completion_map, |
| 3884 | Vminibuffer_local_completion_map); | 3848 | Vminibuffer_local_completion_map); |
| 3885 | 3849 | ||
| 3886 | 3850 | ||
| 3887 | DEFVAR_LISP ("minibuffer-local-must-match-map", &Vminibuffer_local_must_match_map, | 3851 | DEFVAR_LISP ("minibuffer-local-must-match-map", Vminibuffer_local_must_match_map, |
| 3888 | doc: /* Local keymap for minibuffer input with completion, for exact match. */); | 3852 | doc: /* Local keymap for minibuffer input with completion, for exact match. */); |
| 3889 | Vminibuffer_local_must_match_map = Fmake_sparse_keymap (Qnil); | 3853 | Vminibuffer_local_must_match_map = Fmake_sparse_keymap (Qnil); |
| 3890 | Fset_keymap_parent (Vminibuffer_local_must_match_map, | 3854 | Fset_keymap_parent (Vminibuffer_local_must_match_map, |
| 3891 | Vminibuffer_local_completion_map); | 3855 | Vminibuffer_local_completion_map); |
| 3892 | 3856 | ||
| 3893 | DEFVAR_LISP ("minibuffer-local-filename-must-match-map", | 3857 | DEFVAR_LISP ("minibuffer-local-filename-must-match-map", |
| 3894 | &Vminibuffer_local_filename_must_match_map, | 3858 | Vminibuffer_local_filename_must_match_map, |
| 3895 | doc: /* Local keymap for minibuffer input with completion for filenames with exact match. */); | 3859 | doc: /* Local keymap for minibuffer input with completion for filenames with exact match. */); |
| 3896 | Vminibuffer_local_filename_must_match_map = Fmake_sparse_keymap (Qnil); | 3860 | Vminibuffer_local_filename_must_match_map = Fmake_sparse_keymap (Qnil); |
| 3897 | Fset_keymap_parent (Vminibuffer_local_filename_must_match_map, | 3861 | Fset_keymap_parent (Vminibuffer_local_filename_must_match_map, |
| 3898 | Vminibuffer_local_must_match_map); | 3862 | Vminibuffer_local_must_match_map); |
| 3899 | 3863 | ||
| 3900 | DEFVAR_LISP ("minor-mode-map-alist", &Vminor_mode_map_alist, | 3864 | DEFVAR_LISP ("minor-mode-map-alist", Vminor_mode_map_alist, |
| 3901 | doc: /* Alist of keymaps to use for minor modes. | 3865 | doc: /* Alist of keymaps to use for minor modes. |
| 3902 | Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read | 3866 | Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read |
| 3903 | key sequences and look up bindings if VARIABLE's value is non-nil. | 3867 | key sequences and look up bindings if VARIABLE's value is non-nil. |
| @@ -3905,14 +3869,14 @@ If two active keymaps bind the same key, the keymap appearing earlier | |||
| 3905 | in the list takes precedence. */); | 3869 | in the list takes precedence. */); |
| 3906 | Vminor_mode_map_alist = Qnil; | 3870 | Vminor_mode_map_alist = Qnil; |
| 3907 | 3871 | ||
| 3908 | DEFVAR_LISP ("minor-mode-overriding-map-alist", &Vminor_mode_overriding_map_alist, | 3872 | DEFVAR_LISP ("minor-mode-overriding-map-alist", Vminor_mode_overriding_map_alist, |
| 3909 | doc: /* Alist of keymaps to use for minor modes, in current major mode. | 3873 | doc: /* Alist of keymaps to use for minor modes, in current major mode. |
| 3910 | This variable is an alist just like `minor-mode-map-alist', and it is | 3874 | This variable is an alist just like `minor-mode-map-alist', and it is |
| 3911 | used the same way (and before `minor-mode-map-alist'); however, | 3875 | used the same way (and before `minor-mode-map-alist'); however, |
| 3912 | it is provided for major modes to bind locally. */); | 3876 | it is provided for major modes to bind locally. */); |
| 3913 | Vminor_mode_overriding_map_alist = Qnil; | 3877 | Vminor_mode_overriding_map_alist = Qnil; |
| 3914 | 3878 | ||
| 3915 | DEFVAR_LISP ("emulation-mode-map-alists", &Vemulation_mode_map_alists, | 3879 | DEFVAR_LISP ("emulation-mode-map-alists", Vemulation_mode_map_alists, |
| 3916 | doc: /* List of keymap alists to use for emulations modes. | 3880 | doc: /* List of keymap alists to use for emulations modes. |
| 3917 | It is intended for modes or packages using multiple minor-mode keymaps. | 3881 | It is intended for modes or packages using multiple minor-mode keymaps. |
| 3918 | Each element is a keymap alist just like `minor-mode-map-alist', or a | 3882 | Each element is a keymap alist just like `minor-mode-map-alist', or a |
| @@ -3921,7 +3885,7 @@ the same way. The "active" keymaps in each alist are used before | |||
| 3921 | `minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */); | 3885 | `minor-mode-map-alist' and `minor-mode-overriding-map-alist'. */); |
| 3922 | Vemulation_mode_map_alists = Qnil; | 3886 | Vemulation_mode_map_alists = Qnil; |
| 3923 | 3887 | ||
| 3924 | DEFVAR_LISP ("where-is-preferred-modifier", &Vwhere_is_preferred_modifier, | 3888 | DEFVAR_LISP ("where-is-preferred-modifier", Vwhere_is_preferred_modifier, |
| 3925 | doc: /* Preferred modifier to use for `where-is'. | 3889 | doc: /* Preferred modifier to use for `where-is'. |
| 3926 | When a single binding is requested, `where-is' will return one that | 3890 | When a single binding is requested, `where-is' will return one that |
| 3927 | uses this modifier if possible. If nil, or if no such binding exists, | 3891 | uses this modifier if possible. If nil, or if no such binding exists, |
| @@ -4012,5 +3976,3 @@ keys_of_keymap (void) | |||
| 4012 | initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); | 3976 | initial_define_key (global_map, Ctl ('X'), "Control-X-prefix"); |
| 4013 | } | 3977 | } |
| 4014 | 3978 | ||
| 4015 | /* arch-tag: 6dd15c26-7cf1-41c4-b904-f42f7ddda463 | ||
| 4016 | (do not change this comment) */ | ||