aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorDmitry Antipov2014-09-15 18:53:23 +0400
committerDmitry Antipov2014-09-15 18:53:23 +0400
commitedb0288b83b45d295df52ce7644e897613358971 (patch)
tree8f169c257e9752ca860764cc19ec232d287eb189 /src/keyboard.c
parent497daa12743ed71a70e41f966631d1c8856248cc (diff)
downloademacs-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/keyboard.c')
-rw-r--r--src/keyboard.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index c435ba74faa..a114aa27626 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -566,14 +566,14 @@ echo_add_key (Lisp_Object c)
566 if (XINT (last_char) == '-' && XINT (prev_char) != ' ') 566 if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
567 Faset (echo_string, idx, make_number (' ')); 567 Faset (echo_string, idx, make_number (' '));
568 else 568 else
569 echo_string = concat2 (echo_string, build_string (" ")); 569 echo_string = concat2 (echo_string, build_local_string (" "));
570 } 570 }
571 else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) 571 else if (STRINGP (echo_string) && SCHARS (echo_string) > 0)
572 echo_string = concat2 (echo_string, build_string (" ")); 572 echo_string = concat2 (echo_string, build_local_string (" "));
573 573
574 kset_echo_string 574 kset_echo_string
575 (current_kboard, 575 (current_kboard,
576 concat2 (echo_string, make_string (buffer, ptr - buffer))); 576 concat2 (echo_string, make_local_string (buffer, ptr - buffer)));
577 SAFE_FREE (); 577 SAFE_FREE ();
578} 578}
579 579
@@ -632,7 +632,7 @@ echo_dash (void)
632 but make it go away when the next character is added. */ 632 but make it go away when the next character is added. */
633 kset_echo_string 633 kset_echo_string
634 (current_kboard, 634 (current_kboard,
635 concat2 (KVAR (current_kboard, echo_string), build_string ("-"))); 635 concat2 (KVAR (current_kboard, echo_string), build_local_string ("-")));
636 echo_now (); 636 echo_now ();
637} 637}
638 638
@@ -7883,7 +7883,8 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7883 /* The previous code preferred :key-sequence to :keys, so we 7883 /* The previous code preferred :key-sequence to :keys, so we
7884 preserve this behavior. */ 7884 preserve this behavior. */
7885 if (STRINGP (keyeq) && !CONSP (keyhint)) 7885 if (STRINGP (keyeq) && !CONSP (keyhint))
7886 keyeq = concat2 (build_string (" "), Fsubstitute_command_keys (keyeq)); 7886 keyeq = concat2 (build_local_string (" "),
7887 Fsubstitute_command_keys (keyeq));
7887 else 7888 else
7888 { 7889 {
7889 Lisp_Object prefix = keyeq; 7890 Lisp_Object prefix = keyeq;
@@ -7926,8 +7927,7 @@ parse_menu_item (Lisp_Object item, int inmenubar)
7926 if (STRINGP (XCDR (prefix))) 7927 if (STRINGP (XCDR (prefix)))
7927 tem = concat2 (tem, XCDR (prefix)); 7928 tem = concat2 (tem, XCDR (prefix));
7928 } 7929 }
7929 keyeq = concat2 (build_string (" "), tem); 7930 keyeq = concat2 (build_local_string (" "), tem);
7930 /* keyeq = concat3(build_string(" ("),tem,build_string(")")); */
7931 } 7931 }
7932 else 7932 else
7933 keyeq = Qnil; 7933 keyeq = Qnil;
@@ -8632,9 +8632,9 @@ read_char_minibuf_menu_prompt (int commandflag,
8632 Lisp_Object selected 8632 Lisp_Object selected
8633 = AREF (item_properties, ITEM_PROPERTY_SELECTED); 8633 = AREF (item_properties, ITEM_PROPERTY_SELECTED);
8634 if (EQ (tem, QCradio)) 8634 if (EQ (tem, QCradio))
8635 tem = build_string (NILP (selected) ? "(*) " : "( ) "); 8635 tem = build_local_string (NILP (selected) ? "(*) " : "( ) ");
8636 else 8636 else
8637 tem = build_string (NILP (selected) ? "[X] " : "[ ] "); 8637 tem = build_local_string (NILP (selected) ? "[X] " : "[ ] ");
8638 s = concat2 (tem, s); 8638 s = concat2 (tem, s);
8639 } 8639 }
8640 8640