aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-02-08 16:22:36 +0000
committerStefan Monnier2008-02-08 16:22:36 +0000
commitb1ebcadbe27ce4027e8eb836ddd9fa318668d678 (patch)
tree89b0274f9165d72efb174d87022191688561ae0e
parentff7a222357ea1064c8019a635954bb0027f5ffe9 (diff)
downloademacs-b1ebcadbe27ce4027e8eb836ddd9fa318668d678.tar.gz
emacs-b1ebcadbe27ce4027e8eb836ddd9fa318668d678.zip
(add_command_key, parse_menu_item): Use ASET.
-rw-r--r--src/ChangeLog2
-rw-r--r--src/keyboard.c53
2 files changed, 28 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e8335aa0513..6e7b6239148 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,7 @@
12008-02-08 Stefan Monnier <monnier@iro.umontreal.ca> 12008-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * keyboard.c (add_command_key, parse_menu_item): Use ASET.
4
3 * fontset.c (free_face_fontset): Use FONTSET_FROM_ID. 5 * fontset.c (free_face_fontset): Use FONTSET_FROM_ID.
4 (syms_of_fontset): Use ASET. 6 (syms_of_fontset): Use ASET.
5 7
diff --git a/src/keyboard.c b/src/keyboard.c
index 867a8d26024..83cc47099cb 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -918,7 +918,7 @@ add_command_key (key)
918 2 * ASIZE (this_command_keys), 918 2 * ASIZE (this_command_keys),
919 Qnil); 919 Qnil);
920 920
921 AREF (this_command_keys, this_command_key_count) = key; 921 ASET (this_command_keys, this_command_key_count, key);
922 ++this_command_key_count; 922 ++this_command_key_count;
923} 923}
924 924
@@ -7826,11 +7826,11 @@ parse_menu_item (item, notreal, inmenubar)
7826 7826
7827 /* Initialize optional entries. */ 7827 /* Initialize optional entries. */
7828 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++) 7828 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++)
7829 AREF (item_properties, i) = Qnil; 7829 ASET (item_properties, i, Qnil);
7830 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt; 7830 ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
7831 7831
7832 /* Save the item here to protect it from GC. */ 7832 /* Save the item here to protect it from GC. */
7833 AREF (item_properties, ITEM_PROPERTY_ITEM) = item; 7833 ASET (item_properties, ITEM_PROPERTY_ITEM, item);
7834 7834
7835 item_string = XCAR (item); 7835 item_string = XCAR (item);
7836 7836
@@ -7839,12 +7839,12 @@ parse_menu_item (item, notreal, inmenubar)
7839 if (STRINGP (item_string)) 7839 if (STRINGP (item_string))
7840 { 7840 {
7841 /* Old format menu item. */ 7841 /* Old format menu item. */
7842 AREF (item_properties, ITEM_PROPERTY_NAME) = item_string; 7842 ASET (item_properties, ITEM_PROPERTY_NAME, item_string);
7843 7843
7844 /* Maybe help string. */ 7844 /* Maybe help string. */
7845 if (CONSP (item) && STRINGP (XCAR (item))) 7845 if (CONSP (item) && STRINGP (XCAR (item)))
7846 { 7846 {
7847 AREF (item_properties, ITEM_PROPERTY_HELP) = XCAR (item); 7847 ASET (item_properties, ITEM_PROPERTY_HELP, XCAR (item));
7848 start = item; 7848 start = item;
7849 item = XCDR (item); 7849 item = XCDR (item);
7850 } 7850 }
@@ -7859,27 +7859,27 @@ parse_menu_item (item, notreal, inmenubar)
7859 } 7859 }
7860 7860
7861 /* This is the real definition--the function to run. */ 7861 /* This is the real definition--the function to run. */
7862 AREF (item_properties, ITEM_PROPERTY_DEF) = item; 7862 ASET (item_properties, ITEM_PROPERTY_DEF, item);
7863 7863
7864 /* Get enable property, if any. */ 7864 /* Get enable property, if any. */
7865 if (SYMBOLP (item)) 7865 if (SYMBOLP (item))
7866 { 7866 {
7867 tem = Fget (item, Qmenu_enable); 7867 tem = Fget (item, Qmenu_enable);
7868 if (!NILP (Venable_disabled_menus_and_buttons)) 7868 if (!NILP (Venable_disabled_menus_and_buttons))
7869 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt; 7869 ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
7870 else if (!NILP (tem)) 7870 else if (!NILP (tem))
7871 AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem; 7871 ASET (item_properties, ITEM_PROPERTY_ENABLE, tem);
7872 } 7872 }
7873 } 7873 }
7874 else if (EQ (item_string, Qmenu_item) && CONSP (item)) 7874 else if (EQ (item_string, Qmenu_item) && CONSP (item))
7875 { 7875 {
7876 /* New format menu item. */ 7876 /* New format menu item. */
7877 AREF (item_properties, ITEM_PROPERTY_NAME) = XCAR (item); 7877 ASET (item_properties, ITEM_PROPERTY_NAME, XCAR (item));
7878 start = XCDR (item); 7878 start = XCDR (item);
7879 if (CONSP (start)) 7879 if (CONSP (start))
7880 { 7880 {
7881 /* We have a real binding. */ 7881 /* We have a real binding. */
7882 AREF (item_properties, ITEM_PROPERTY_DEF) = XCAR (start); 7882 ASET (item_properties, ITEM_PROPERTY_DEF, XCAR (start));
7883 7883
7884 item = XCDR (start); 7884 item = XCDR (start);
7885 /* Is there a cache list with key equivalences. */ 7885 /* Is there a cache list with key equivalences. */
@@ -7898,9 +7898,9 @@ parse_menu_item (item, notreal, inmenubar)
7898 if (EQ (tem, QCenable)) 7898 if (EQ (tem, QCenable))
7899 { 7899 {
7900 if (!NILP (Venable_disabled_menus_and_buttons)) 7900 if (!NILP (Venable_disabled_menus_and_buttons))
7901 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt; 7901 ASET (item_properties, ITEM_PROPERTY_ENABLE, Qt);
7902 else 7902 else
7903 AREF (item_properties, ITEM_PROPERTY_ENABLE) = XCAR (item); 7903 ASET (item_properties, ITEM_PROPERTY_ENABLE, XCAR (item));
7904 } 7904 }
7905 else if (EQ (tem, QCvisible) && !notreal) 7905 else if (EQ (tem, QCvisible) && !notreal)
7906 { 7906 {
@@ -7911,7 +7911,7 @@ parse_menu_item (item, notreal, inmenubar)
7911 return 0; 7911 return 0;
7912 } 7912 }
7913 else if (EQ (tem, QChelp)) 7913 else if (EQ (tem, QChelp))
7914 AREF (item_properties, ITEM_PROPERTY_HELP) = XCAR (item); 7914 ASET (item_properties, ITEM_PROPERTY_HELP, XCAR (item));
7915 else if (EQ (tem, QCfilter)) 7915 else if (EQ (tem, QCfilter))
7916 filter = item; 7916 filter = item;
7917 else if (EQ (tem, QCkey_sequence)) 7917 else if (EQ (tem, QCkey_sequence))
@@ -7926,7 +7926,7 @@ parse_menu_item (item, notreal, inmenubar)
7926 { 7926 {
7927 tem = XCAR (item); 7927 tem = XCAR (item);
7928 if (CONSP (tem) || (STRINGP (tem) && NILP (cachelist))) 7928 if (CONSP (tem) || (STRINGP (tem) && NILP (cachelist)))
7929 AREF (item_properties, ITEM_PROPERTY_KEYEQ) = tem; 7929 ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
7930 } 7930 }
7931 else if (EQ (tem, QCbutton) && CONSP (XCAR (item))) 7931 else if (EQ (tem, QCbutton) && CONSP (XCAR (item)))
7932 { 7932 {
@@ -7935,10 +7935,9 @@ parse_menu_item (item, notreal, inmenubar)
7935 type = XCAR (tem); 7935 type = XCAR (tem);
7936 if (EQ (type, QCtoggle) || EQ (type, QCradio)) 7936 if (EQ (type, QCtoggle) || EQ (type, QCradio))
7937 { 7937 {
7938 AREF (item_properties, ITEM_PROPERTY_SELECTED) 7938 ASET (item_properties, ITEM_PROPERTY_SELECTED,
7939 = XCDR (tem); 7939 XCDR (tem));
7940 AREF (item_properties, ITEM_PROPERTY_TYPE) 7940 ASET (item_properties, ITEM_PROPERTY_TYPE, type);
7941 = type;
7942 } 7941 }
7943 } 7942 }
7944 item = XCDR (item); 7943 item = XCDR (item);
@@ -7958,7 +7957,7 @@ parse_menu_item (item, notreal, inmenubar)
7958 item_string = menu_item_eval_property (item_string); 7957 item_string = menu_item_eval_property (item_string);
7959 if (!STRINGP (item_string)) 7958 if (!STRINGP (item_string))
7960 return 0; 7959 return 0;
7961 AREF (item_properties, ITEM_PROPERTY_NAME) = item_string; 7960 ASET (item_properties, ITEM_PROPERTY_NAME, item_string);
7962 } 7961 }
7963 7962
7964 /* If got a filter apply it on definition. */ 7963 /* If got a filter apply it on definition. */
@@ -7968,7 +7967,7 @@ parse_menu_item (item, notreal, inmenubar)
7968 def = menu_item_eval_property (list2 (XCAR (filter), 7967 def = menu_item_eval_property (list2 (XCAR (filter),
7969 list2 (Qquote, def))); 7968 list2 (Qquote, def)));
7970 7969
7971 AREF (item_properties, ITEM_PROPERTY_DEF) = def; 7970 ASET (item_properties, ITEM_PROPERTY_DEF, def);
7972 } 7971 }
7973 7972
7974 /* Enable or disable selection of item. */ 7973 /* Enable or disable selection of item. */
@@ -7981,7 +7980,7 @@ parse_menu_item (item, notreal, inmenubar)
7981 tem = menu_item_eval_property (tem); 7980 tem = menu_item_eval_property (tem);
7982 if (inmenubar && NILP (tem)) 7981 if (inmenubar && NILP (tem))
7983 return 0; /* Ignore disabled items in menu bar. */ 7982 return 0; /* Ignore disabled items in menu bar. */
7984 AREF (item_properties, ITEM_PROPERTY_ENABLE) = tem; 7983 ASET (item_properties, ITEM_PROPERTY_ENABLE, tem);
7985 } 7984 }
7986 7985
7987 /* If we got no definition, this item is just unselectable text which 7986 /* If we got no definition, this item is just unselectable text which
@@ -7995,8 +7994,8 @@ parse_menu_item (item, notreal, inmenubar)
7995 /* For a subkeymap, just record its details and exit. */ 7994 /* For a subkeymap, just record its details and exit. */
7996 if (CONSP (tem)) 7995 if (CONSP (tem))
7997 { 7996 {
7998 AREF (item_properties, ITEM_PROPERTY_MAP) = tem; 7997 ASET (item_properties, ITEM_PROPERTY_MAP, tem);
7999 AREF (item_properties, ITEM_PROPERTY_DEF) = tem; 7998 ASET (item_properties, ITEM_PROPERTY_DEF, tem);
8000 return 1; 7999 return 1;
8001 } 8000 }
8002 8001
@@ -8120,7 +8119,7 @@ parse_menu_item (item, notreal, inmenubar)
8120 return 1; 8119 return 1;
8121 8120
8122 /* If we have an equivalent key binding, use that. */ 8121 /* If we have an equivalent key binding, use that. */
8123 AREF (item_properties, ITEM_PROPERTY_KEYEQ) = tem; 8122 ASET (item_properties, ITEM_PROPERTY_KEYEQ, tem);
8124 8123
8125 /* Include this when menu help is implemented. 8124 /* Include this when menu help is implemented.
8126 tem = XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP]; 8125 tem = XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP];
@@ -8136,8 +8135,8 @@ parse_menu_item (item, notreal, inmenubar)
8136 /* Handle radio buttons or toggle boxes. */ 8135 /* Handle radio buttons or toggle boxes. */
8137 tem = AREF (item_properties, ITEM_PROPERTY_SELECTED); 8136 tem = AREF (item_properties, ITEM_PROPERTY_SELECTED);
8138 if (!NILP (tem)) 8137 if (!NILP (tem))
8139 AREF (item_properties, ITEM_PROPERTY_SELECTED) 8138 ASET (item_properties, ITEM_PROPERTY_SELECTED,
8140 = menu_item_eval_property (tem); 8139 menu_item_eval_property (tem));
8141 8140
8142 return 1; 8141 return 1;
8143} 8142}