aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2000-09-13 11:18:03 +0000
committerGerd Moellmann2000-09-13 11:18:03 +0000
commit8c907a5633c31e6a297b0535804bbc929a672f18 (patch)
tree9114e20f716ea2513033f5e9f91b47fbefaaecd1 /src
parent820d41817cb716f55e908ee06d365f6c58ed180d (diff)
downloademacs-8c907a5633c31e6a297b0535804bbc929a672f18.tar.gz
emacs-8c907a5633c31e6a297b0535804bbc929a672f18.zip
Avoid some more compiler warnings.
(parse_tool_bar_item): Ignore cached key bindings.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/keyboard.c92
2 files changed, 56 insertions, 39 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 09eaa7c0a5c..8b0a86fca90 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
12000-09-13 Gerd Moellmann <gerd@gnu.org> 12000-09-13 Gerd Moellmann <gerd@gnu.org>
2 2
3 * keyboard.c: Avoid some more compiler warnings.
4 (parse_tool_bar_item): Ignore cached key bindings.
5
3 * alloc.c: Add some comments about DOUG_LEA_MALLOC's use of mmap 6 * alloc.c: Add some comments about DOUG_LEA_MALLOC's use of mmap
4 and allocation of Lisp data. 7 and allocation of Lisp data.
5 8
diff --git a/src/keyboard.c b/src/keyboard.c
index 8622d2e3f4e..4ce4bc6e5b8 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1206,7 +1206,7 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "",
1206 if (display_busy_cursor_p) 1206 if (display_busy_cursor_p)
1207 cancel_busy_cursor (); 1207 cancel_busy_cursor ();
1208#endif 1208#endif
1209 Fthrow (Qtop_level, Qnil); 1209 return Fthrow (Qtop_level, Qnil);
1210} 1210}
1211 1211
1212DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "", 1212DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0, "",
@@ -1217,6 +1217,7 @@ DEFUN ("exit-recursive-edit", Fexit_recursive_edit, Sexit_recursive_edit, 0, 0,
1217 Fthrow (Qexit, Qnil); 1217 Fthrow (Qexit, Qnil);
1218 1218
1219 error ("No recursive edit is in progress"); 1219 error ("No recursive edit is in progress");
1220 return Qnil;
1220} 1221}
1221 1222
1222DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "", 1223DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, 0, "",
@@ -1227,6 +1228,7 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0,
1227 Fthrow (Qexit, Qt); 1228 Fthrow (Qexit, Qt);
1228 1229
1229 error ("No recursive edit is in progress"); 1230 error ("No recursive edit is in progress");
1231 return Qnil;
1230} 1232}
1231 1233
1232/* This is the actual command reading loop, 1234/* This is the actual command reading loop,
@@ -1247,7 +1249,7 @@ command_loop_1 ()
1247 int i; 1249 int i;
1248 int no_direct; 1250 int no_direct;
1249 int prev_modiff; 1251 int prev_modiff;
1250 struct buffer *prev_buffer; 1252 struct buffer *prev_buffer = NULL;
1251#ifdef MULTI_KBOARD 1253#ifdef MULTI_KBOARD
1252 int was_locked = single_kboard; 1254 int was_locked = single_kboard;
1253#endif 1255#endif
@@ -2029,15 +2031,15 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2029 Lisp_Object prev_event; 2031 Lisp_Object prev_event;
2030 int *used_mouse_menu; 2032 int *used_mouse_menu;
2031{ 2033{
2032 Lisp_Object c; 2034 volatile Lisp_Object c;
2033 int count; 2035 int count;
2034 jmp_buf local_getcjmp; 2036 jmp_buf local_getcjmp;
2035 jmp_buf save_jump; 2037 jmp_buf save_jump;
2036 int key_already_recorded = 0; 2038 volatile int key_already_recorded = 0;
2037 Lisp_Object tem, save; 2039 Lisp_Object tem, save;
2038 Lisp_Object previous_echo_area_message; 2040 volatile Lisp_Object previous_echo_area_message;
2039 Lisp_Object also_record; 2041 volatile Lisp_Object also_record;
2040 int reread; 2042 volatile int reread;
2041 struct gcpro gcpro1, gcpro2; 2043 struct gcpro gcpro1, gcpro2;
2042 2044
2043 also_record = Qnil; 2045 also_record = Qnil;
@@ -3812,7 +3814,7 @@ timer_check (do_it_now)
3812 while (CONSP (timers) || CONSP (idle_timers)) 3814 while (CONSP (timers) || CONSP (idle_timers))
3813 { 3815 {
3814 Lisp_Object *vector; 3816 Lisp_Object *vector;
3815 Lisp_Object timer, idle_timer; 3817 Lisp_Object timer = Qnil, idle_timer = Qnil;
3816 EMACS_TIME timer_time, idle_timer_time; 3818 EMACS_TIME timer_time, idle_timer_time;
3817 EMACS_TIME difference, timer_difference, idle_timer_difference; 3819 EMACS_TIME difference, timer_difference, idle_timer_difference;
3818 3820
@@ -4564,6 +4566,8 @@ make_lispy_event (event)
4564 Lisp_Object *start_pos_ptr; 4566 Lisp_Object *start_pos_ptr;
4565 Lisp_Object start_pos; 4567 Lisp_Object start_pos;
4566 4568
4569 position = Qnil;
4570
4567 /* Build the position as appropriate for this mouse click. */ 4571 /* Build the position as appropriate for this mouse click. */
4568 if (event->kind == mouse_click) 4572 if (event->kind == mouse_click)
4569 { 4573 {
@@ -5690,7 +5694,10 @@ has the same base event type and all the specified modifiers.")
5690 else if (SYMBOLP (base)) 5694 else if (SYMBOLP (base))
5691 return apply_modifiers (modifiers, base); 5695 return apply_modifiers (modifiers, base);
5692 else 5696 else
5693 error ("Invalid base event"); 5697 {
5698 error ("Invalid base event");
5699 return Qnil;
5700 }
5694} 5701}
5695 5702
5696/* Try to recognize SYMBOL as a modifier name. 5703/* Try to recognize SYMBOL as a modifier name.
@@ -7002,9 +7009,9 @@ parse_tool_bar_item (key, item)
7002 extern Lisp_Object QCbutton, QCtoggle, QCradio; 7009 extern Lisp_Object QCbutton, QCtoggle, QCradio;
7003 int i; 7010 int i;
7004 7011
7005 /* Defininition looks like `(tool-bar-item CAPTION BINDING 7012 /* Defininition looks like `(menu-item CAPTION BINDING PROPS...)'.
7006 PROPS...)'. Rule out items that aren't lists, don't start with 7013 Rule out items that aren't lists, don't start with
7007 `tool-bar-item' or whose rest following `tool-bar-item' is not a 7014 `menu-item' or whose rest following `tool-bar-item' is not a
7008 list. */ 7015 list. */
7009 if (!CONSP (item) 7016 if (!CONSP (item)
7010 || !EQ (XCAR (item), Qmenu_item) 7017 || !EQ (XCAR (item), Qmenu_item)
@@ -7048,6 +7055,10 @@ parse_tool_bar_item (key, item)
7048 PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item); 7055 PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item);
7049 item = XCDR (item); 7056 item = XCDR (item);
7050 7057
7058 /* Ignore cached key binding, if any. */
7059 if (CONSP (item) && CONSP (XCAR (item)))
7060 item = XCDR (item);
7061
7051 /* Process the rest of the properties. */ 7062 /* Process the rest of the properties. */
7052 for (; CONSP (item) && CONSP (XCDR (item)); item = XCDR (XCDR (item))) 7063 for (; CONSP (item) && CONSP (XCDR (item)); item = XCDR (XCDR (item)))
7053 { 7064 {
@@ -7307,6 +7318,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
7307 Lisp_Object rest, vector; 7318 Lisp_Object rest, vector;
7308 char *menu; 7319 char *menu;
7309 7320
7321 vector = Qnil;
7322
7310 if (! menu_prompting) 7323 if (! menu_prompting)
7311 return Qnil; 7324 return Qnil;
7312 7325
@@ -7410,7 +7423,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
7410 /* 1 if the char to type matches the string. */ 7423 /* 1 if the char to type matches the string. */
7411 int char_matches; 7424 int char_matches;
7412 Lisp_Object upcased_event, downcased_event; 7425 Lisp_Object upcased_event, downcased_event;
7413 Lisp_Object desc; 7426 Lisp_Object desc = Qnil;
7414 Lisp_Object s 7427 Lisp_Object s
7415 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; 7428 = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME];
7416 7429
@@ -7659,44 +7672,44 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7659 int can_return_switch_frame; 7672 int can_return_switch_frame;
7660 int fix_current_buffer; 7673 int fix_current_buffer;
7661{ 7674{
7662 int count = specpdl_ptr - specpdl; 7675 volatile int count = specpdl_ptr - specpdl;
7663 7676
7664 /* How many keys there are in the current key sequence. */ 7677 /* How many keys there are in the current key sequence. */
7665 int t; 7678 volatile int t;
7666 7679
7667 /* The length of the echo buffer when we started reading, and 7680 /* The length of the echo buffer when we started reading, and
7668 the length of this_command_keys when we started reading. */ 7681 the length of this_command_keys when we started reading. */
7669 int echo_start; 7682 volatile int echo_start;
7670 int keys_start; 7683 volatile int keys_start;
7671 7684
7672 /* The number of keymaps we're scanning right now, and the number of 7685 /* The number of keymaps we're scanning right now, and the number of
7673 keymaps we have allocated space for. */ 7686 keymaps we have allocated space for. */
7674 int nmaps; 7687 volatile int nmaps;
7675 int nmaps_allocated = 0; 7688 volatile int nmaps_allocated = 0;
7676 7689
7677 /* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in 7690 /* defs[0..nmaps-1] are the definitions of KEYBUF[0..t-1] in
7678 the current keymaps. */ 7691 the current keymaps. */
7679 Lisp_Object *defs; 7692 Lisp_Object *volatile defs = NULL;
7680 7693
7681 /* submaps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1] 7694 /* submaps[0..nmaps-1] are the prefix definitions of KEYBUF[0..t-1]
7682 in the current keymaps, or nil where it is not a prefix. */ 7695 in the current keymaps, or nil where it is not a prefix. */
7683 Lisp_Object *submaps; 7696 Lisp_Object *volatile submaps = NULL;
7684 7697
7685 /* The local map to start out with at start of key sequence. */ 7698 /* The local map to start out with at start of key sequence. */
7686 Lisp_Object orig_local_map; 7699 volatile Lisp_Object orig_local_map;
7687 7700
7688 /* The map from the `keymap' property to start out with at start of 7701 /* The map from the `keymap' property to start out with at start of
7689 key sequence. */ 7702 key sequence. */
7690 Lisp_Object orig_keymap; 7703 volatile Lisp_Object orig_keymap;
7691 7704
7692 /* 1 if we have already considered switching to the local-map property 7705 /* 1 if we have already considered switching to the local-map property
7693 of the place where a mouse click occurred. */ 7706 of the place where a mouse click occurred. */
7694 int localized_local_map = 0; 7707 volatile int localized_local_map = 0;
7695 7708
7696 /* The index in defs[] of the first keymap that has a binding for 7709 /* The index in defs[] of the first keymap that has a binding for
7697 this key sequence. In other words, the lowest i such that 7710 this key sequence. In other words, the lowest i such that
7698 defs[i] is non-nil. */ 7711 defs[i] is non-nil. */
7699 int first_binding; 7712 volatile int first_binding;
7700 7713
7701 /* If t < mock_input, then KEYBUF[t] should be read as the next 7714 /* If t < mock_input, then KEYBUF[t] should be read as the next
7702 input key. 7715 input key.
@@ -7711,7 +7724,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7711 restart_sequence; the loop will read keys from keybuf up until 7724 restart_sequence; the loop will read keys from keybuf up until
7712 mock_input, thus rebuilding the state; and then it will resume 7725 mock_input, thus rebuilding the state; and then it will resume
7713 reading characters from the keyboard. */ 7726 reading characters from the keyboard. */
7714 int mock_input = 0; 7727 volatile int mock_input = 0;
7715 7728
7716 /* If the sequence is unbound in submaps[], then 7729 /* If the sequence is unbound in submaps[], then
7717 keybuf[fkey_start..fkey_end-1] is a prefix in Vfunction_key_map, 7730 keybuf[fkey_start..fkey_end-1] is a prefix in Vfunction_key_map,
@@ -7721,24 +7734,24 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7721 should hold off until t reaches them. We do this when we've just 7734 should hold off until t reaches them. We do this when we've just
7722 recognized a function key, to avoid searching for the function 7735 recognized a function key, to avoid searching for the function
7723 key's again in Vfunction_key_map. */ 7736 key's again in Vfunction_key_map. */
7724 int fkey_start = 0, fkey_end = 0; 7737 volatile int fkey_start = 0, fkey_end = 0;
7725 Lisp_Object fkey_map; 7738 volatile Lisp_Object fkey_map;
7726 7739
7727 /* Likewise, for key_translation_map. */ 7740 /* Likewise, for key_translation_map. */
7728 int keytran_start = 0, keytran_end = 0; 7741 volatile int keytran_start = 0, keytran_end = 0;
7729 Lisp_Object keytran_map; 7742 volatile Lisp_Object keytran_map;
7730 7743
7731 /* If we receive a ``switch-frame'' event in the middle of a key sequence, 7744 /* If we receive a ``switch-frame'' event in the middle of a key sequence,
7732 we put it off for later. While we're reading, we keep the event here. */ 7745 we put it off for later. While we're reading, we keep the event here. */
7733 Lisp_Object delayed_switch_frame; 7746 volatile Lisp_Object delayed_switch_frame;
7734 7747
7735 /* See the comment below... */ 7748 /* See the comment below... */
7736#if defined (GOBBLE_FIRST_EVENT) 7749#if defined (GOBBLE_FIRST_EVENT)
7737 Lisp_Object first_event; 7750 Lisp_Object first_event;
7738#endif 7751#endif
7739 7752
7740 Lisp_Object original_uppercase; 7753 volatile Lisp_Object original_uppercase;
7741 int original_uppercase_position = -1; 7754 volatile int original_uppercase_position = -1;
7742 7755
7743 /* Gets around Microsoft compiler limitations. */ 7756 /* Gets around Microsoft compiler limitations. */
7744 int dummyflag = 0; 7757 int dummyflag = 0;
@@ -7747,8 +7760,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7747 7760
7748 /* Nonzero if we seem to have got the beginning of a binding 7761 /* Nonzero if we seem to have got the beginning of a binding
7749 in function_key_map. */ 7762 in function_key_map. */
7750 int function_key_possible = 0; 7763 volatile int function_key_possible = 0;
7751 int key_translation_possible = 0; 7764 volatile int key_translation_possible = 0;
7752 7765
7753 /* Save the status of key translation before each step, 7766 /* Save the status of key translation before each step,
7754 so that we can restore this after downcasing. */ 7767 so that we can restore this after downcasing. */
@@ -7859,7 +7872,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7859 * sizeof (defs[0])); 7872 * sizeof (defs[0]));
7860 nmaps_allocated = nmaps + extra_maps; 7873 nmaps_allocated = nmaps + extra_maps;
7861 } 7874 }
7862 bcopy (maps, submaps, nmaps * sizeof (submaps[0])); 7875 bcopy (maps, (void *) submaps, nmaps * sizeof (submaps[0]));
7863 if (!NILP (orig_keymap)) 7876 if (!NILP (orig_keymap))
7864 submaps[nmaps++] = orig_keymap; 7877 submaps[nmaps++] = orig_keymap;
7865 submaps[nmaps++] = orig_local_map; 7878 submaps[nmaps++] = orig_local_map;
@@ -7906,13 +7919,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7906 (say, a mouse click on the mode line which is being treated 7919 (say, a mouse click on the mode line which is being treated
7907 as [mode-line (mouse-...)], then we backtrack to this point 7920 as [mode-line (mouse-...)], then we backtrack to this point
7908 of keybuf. */ 7921 of keybuf. */
7909 int last_real_key_start; 7922 volatile int last_real_key_start;
7910 7923
7911 /* These variables are analogous to echo_start and keys_start; 7924 /* These variables are analogous to echo_start and keys_start;
7912 while those allow us to restart the entire key sequence, 7925 while those allow us to restart the entire key sequence,
7913 echo_local_start and keys_local_start allow us to throw away 7926 echo_local_start and keys_local_start allow us to throw away
7914 just one key. */ 7927 just one key. */
7915 int echo_local_start, keys_local_start, local_first_binding; 7928 volatile int echo_local_start, keys_local_start, local_first_binding;
7916 7929
7917 if (t >= bufsize) 7930 if (t >= bufsize)
7918 error ("Key sequence too long"); 7931 error ("Key sequence too long");
@@ -7985,7 +7998,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
7985 goto replay_sequence; 7998 goto replay_sequence;
7986 } 7999 }
7987#endif 8000#endif
7988 key = read_char (NILP (prompt), nmaps, submaps, last_nonmenu_event, 8001 key = read_char (NILP (prompt), nmaps,
8002 (Lisp_Object *) submaps, last_nonmenu_event,
7989 &used_mouse_menu); 8003 &used_mouse_menu);
7990 } 8004 }
7991 8005