aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.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/data.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/data.c')
-rw-r--r--src/data.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/data.c b/src/data.c
index 5b8e01e2950..2d6d4c7c22b 100644
--- a/src/data.c
+++ b/src/data.c
@@ -988,8 +988,9 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong)
988 for (obj = choice; !NILP (obj); obj = XCDR (obj)) 988 for (obj = choice; !NILP (obj); obj = XCDR (obj))
989 { 989 {
990 args[i++] = SYMBOL_NAME (XCAR (obj)); 990 args[i++] = SYMBOL_NAME (XCAR (obj));
991 args[i++] = build_string (NILP (XCDR (obj)) ? " should be specified" 991 args[i++] = build_local_string
992 : (NILP (XCDR (XCDR (obj))) ? " or " : ", ")); 992 (NILP (XCDR (obj)) ? " should be specified"
993 : (NILP (XCDR (XCDR (obj))) ? " or " : ", "));
993 } 994 }
994 995
995 obj = Fconcat (i, args); 996 obj = Fconcat (i, args);
@@ -1003,14 +1004,11 @@ wrong_choice (Lisp_Object choice, Lisp_Object wrong)
1003static void 1004static void
1004wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) 1005wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong)
1005{ 1006{
1006 Lisp_Object args[4]; 1007 xsignal2 (Qerror, Fconcat (4, ((Lisp_Object [])
1007 1008 { build_local_string ("Value should be from "),
1008 args[0] = build_string ("Value should be from "); 1009 Fnumber_to_string (min),
1009 args[1] = Fnumber_to_string (min); 1010 build_local_string (" to "),
1010 args[2] = build_string (" to "); 1011 Fnumber_to_string (max) })), wrong);
1011 args[3] = Fnumber_to_string (max);
1012
1013 xsignal2 (Qerror, Fconcat (4, args), wrong);
1014} 1012}
1015 1013
1016/* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell 1014/* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell