Mercurial > emacs
comparison src/keyboard.c @ 35255:d473294a0124
Call get_local_map with new argument list.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 12 Jan 2001 11:17:53 +0000 |
parents | bc4b6bd7103e |
children | 002c02db42d3 |
comparison
equal
deleted
inserted
replaced
35254:54d36c772e7b | 35255:d473294a0124 |
---|---|
6301 } | 6301 } |
6302 else | 6302 else |
6303 { | 6303 { |
6304 /* No, so use major and minor mode keymaps and keymap property. */ | 6304 /* No, so use major and minor mode keymaps and keymap property. */ |
6305 int extra_maps = 2; | 6305 int extra_maps = 2; |
6306 Lisp_Object map = get_local_map (PT, current_buffer, keymap); | 6306 Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); |
6307 if (!NILP (map)) | 6307 if (!NILP (map)) |
6308 extra_maps = 3; | 6308 extra_maps = 3; |
6309 nmaps = current_minor_maps (NULL, &tmaps); | 6309 nmaps = current_minor_maps (NULL, &tmaps); |
6310 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | 6310 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) |
6311 * sizeof (maps[0])); | 6311 * sizeof (maps[0])); |
6312 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | 6312 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); |
6313 if (!NILP (map)) | 6313 if (!NILP (map)) |
6314 maps[nmaps++] = map; | 6314 maps[nmaps++] = map; |
6315 maps[nmaps++] = get_local_map (PT, current_buffer, local_map); | 6315 maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); |
6316 } | 6316 } |
6317 maps[nmaps++] = current_global_map; | 6317 maps[nmaps++] = current_global_map; |
6318 } | 6318 } |
6319 | 6319 |
6320 /* Look up in each map the dummy prefix key `menu-bar'. */ | 6320 /* Look up in each map the dummy prefix key `menu-bar'. */ |
6953 } | 6953 } |
6954 else | 6954 else |
6955 { | 6955 { |
6956 /* No, so use major and minor mode keymaps and keymap property. */ | 6956 /* No, so use major and minor mode keymaps and keymap property. */ |
6957 int extra_maps = 2; | 6957 int extra_maps = 2; |
6958 Lisp_Object map = get_local_map (PT, current_buffer, keymap); | 6958 Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); |
6959 if (!NILP (map)) | 6959 if (!NILP (map)) |
6960 extra_maps = 3; | 6960 extra_maps = 3; |
6961 nmaps = current_minor_maps (NULL, &tmaps); | 6961 nmaps = current_minor_maps (NULL, &tmaps); |
6962 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | 6962 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) |
6963 * sizeof (maps[0])); | 6963 * sizeof (maps[0])); |
6964 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | 6964 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); |
6965 if (!NILP (map)) | 6965 if (!NILP (map)) |
6966 maps[nmaps++] = map; | 6966 maps[nmaps++] = map; |
6967 maps[nmaps++] = get_local_map (PT, current_buffer, local_map); | 6967 maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); |
6968 } | 6968 } |
6969 | 6969 |
6970 /* Add global keymap at the end. */ | 6970 /* Add global keymap at the end. */ |
6971 maps[nmaps++] = current_global_map; | 6971 maps[nmaps++] = current_global_map; |
6972 | 6972 |
7882 up any keymaps, in case a filter runs and switches buffers on us. */ | 7882 up any keymaps, in case a filter runs and switches buffers on us. */ |
7883 first_event = read_char (NILP (prompt), 0, submaps, last_nonmenu_event, | 7883 first_event = read_char (NILP (prompt), 0, submaps, last_nonmenu_event, |
7884 &junk); | 7884 &junk); |
7885 #endif /* GOBBLE_FIRST_EVENT */ | 7885 #endif /* GOBBLE_FIRST_EVENT */ |
7886 | 7886 |
7887 orig_local_map = get_local_map (PT, current_buffer, local_map); | 7887 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); |
7888 orig_keymap = get_local_map (PT, current_buffer, keymap); | 7888 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); |
7889 | 7889 |
7890 /* We jump here when the key sequence has been thoroughly changed, and | 7890 /* We jump here when the key sequence has been thoroughly changed, and |
7891 we need to rescan it starting from the beginning. When we jump here, | 7891 we need to rescan it starting from the beginning. When we jump here, |
7892 keybuf[0..mock_input] holds the sequence we should reread. */ | 7892 keybuf[0..mock_input] holds the sequence we should reread. */ |
7893 replay_sequence: | 7893 replay_sequence: |
8052 interrupted_kboard->kbd_queue | 8052 interrupted_kboard->kbd_queue |
8053 = Fcons (make_lispy_switch_frame (frame), | 8053 = Fcons (make_lispy_switch_frame (frame), |
8054 interrupted_kboard->kbd_queue); | 8054 interrupted_kboard->kbd_queue); |
8055 } | 8055 } |
8056 mock_input = 0; | 8056 mock_input = 0; |
8057 orig_local_map = get_local_map (PT, current_buffer, local_map); | 8057 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); |
8058 orig_keymap = get_local_map (PT, current_buffer, keymap); | 8058 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); |
8059 goto replay_sequence; | 8059 goto replay_sequence; |
8060 } | 8060 } |
8061 #endif | 8061 #endif |
8062 key = read_char (NILP (prompt), nmaps, | 8062 key = read_char (NILP (prompt), nmaps, |
8063 (Lisp_Object *) submaps, last_nonmenu_event, | 8063 (Lisp_Object *) submaps, last_nonmenu_event, |
8099 Fkill_emacs (Qnil); | 8099 Fkill_emacs (Qnil); |
8100 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) | 8100 if (XBUFFER (XWINDOW (selected_window)->buffer) != current_buffer) |
8101 Fset_buffer (XWINDOW (selected_window)->buffer); | 8101 Fset_buffer (XWINDOW (selected_window)->buffer); |
8102 } | 8102 } |
8103 | 8103 |
8104 orig_local_map = get_local_map (PT, current_buffer, local_map); | 8104 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); |
8105 orig_keymap = get_local_map (PT, current_buffer, keymap); | 8105 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); |
8106 goto replay_sequence; | 8106 goto replay_sequence; |
8107 } | 8107 } |
8108 | 8108 |
8109 /* If we have a quit that was typed in another frame, and | 8109 /* If we have a quit that was typed in another frame, and |
8110 quit_throw_to_read_char switched buffers, | 8110 quit_throw_to_read_char switched buffers, |
8114 GROW_RAW_KEYBUF; | 8114 GROW_RAW_KEYBUF; |
8115 XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; | 8115 XVECTOR (raw_keybuf)->contents[raw_keybuf_count++] = key; |
8116 keybuf[t++] = key; | 8116 keybuf[t++] = key; |
8117 mock_input = t; | 8117 mock_input = t; |
8118 Vquit_flag = Qnil; | 8118 Vquit_flag = Qnil; |
8119 orig_local_map = get_local_map (PT, current_buffer, local_map); | 8119 orig_local_map = get_local_map (PT, current_buffer, Qlocal_map); |
8120 orig_keymap = get_local_map (PT, current_buffer, keymap); | 8120 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); |
8121 goto replay_sequence; | 8121 goto replay_sequence; |
8122 } | 8122 } |
8123 | 8123 |
8124 Vquit_flag = Qnil; | 8124 Vquit_flag = Qnil; |
8125 | 8125 |
8200 emacsclient). */ | 8200 emacsclient). */ |
8201 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 8201 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
8202 | 8202 |
8203 if (! FRAME_LIVE_P (XFRAME (selected_frame))) | 8203 if (! FRAME_LIVE_P (XFRAME (selected_frame))) |
8204 Fkill_emacs (Qnil); | 8204 Fkill_emacs (Qnil); |
8205 set_buffer_internal (XBUFFER (XWINDOW | 8205 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); |
8206 (window)->buffer) | |
8207 ); | |
8208 orig_local_map = get_local_map (PT, current_buffer, | 8206 orig_local_map = get_local_map (PT, current_buffer, |
8209 local_map); | 8207 Qlocal_map); |
8210 orig_keymap = get_local_map (PT, current_buffer, keymap); | 8208 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); |
8211 goto replay_sequence; | 8209 goto replay_sequence; |
8212 } | 8210 } |
8213 | 8211 |
8214 /* For a mouse click, get the local text-property keymap | 8212 /* For a mouse click, get the local text-property keymap |
8215 of the place clicked on, rather than point. */ | 8213 of the place clicked on, rather than point. */ |
8227 pos = POSN_BUFFER_POSN (start); | 8225 pos = POSN_BUFFER_POSN (start); |
8228 if (INTEGERP (pos) | 8226 if (INTEGERP (pos) |
8229 && XINT (pos) >= BEG && XINT (pos) <= Z) | 8227 && XINT (pos) >= BEG && XINT (pos) <= Z) |
8230 { | 8228 { |
8231 map_here = get_local_map (XINT (pos), | 8229 map_here = get_local_map (XINT (pos), |
8232 current_buffer, local_map); | 8230 current_buffer, Qlocal_map); |
8233 if (!EQ (map_here, orig_local_map)) | 8231 if (!EQ (map_here, orig_local_map)) |
8234 { | 8232 { |
8235 orig_local_map = map_here; | 8233 orig_local_map = map_here; |
8236 keybuf[t] = key; | 8234 keybuf[t] = key; |
8237 mock_input = t + 1; | 8235 mock_input = t + 1; |
8238 | 8236 |
8239 goto replay_sequence; | 8237 goto replay_sequence; |
8240 } | 8238 } |
8241 map_here = get_local_map (XINT (pos), | 8239 map_here = get_local_map (XINT (pos), |
8242 current_buffer, keymap); | 8240 current_buffer, Qkeymap); |
8243 if (!EQ (map_here, orig_keymap)) | 8241 if (!EQ (map_here, orig_keymap)) |
8244 { | 8242 { |
8245 orig_keymap = map_here; | 8243 orig_keymap = map_here; |
8246 keybuf[t] = key; | 8244 keybuf[t] = key; |
8247 mock_input = t + 1; | 8245 mock_input = t + 1; |
9247 } | 9245 } |
9248 else | 9246 else |
9249 { | 9247 { |
9250 /* No, so use major and minor mode keymaps and keymap property. */ | 9248 /* No, so use major and minor mode keymaps and keymap property. */ |
9251 int extra_maps = 2; | 9249 int extra_maps = 2; |
9252 Lisp_Object map = get_local_map (PT, current_buffer, keymap); | 9250 Lisp_Object map = get_local_map (PT, current_buffer, Qkeymap); |
9253 if (!NILP (map)) | 9251 if (!NILP (map)) |
9254 extra_maps = 3; | 9252 extra_maps = 3; |
9255 nmaps = current_minor_maps (NULL, &tmaps); | 9253 nmaps = current_minor_maps (NULL, &tmaps); |
9256 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) | 9254 maps = (Lisp_Object *) alloca ((nmaps + extra_maps) |
9257 * sizeof (maps[0])); | 9255 * sizeof (maps[0])); |
9258 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); | 9256 bcopy (tmaps, maps, nmaps * sizeof (maps[0])); |
9259 if (!NILP (map)) | 9257 if (!NILP (map)) |
9260 maps[nmaps++] = map; | 9258 maps[nmaps++] = map; |
9261 maps[nmaps++] = get_local_map (PT, current_buffer, local_map); | 9259 maps[nmaps++] = get_local_map (PT, current_buffer, Qlocal_map); |
9262 } | 9260 } |
9263 maps[nmaps++] = current_global_map; | 9261 maps[nmaps++] = current_global_map; |
9264 | 9262 |
9265 *maps_p = maps; | 9263 *maps_p = maps; |
9266 return nmaps; | 9264 return nmaps; |