Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
b1ebcadb
Commit
b1ebcadb
authored
Feb 08, 2008
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(add_command_key, parse_menu_item): Use ASET.
parent
ff7a2223
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
27 deletions
+28
-27
src/ChangeLog
src/ChangeLog
+2
-0
src/keyboard.c
src/keyboard.c
+26
-27
No files found.
src/ChangeLog
View file @
b1ebcadb
2008-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
* keyboard.c (add_command_key, parse_menu_item): Use ASET.
* fontset.c (free_face_fontset): Use FONTSET_FROM_ID.
(syms_of_fontset): Use ASET.
...
...
src/keyboard.c
View file @
b1ebcadb
...
...
@@ -918,7 +918,7 @@ add_command_key (key)
2 * ASIZE (this_command_keys),
Qnil);
A
REF
(this_command_keys, this_command_key_count
) =
key;
A
SET
(this_command_keys, this_command_key_count
,
key
)
;
++this_command_key_count;
}
...
...
@@ -7826,11 +7826,11 @@ parse_menu_item (item, notreal, inmenubar)
/* Initialize optional entries. */
for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++)
A
REF
(item_properties, i
) =
Qnil;
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
Qt;
A
SET
(item_properties, i
,
Qnil
)
;
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
Qt
)
;
/* Save the item here to protect it from GC. */
A
REF
(item_properties, ITEM_PROPERTY_ITEM
) =
item;
A
SET
(item_properties, ITEM_PROPERTY_ITEM
,
item
)
;
item_string = XCAR (item);
...
...
@@ -7839,12 +7839,12 @@ parse_menu_item (item, notreal, inmenubar)
if (STRINGP (item_string))
{
/* Old format menu item. */
A
REF
(item_properties, ITEM_PROPERTY_NAME
) =
item_string;
A
SET
(item_properties, ITEM_PROPERTY_NAME
,
item_string
)
;
/* Maybe help string. */
if (CONSP (item) && STRINGP (XCAR (item)))
{
A
REF
(item_properties, ITEM_PROPERTY_HELP
) =
XCAR (item);
A
SET
(item_properties, ITEM_PROPERTY_HELP
,
XCAR (item)
)
;
start = item;
item = XCDR (item);
}
...
...
@@ -7859,27 +7859,27 @@ parse_menu_item (item, notreal, inmenubar)
}
/* This is the real definition--the function to run. */
A
REF
(item_properties, ITEM_PROPERTY_DEF
) =
item;
A
SET
(item_properties, ITEM_PROPERTY_DEF
,
item
)
;
/* Get enable property, if any. */
if (SYMBOLP (item))
{
tem = Fget (item, Qmenu_enable);
if (!NILP (Venable_disabled_menus_and_buttons))
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
Qt;
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
Qt
)
;
else if (!NILP (tem))
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
tem;
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
tem
)
;
}
}
else if (EQ (item_string, Qmenu_item) && CONSP (item))
{
/* New format menu item. */
A
REF
(item_properties, ITEM_PROPERTY_NAME
) =
XCAR (item);
A
SET
(item_properties, ITEM_PROPERTY_NAME
,
XCAR (item)
)
;
start = XCDR (item);
if (CONSP (start))
{
/* We have a real binding. */
A
REF
(item_properties, ITEM_PROPERTY_DEF
) =
XCAR (start);
A
SET
(item_properties, ITEM_PROPERTY_DEF
,
XCAR (start)
)
;
item = XCDR (start);
/* Is there a cache list with key equivalences. */
...
...
@@ -7898,9 +7898,9 @@ parse_menu_item (item, notreal, inmenubar)
if (EQ (tem, QCenable))
{
if (!NILP (Venable_disabled_menus_and_buttons))
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
Qt;
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
Qt
)
;
else
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
XCAR (item);
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
XCAR (item)
)
;
}
else if (EQ (tem, QCvisible) && !notreal)
{
...
...
@@ -7911,7 +7911,7 @@ parse_menu_item (item, notreal, inmenubar)
return 0;
}
else if (EQ (tem, QChelp))
A
REF
(item_properties, ITEM_PROPERTY_HELP
) =
XCAR (item);
A
SET
(item_properties, ITEM_PROPERTY_HELP
,
XCAR (item)
)
;
else if (EQ (tem, QCfilter))
filter = item;
else if (EQ (tem, QCkey_sequence))
...
...
@@ -7926,7 +7926,7 @@ parse_menu_item (item, notreal, inmenubar)
{
tem = XCAR (item);
if (CONSP (tem) || (STRINGP (tem) && NILP (cachelist)))
A
REF
(item_properties, ITEM_PROPERTY_KEYEQ
) =
tem;
A
SET
(item_properties, ITEM_PROPERTY_KEYEQ
,
tem
)
;
}
else if (EQ (tem, QCbutton) && CONSP (XCAR (item)))
{
...
...
@@ -7935,10 +7935,9 @@ parse_menu_item (item, notreal, inmenubar)
type = XCAR (tem);
if (EQ (type, QCtoggle) || EQ (type, QCradio))
{
AREF (item_properties, ITEM_PROPERTY_SELECTED)
= XCDR (tem);
AREF (item_properties, ITEM_PROPERTY_TYPE)
= type;
ASET (item_properties, ITEM_PROPERTY_SELECTED,
XCDR (tem));
ASET (item_properties, ITEM_PROPERTY_TYPE, type);
}
}
item = XCDR (item);
...
...
@@ -7958,7 +7957,7 @@ parse_menu_item (item, notreal, inmenubar)
item_string = menu_item_eval_property (item_string);
if (!STRINGP (item_string))
return 0;
A
REF
(item_properties, ITEM_PROPERTY_NAME
) =
item_string;
A
SET
(item_properties, ITEM_PROPERTY_NAME
,
item_string
)
;
}
/* If got a filter apply it on definition. */
...
...
@@ -7968,7 +7967,7 @@ parse_menu_item (item, notreal, inmenubar)
def = menu_item_eval_property (list2 (XCAR (filter),
list2 (Qquote, def)));
A
REF
(item_properties, ITEM_PROPERTY_DEF
) =
def;
A
SET
(item_properties, ITEM_PROPERTY_DEF
,
def
)
;
}
/* Enable or disable selection of item. */
...
...
@@ -7981,7 +7980,7 @@ parse_menu_item (item, notreal, inmenubar)
tem = menu_item_eval_property (tem);
if (inmenubar && NILP (tem))
return 0; /* Ignore disabled items in menu bar. */
A
REF
(item_properties, ITEM_PROPERTY_ENABLE
) =
tem;
A
SET
(item_properties, ITEM_PROPERTY_ENABLE
,
tem
)
;
}
/* If we got no definition, this item is just unselectable text which
...
...
@@ -7995,8 +7994,8 @@ parse_menu_item (item, notreal, inmenubar)
/* For a subkeymap, just record its details and exit. */
if (CONSP (tem))
{
A
REF
(item_properties, ITEM_PROPERTY_MAP
) =
tem;
A
REF
(item_properties, ITEM_PROPERTY_DEF
) =
tem;
A
SET
(item_properties, ITEM_PROPERTY_MAP
,
tem
)
;
A
SET
(item_properties, ITEM_PROPERTY_DEF
,
tem
)
;
return 1;
}
...
...
@@ -8120,7 +8119,7 @@ parse_menu_item (item, notreal, inmenubar)
return 1;
/* If we have an equivalent key binding, use that. */
A
REF
(item_properties, ITEM_PROPERTY_KEYEQ
) =
tem;
A
SET
(item_properties, ITEM_PROPERTY_KEYEQ
,
tem
)
;
/* Include this when menu help is implemented.
tem = XVECTOR (item_properties)->contents[ITEM_PROPERTY_HELP];
...
...
@@ -8136,8 +8135,8 @@ parse_menu_item (item, notreal, inmenubar)
/* Handle radio buttons or toggle boxes. */
tem = AREF (item_properties, ITEM_PROPERTY_SELECTED);
if (!NILP (tem))
A
REF
(item_properties, ITEM_PROPERTY_SELECTED
)
=
menu_item_eval_property (tem);
A
SET
(item_properties, ITEM_PROPERTY_SELECTED
,
menu_item_eval_property (tem)
)
;
return 1;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment