diff options
| author | Dmitry Antipov | 2014-09-15 18:53:23 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-09-15 18:53:23 +0400 |
| commit | edb0288b83b45d295df52ce7644e897613358971 (patch) | |
| tree | 8f169c257e9752ca860764cc19ec232d287eb189 /src/menu.c | |
| parent | 497daa12743ed71a70e41f966631d1c8856248cc (diff) | |
| download | emacs-edb0288b83b45d295df52ce7644e897613358971.tar.gz emacs-edb0288b83b45d295df52ce7644e897613358971.zip | |
If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.
* lisp.h (local_cons, local_list1, local_list2, local_list3)
[USE_LOCAL_ALLOCATORS]: New macros.
[!USE_LOCAL_ALLOCATORS]: Fall back to regular functions.
(build_local_string): Avoid argument name expansion clash with
make_local_string.
* alloc.c (toplevel)
[USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]:
Preprocessor guard to avoid impossible configuration.
* charset.c (Ffind_charset_region, Ffind_charset_string):
Use make_local_vector.
* lread.c (read1, substitute_object_recurse): Use scoped_cons.
* textprop.c (Fput_text_property, Fadd_face_text_property):
Use scoped_list2.
(copy_text_properties): Use local_cons and local_list3.
* chartab.c (uniprop_table):
* data.c (wrong_choice, wrong_range):
* doc.c (get_doc_string):
* editfns.c (format2):
* fileio.c (Fexpand_file_name, auto_save_error):
* fns.c (Fyes_or_no_p):
* font.c (font_parse_xlfd, font_parse_family_registry, font_add_log):
* fontset.c (Fset_fontset_font):
* keyboard.c (echo_add_key, echo_dash, parse_menu_item)
(read_char_minibuf_menu_prompt):
* keymap.c (silly_event_symbol_error, describe_vector):
* menu.c (single_menu_item):
* minibuf.c (Fread_buffer):
* process.c (status_message, Fformat_network_address)
(server_accept_connection): Use make_local_string and
build_local_string. Prefer compound literals where appropriate.
Diffstat (limited to 'src/menu.c')
| -rw-r--r-- | src/menu.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/menu.c b/src/menu.c index 8c624f758a9..ea8da7a9d62 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -390,7 +390,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk | |||
| 390 | if (!submenu && SREF (tem, 0) != '\0' | 390 | if (!submenu && SREF (tem, 0) != '\0' |
| 391 | && SREF (tem, 0) != '-') | 391 | && SREF (tem, 0) != '-') |
| 392 | ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, | 392 | ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, |
| 393 | concat2 (build_string (" "), tem)); | 393 | concat2 (build_local_string (" "), tem)); |
| 394 | idx += MENU_ITEMS_ITEM_LENGTH; | 394 | idx += MENU_ITEMS_ITEM_LENGTH; |
| 395 | } | 395 | } |
| 396 | } | 396 | } |
| @@ -399,14 +399,14 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk | |||
| 399 | 399 | ||
| 400 | /* Calculate prefix, if any, for this item. */ | 400 | /* Calculate prefix, if any, for this item. */ |
| 401 | if (EQ (type, QCtoggle)) | 401 | if (EQ (type, QCtoggle)) |
| 402 | prefix = build_string (NILP (selected) ? "[ ] " : "[X] "); | 402 | prefix = build_local_string (NILP (selected) ? "[ ] " : "[X] "); |
| 403 | else if (EQ (type, QCradio)) | 403 | else if (EQ (type, QCradio)) |
| 404 | prefix = build_string (NILP (selected) ? "( ) " : "(*) "); | 404 | prefix = build_local_string (NILP (selected) ? "( ) " : "(*) "); |
| 405 | } | 405 | } |
| 406 | /* Not a button. If we have earlier buttons, then we need a prefix. */ | 406 | /* Not a button. If we have earlier buttons, then we need a prefix. */ |
| 407 | else if (!skp->notbuttons && SREF (item_string, 0) != '\0' | 407 | else if (!skp->notbuttons && SREF (item_string, 0) != '\0' |
| 408 | && SREF (item_string, 0) != '-') | 408 | && SREF (item_string, 0) != '-') |
| 409 | prefix = build_string (" "); | 409 | prefix = build_local_string (" "); |
| 410 | 410 | ||
| 411 | if (!NILP (prefix)) | 411 | if (!NILP (prefix)) |
| 412 | item_string = concat2 (prefix, item_string); | 412 | item_string = concat2 (prefix, item_string); |
| @@ -416,7 +416,7 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk | |||
| 416 | || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) | 416 | || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) |
| 417 | && !NILP (map)) | 417 | && !NILP (map)) |
| 418 | /* Indicate visually that this is a submenu. */ | 418 | /* Indicate visually that this is a submenu. */ |
| 419 | item_string = concat2 (item_string, build_string (" >")); | 419 | item_string = concat2 (item_string, build_local_string (" >")); |
| 420 | 420 | ||
| 421 | push_menu_item (item_string, enabled, key, | 421 | push_menu_item (item_string, enabled, key, |
| 422 | AREF (item_properties, ITEM_PROPERTY_DEF), | 422 | AREF (item_properties, ITEM_PROPERTY_DEF), |