aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/ChangeLog34
-rw-r--r--src/alloc.c6
-rw-r--r--src/charset.c4
-rw-r--r--src/chartab.c2
-rw-r--r--src/data.c18
-rw-r--r--src/doc.c4
-rw-r--r--src/editfns.c7
-rw-r--r--src/fileio.c20
-rw-r--r--src/fns.c7
-rw-r--r--src/font.c14
-rw-r--r--src/fontset.c2
-rw-r--r--src/keyboard.c18
-rw-r--r--src/keymap.c6
-rw-r--r--src/lisp.h23
-rw-r--r--src/lread.c8
-rw-r--r--src/menu.c10
-rw-r--r--src/minibuf.c18
-rw-r--r--src/process.c71
-rw-r--r--src/textprop.c21
19 files changed, 164 insertions, 129 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5dc1d912caf..185a6c4bd40 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,37 @@
12014-09-15 Dmitry Antipov <dmantipov@yandex.ru>
2
3 If USE_LOCAL_ALLOCATORS, allocate some Lisp objects on stack.
4 * lisp.h (local_cons, local_list1, local_list2, local_list3)
5 [USE_LOCAL_ALLOCATORS]: New macros.
6 [!USE_LOCAL_ALLOCATORS]: Fall back to regular functions.
7 (build_local_string): Avoid argument name expansion clash with
8 make_local_string.
9 * alloc.c (toplevel)
10 [USE_LOCAL_ALLOCATORS && GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS]:
11 Preprocessor guard to avoid impossible configuration.
12 * charset.c (Ffind_charset_region, Ffind_charset_string):
13 Use make_local_vector.
14 * lread.c (read1, substitute_object_recurse): Use scoped_cons.
15 * textprop.c (Fput_text_property, Fadd_face_text_property):
16 Use scoped_list2.
17 (copy_text_properties): Use local_cons and local_list3.
18 * chartab.c (uniprop_table):
19 * data.c (wrong_choice, wrong_range):
20 * doc.c (get_doc_string):
21 * editfns.c (format2):
22 * fileio.c (Fexpand_file_name, auto_save_error):
23 * fns.c (Fyes_or_no_p):
24 * font.c (font_parse_xlfd, font_parse_family_registry, font_add_log):
25 * fontset.c (Fset_fontset_font):
26 * keyboard.c (echo_add_key, echo_dash, parse_menu_item)
27 (read_char_minibuf_menu_prompt):
28 * keymap.c (silly_event_symbol_error, describe_vector):
29 * menu.c (single_menu_item):
30 * minibuf.c (Fread_buffer):
31 * process.c (status_message, Fformat_network_address)
32 (server_accept_connection): Use make_local_string and
33 build_local_string. Prefer compound literals where appropriate.
34
12014-09-15 Daniel Colascione <dancol@dancol.org> 352014-09-15 Daniel Colascione <dancol@dancol.org>
2 36
3 * fns.c (Fsort): Tweak sort docstring. 37 * fns.c (Fsort): Tweak sort docstring.
diff --git a/src/alloc.c b/src/alloc.c
index a0725efef07..aa5849fee48 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -69,6 +69,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
69static bool valgrind_p; 69static bool valgrind_p;
70#endif 70#endif
71 71
72#ifdef USE_LOCAL_ALLOCATORS
73# if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS
74# error "Stack-allocated Lisp objects are not compatible with GCPROs"
75# endif
76#endif
77
72/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects. 78/* GC_CHECK_MARKED_OBJECTS means do sanity checks on allocated objects.
73 Doable only if GC_MARK_STACK. */ 79 Doable only if GC_MARK_STACK. */
74#if ! GC_MARK_STACK 80#if ! GC_MARK_STACK
diff --git a/src/charset.c b/src/charset.c
index f987ab67ce9..a7bae9d7b01 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1569,7 +1569,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
1569 1569
1570 from_byte = CHAR_TO_BYTE (from); 1570 from_byte = CHAR_TO_BYTE (from);
1571 1571
1572 charsets = Fmake_vector (make_number (charset_table_used), Qnil); 1572 charsets = make_local_vector (charset_table_used, Qnil);
1573 while (1) 1573 while (1)
1574 { 1574 {
1575 find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from, 1575 find_charsets_in_text (BYTE_POS_ADDR (from_byte), stop - from,
@@ -1606,7 +1606,7 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */)
1606 1606
1607 CHECK_STRING (str); 1607 CHECK_STRING (str);
1608 1608
1609 charsets = Fmake_vector (make_number (charset_table_used), Qnil); 1609 charsets = make_local_vector (charset_table_used, Qnil);
1610 find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str), 1610 find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str),
1611 charsets, table, 1611 charsets, table,
1612 STRING_MULTIBYTE (str)); 1612 STRING_MULTIBYTE (str));
diff --git a/src/chartab.c b/src/chartab.c
index 50be063759a..50f76fcf57b 100644
--- a/src/chartab.c
+++ b/src/chartab.c
@@ -1307,7 +1307,7 @@ uniprop_table (Lisp_Object prop)
1307 { 1307 {
1308 struct gcpro gcpro1; 1308 struct gcpro gcpro1;
1309 GCPRO1 (val); 1309 GCPRO1 (val);
1310 result = Fload (concat2 (build_string ("international/"), table), 1310 result = Fload (concat2 (build_local_string ("international/"), table),
1311 Qt, Qt, Qt, Qt); 1311 Qt, Qt, Qt, Qt);
1312 UNGCPRO; 1312 UNGCPRO;
1313 if (NILP (result)) 1313 if (NILP (result))
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
diff --git a/src/doc.c b/src/doc.c
index be882d4a5c7..98f2f8563a1 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -146,8 +146,8 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition)
146 if (fd < 0) 146 if (fd < 0)
147 { 147 {
148 SAFE_FREE (); 148 SAFE_FREE ();
149 return concat3 (build_string ("Cannot open doc string file \""), 149 return concat3 (build_local_string ("Cannot open doc string file \""),
150 file, build_string ("\"\n")); 150 file, build_local_string ("\"\n"));
151 } 151 }
152 } 152 }
153 count = SPECPDL_INDEX (); 153 count = SPECPDL_INDEX ();
diff --git a/src/editfns.c b/src/editfns.c
index 7e9a3bf7d3c..47779914c45 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -4362,11 +4362,8 @@ usage: (format STRING &rest OBJECTS) */)
4362Lisp_Object 4362Lisp_Object
4363format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) 4363format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
4364{ 4364{
4365 Lisp_Object args[3]; 4365 return Fformat (3, ((Lisp_Object [])
4366 args[0] = build_string (string1); 4366 { build_local_string (string1), arg0, arg1 }));
4367 args[1] = arg0;
4368 args[2] = arg1;
4369 return Fformat (3, args);
4370} 4367}
4371 4368
4372DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, 4369DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,
diff --git a/src/fileio.c b/src/fileio.c
index 0626bd3653a..0b508eae197 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1162,11 +1162,11 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1162 char newdir_utf8[MAX_UTF8_PATH]; 1162 char newdir_utf8[MAX_UTF8_PATH];
1163 1163
1164 filename_from_ansi (newdir, newdir_utf8); 1164 filename_from_ansi (newdir, newdir_utf8);
1165 tem = build_string (newdir_utf8); 1165 tem = build_local_string (newdir_utf8);
1166 } 1166 }
1167 else 1167 else
1168#endif 1168#endif
1169 tem = build_string (newdir); 1169 tem = build_local_string (newdir);
1170 newdirlim = newdir + SBYTES (tem); 1170 newdirlim = newdir + SBYTES (tem);
1171 if (multibyte && !STRING_MULTIBYTE (tem)) 1171 if (multibyte && !STRING_MULTIBYTE (tem))
1172 { 1172 {
@@ -1198,7 +1198,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1198 /* `getpwnam' may return a unibyte string, which will 1198 /* `getpwnam' may return a unibyte string, which will
1199 bite us since we expect the directory to be 1199 bite us since we expect the directory to be
1200 multibyte. */ 1200 multibyte. */
1201 tem = build_string (newdir); 1201 tem = build_local_string (newdir);
1202 newdirlim = newdir + SBYTES (tem); 1202 newdirlim = newdir + SBYTES (tem);
1203 if (multibyte && !STRING_MULTIBYTE (tem)) 1203 if (multibyte && !STRING_MULTIBYTE (tem))
1204 { 1204 {
@@ -1231,7 +1231,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1231 adir = NULL; 1231 adir = NULL;
1232 else if (multibyte) 1232 else if (multibyte)
1233 { 1233 {
1234 Lisp_Object tem = build_string (adir); 1234 Lisp_Object tem = build_local_string (adir);
1235 1235
1236 tem = DECODE_FILE (tem); 1236 tem = DECODE_FILE (tem);
1237 newdirlim = adir + SBYTES (tem); 1237 newdirlim = adir + SBYTES (tem);
@@ -1332,7 +1332,7 @@ filesystem tree, not (expand-file-name ".." dirname). */)
1332 getcwd (adir, adir_size); 1332 getcwd (adir, adir_size);
1333 if (multibyte) 1333 if (multibyte)
1334 { 1334 {
1335 Lisp_Object tem = build_string (adir); 1335 Lisp_Object tem = build_local_string (adir);
1336 1336
1337 tem = DECODE_FILE (tem); 1337 tem = DECODE_FILE (tem);
1338 newdirlim = adir + SBYTES (tem); 1338 newdirlim = adir + SBYTES (tem);
@@ -5408,7 +5408,7 @@ An argument specifies the modification time value to use
5408static Lisp_Object 5408static Lisp_Object
5409auto_save_error (Lisp_Object error_val) 5409auto_save_error (Lisp_Object error_val)
5410{ 5410{
5411 Lisp_Object args[3], msg; 5411 Lisp_Object msg;
5412 int i; 5412 int i;
5413 struct gcpro gcpro1; 5413 struct gcpro gcpro1;
5414 5414
@@ -5416,10 +5416,10 @@ auto_save_error (Lisp_Object error_val)
5416 5416
5417 ring_bell (XFRAME (selected_frame)); 5417 ring_bell (XFRAME (selected_frame));
5418 5418
5419 args[0] = build_string ("Auto-saving %s: %s"); 5419 msg = Fformat (3, ((Lisp_Object [])
5420 args[1] = BVAR (current_buffer, name); 5420 { build_local_string ("Auto-saving %s: %s"),
5421 args[2] = Ferror_message_string (error_val); 5421 BVAR (current_buffer, name),
5422 msg = Fformat (3, args); 5422 Ferror_message_string (error_val) }));
5423 GCPRO1 (msg); 5423 GCPRO1 (msg);
5424 5424
5425 for (i = 0; i < 3; ++i) 5425 for (i = 0; i < 3; ++i)
diff --git a/src/fns.c b/src/fns.c
index bbff9b6d554..9f56a8f01f5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2706,7 +2706,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
2706 (Lisp_Object prompt) 2706 (Lisp_Object prompt)
2707{ 2707{
2708 register Lisp_Object ans; 2708 register Lisp_Object ans;
2709 Lisp_Object args[2];
2710 struct gcpro gcpro1; 2709 struct gcpro gcpro1;
2711 2710
2712 CHECK_STRING (prompt); 2711 CHECK_STRING (prompt);
@@ -2725,10 +2724,8 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil. */)
2725 return obj; 2724 return obj;
2726 } 2725 }
2727 2726
2728 args[0] = prompt; 2727 prompt = Fconcat (2, ((Lisp_Object [])
2729 args[1] = build_string ("(yes or no) "); 2728 { prompt, build_local_string ("(yes or no) ") }));
2730 prompt = Fconcat (2, args);
2731
2732 GCPRO1 (prompt); 2729 GCPRO1 (prompt);
2733 2730
2734 while (1) 2731 while (1)
diff --git a/src/font.c b/src/font.c
index 412cd3f938d..57cc4aa0b2b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -1190,12 +1190,12 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font)
1190 { 1190 {
1191 val = prop[XLFD_ENCODING_INDEX]; 1191 val = prop[XLFD_ENCODING_INDEX];
1192 if (! NILP (val)) 1192 if (! NILP (val))
1193 val = concat2 (build_string ("*-"), SYMBOL_NAME (val)); 1193 val = concat2 (build_local_string ("*-"), SYMBOL_NAME (val));
1194 } 1194 }
1195 else if (NILP (prop[XLFD_ENCODING_INDEX])) 1195 else if (NILP (prop[XLFD_ENCODING_INDEX]))
1196 val = concat2 (SYMBOL_NAME (val), build_string ("-*")); 1196 val = concat2 (SYMBOL_NAME (val), build_local_string ("-*"));
1197 else 1197 else
1198 val = concat3 (SYMBOL_NAME (val), build_string ("-"), 1198 val = concat3 (SYMBOL_NAME (val), build_local_string ("-"),
1199 SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); 1199 SYMBOL_NAME (prop[XLFD_ENCODING_INDEX]));
1200 if (! NILP (val)) 1200 if (! NILP (val))
1201 ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); 1201 ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil));
@@ -1793,9 +1793,9 @@ font_parse_family_registry (Lisp_Object family, Lisp_Object registry, Lisp_Objec
1793 if (! p1) 1793 if (! p1)
1794 { 1794 {
1795 if (SDATA (registry)[len - 1] == '*') 1795 if (SDATA (registry)[len - 1] == '*')
1796 registry = concat2 (registry, build_string ("-*")); 1796 registry = concat2 (registry, build_local_string ("-*"));
1797 else 1797 else
1798 registry = concat2 (registry, build_string ("*-*")); 1798 registry = concat2 (registry, build_local_string ("*-*"));
1799 } 1799 }
1800 registry = Fdowncase (registry); 1800 registry = Fdowncase (registry);
1801 ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); 1801 ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil));
@@ -5022,7 +5022,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
5022 if (FONTP (arg)) 5022 if (FONTP (arg))
5023 { 5023 {
5024 Lisp_Object tail, elt; 5024 Lisp_Object tail, elt;
5025 Lisp_Object equalstr = build_string ("="); 5025 Lisp_Object equalstr = build_local_string ("=");
5026 5026
5027 val = Ffont_xlfd_name (arg, Qt); 5027 val = Ffont_xlfd_name (arg, Qt);
5028 for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); 5028 for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail);
@@ -5056,7 +5056,7 @@ font_add_log (const char *action, Lisp_Object arg, Lisp_Object result)
5056 val = Ffont_xlfd_name (result, Qt); 5056 val = Ffont_xlfd_name (result, Qt);
5057 if (! FONT_SPEC_P (result)) 5057 if (! FONT_SPEC_P (result))
5058 val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), 5058 val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)),
5059 build_string (":"), val); 5059 build_local_string (":"), val);
5060 result = val; 5060 result = val;
5061 } 5061 }
5062 else if (CONSP (result)) 5062 else if (CONSP (result))
diff --git a/src/fontset.c b/src/fontset.c
index 8ff53a1d3a4..a36ae4aa5e3 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1462,7 +1462,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1462 registry = AREF (font_spec, FONT_REGISTRY_INDEX); 1462 registry = AREF (font_spec, FONT_REGISTRY_INDEX);
1463 if (! NILP (registry)) 1463 if (! NILP (registry))
1464 registry = Fdowncase (SYMBOL_NAME (registry)); 1464 registry = Fdowncase (SYMBOL_NAME (registry));
1465 encoding = find_font_encoding (concat3 (family, build_string ("-"), 1465 encoding = find_font_encoding (concat3 (family, build_local_string ("-"),
1466 registry)); 1466 registry));
1467 if (NILP (encoding)) 1467 if (NILP (encoding))
1468 encoding = Qascii; 1468 encoding = Qascii;
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
diff --git a/src/keymap.c b/src/keymap.c
index f7256bfde2a..a1299ec8554 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1342,7 +1342,7 @@ silly_event_symbol_error (Lisp_Object c)
1342 *p = 0; 1342 *p = 0;
1343 1343
1344 c = reorder_modifiers (c); 1344 c = reorder_modifiers (c);
1345 keystring = concat2 (build_string (new_mods), XCDR (assoc)); 1345 keystring = concat2 (build_local_string (new_mods), XCDR (assoc));
1346 1346
1347 error ("To bind the key %s, use [?%s], not [%s]", 1347 error ("To bind the key %s, use [?%s], not [%s]",
1348 SDATA (SYMBOL_NAME (c)), SDATA (keystring), 1348 SDATA (SYMBOL_NAME (c)), SDATA (keystring),
@@ -2245,7 +2245,7 @@ around function keys and event symbols. */)
2245 if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) 2245 if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key)))
2246 /* An interval from a map-char-table. */ 2246 /* An interval from a map-char-table. */
2247 return concat3 (Fsingle_key_description (XCAR (key), no_angles), 2247 return concat3 (Fsingle_key_description (XCAR (key), no_angles),
2248 build_string (".."), 2248 build_local_string (".."),
2249 Fsingle_key_description (XCDR (key), no_angles)); 2249 Fsingle_key_description (XCDR (key), no_angles));
2250 2250
2251 key = EVENT_HEAD (key); 2251 key = EVENT_HEAD (key);
@@ -3444,7 +3444,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args,
3444 { 3444 {
3445 Lisp_Object tem; 3445 Lisp_Object tem;
3446 tem = Fkey_description (prefix, Qnil); 3446 tem = Fkey_description (prefix, Qnil);
3447 elt_prefix = concat2 (tem, build_string (" ")); 3447 elt_prefix = concat2 (tem, build_local_string (" "));
3448 } 3448 }
3449 prefix = Qnil; 3449 prefix = Qnil;
3450 } 3450 }
diff --git a/src/lisp.h b/src/lisp.h
index ba3c812f5d8..1a6c69559ce 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4605,6 +4605,20 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
4605 4605
4606# define USE_LOCAL_ALLOCATORS 4606# define USE_LOCAL_ALLOCATORS
4607 4607
4608/* Return a function-scoped cons whose car is X and cdr is Y. */
4609
4610# define local_cons(x, y) \
4611 ({ \
4612 struct Lisp_Cons *c = alloca (sizeof (struct Lisp_Cons)); \
4613 c->car = (x); \
4614 c->u.cdr = (y); \
4615 make_lisp_ptr (c, Lisp_Cons); \
4616 })
4617
4618# define local_list1(x) local_cons (x, Qnil)
4619# define local_list2(x, y) local_cons (x, local_list1 (y))
4620# define local_list3(x, y, z) local_cons (x, local_list2 (y, z))
4621
4608/* Return a function-scoped vector of length SIZE, with each element 4622/* Return a function-scoped vector of length SIZE, with each element
4609 being INIT. */ 4623 being INIT. */
4610 4624
@@ -4643,12 +4657,17 @@ verify (sizeof (struct Lisp_Cons) == sizeof (union Aligned_Cons));
4643 4657
4644/* Return a function-scoped string with contents DATA. */ 4658/* Return a function-scoped string with contents DATA. */
4645 4659
4646# define build_local_string(data) \ 4660# define build_local_string(data) \
4647 ({ char const *data_ = data; make_local_string (data_, strlen (data_)); }) 4661 ({ char const *data1_ = (data); \
4662 make_local_string (data1_, strlen (data1_)); })
4648 4663
4649#else 4664#else
4650 4665
4651/* Safer but slower implementations. */ 4666/* Safer but slower implementations. */
4667# define local_cons(car, cdr) Fcons (car, cdr)
4668# define local_list1(x) list1 (x)
4669# define local_list2(x, y) list2 (x, y)
4670# define local_list3(x, y, z) list3 (x, y, z)
4652# define make_local_vector(size, init) Fmake_vector (make_number (size), init) 4671# define make_local_vector(size, init) Fmake_vector (make_number (size), init)
4653# define make_local_string(data, nbytes) make_string (data, nbytes) 4672# define make_local_string(data, nbytes) make_string (data, nbytes)
4654# define build_local_string(data) build_string (data) 4673# define build_local_string(data) build_string (data)
diff --git a/src/lread.c b/src/lread.c
index f32b60ad588..fabd2010035 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2894,7 +2894,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list)
2894 Lisp_Object placeholder; 2894 Lisp_Object placeholder;
2895 Lisp_Object cell; 2895 Lisp_Object cell;
2896 2896
2897 placeholder = Fcons (Qnil, Qnil); 2897 placeholder = scoped_cons (Qnil, Qnil);
2898 cell = Fcons (make_number (n), placeholder); 2898 cell = Fcons (make_number (n), placeholder);
2899 read_objects = Fcons (cell, read_objects); 2899 read_objects = Fcons (cell, read_objects);
2900 2900
@@ -3374,7 +3374,7 @@ substitute_object_recurse (Lisp_Object object, Lisp_Object placeholder, Lisp_Obj
3374 substitute_in_interval contains part of the logic. */ 3374 substitute_in_interval contains part of the logic. */
3375 3375
3376 INTERVAL root_interval = string_intervals (subtree); 3376 INTERVAL root_interval = string_intervals (subtree);
3377 Lisp_Object arg = Fcons (object, placeholder); 3377 Lisp_Object arg = scoped_cons (object, placeholder);
3378 3378
3379 traverse_intervals_noorder (root_interval, 3379 traverse_intervals_noorder (root_interval,
3380 &substitute_in_interval, arg); 3380 &substitute_in_interval, arg);
@@ -3681,8 +3681,8 @@ read_list (bool flag, Lisp_Object readcharfun)
3681 in the installed Lisp directory. 3681 in the installed Lisp directory.
3682 We don't use Fexpand_file_name because that would make 3682 We don't use Fexpand_file_name because that would make
3683 the directory absolute now. */ 3683 the directory absolute now. */
3684 elt = concat2 (build_string ("../lisp/"), 3684 elt = concat2 (build_local_string ("../lisp/"),
3685 Ffile_name_nondirectory (elt)); 3685 Ffile_name_nondirectory (elt));
3686 } 3686 }
3687 else if (EQ (elt, Vload_file_name) 3687 else if (EQ (elt, Vload_file_name)
3688 && ! NILP (elt) 3688 && ! NILP (elt)
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),
diff --git a/src/minibuf.c b/src/minibuf.c
index 93e19d5c120..b5e7e4cd76e 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1123,7 +1123,7 @@ If `read-buffer-function' is non-nil, this works by calling it as a
1123function, instead of the usual behavior. */) 1123function, instead of the usual behavior. */)
1124 (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match) 1124 (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match)
1125{ 1125{
1126 Lisp_Object args[4], result; 1126 Lisp_Object result;
1127 char *s; 1127 char *s;
1128 ptrdiff_t len; 1128 ptrdiff_t len;
1129 ptrdiff_t count = SPECPDL_INDEX (); 1129 ptrdiff_t count = SPECPDL_INDEX ();
@@ -1157,10 +1157,9 @@ function, instead of the usual behavior. */)
1157 STRING_MULTIBYTE (prompt)); 1157 STRING_MULTIBYTE (prompt));
1158 } 1158 }
1159 1159
1160 args[0] = build_string ("%s (default %s): "); 1160 prompt = Fformat (3, ((Lisp_Object [])
1161 args[1] = prompt; 1161 { build_local_string ("%s (default %s): "),
1162 args[2] = CONSP (def) ? XCAR (def) : def; 1162 prompt, CONSP (def) ? XCAR (def) : def }));
1163 prompt = Fformat (3, args);
1164 } 1163 }
1165 1164
1166 result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), 1165 result = Fcompleting_read (prompt, intern ("internal-complete-buffer"),
@@ -1168,13 +1167,8 @@ function, instead of the usual behavior. */)
1168 Qbuffer_name_history, def, Qnil); 1167 Qbuffer_name_history, def, Qnil);
1169 } 1168 }
1170 else 1169 else
1171 { 1170 result = Ffuncall (4, ((Lisp_Object [])
1172 args[0] = Vread_buffer_function; 1171 { Vread_buffer_function, prompt, def, require_match }));
1173 args[1] = prompt;
1174 args[2] = def;
1175 args[3] = require_match;
1176 result = Ffuncall (4, args);
1177 }
1178 return unbind_to (count, result); 1172 return unbind_to (count, result);
1179} 1173}
1180 1174
diff --git a/src/process.c b/src/process.c
index ef9f295fd89..41ca66671a9 100644
--- a/src/process.c
+++ b/src/process.c
@@ -620,7 +620,7 @@ status_message (struct Lisp_Process *p)
620 if (c1 != c2) 620 if (c1 != c2)
621 Faset (string, make_number (0), make_number (c2)); 621 Faset (string, make_number (0), make_number (c2));
622 } 622 }
623 string2 = build_string (coredump ? " (core dumped)\n" : "\n"); 623 string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
624 return concat2 (string, string2); 624 return concat2 (string, string2);
625 } 625 }
626 else if (EQ (symbol, Qexit)) 626 else if (EQ (symbol, Qexit))
@@ -630,14 +630,14 @@ status_message (struct Lisp_Process *p)
630 if (code == 0) 630 if (code == 0)
631 return build_string ("finished\n"); 631 return build_string ("finished\n");
632 string = Fnumber_to_string (make_number (code)); 632 string = Fnumber_to_string (make_number (code));
633 string2 = build_string (coredump ? " (core dumped)\n" : "\n"); 633 string2 = build_local_string (coredump ? " (core dumped)\n" : "\n");
634 return concat3 (build_string ("exited abnormally with code "), 634 return concat3 (build_local_string ("exited abnormally with code "),
635 string, string2); 635 string, string2);
636 } 636 }
637 else if (EQ (symbol, Qfailed)) 637 else if (EQ (symbol, Qfailed))
638 { 638 {
639 string = Fnumber_to_string (make_number (code)); 639 string = Fnumber_to_string (make_number (code));
640 string2 = build_string ("\n"); 640 string2 = build_local_string ("\n");
641 return concat3 (build_string ("failed with code "), 641 return concat3 (build_string ("failed with code "),
642 string, string2); 642 string, string2);
643 } 643 }
@@ -1305,22 +1305,22 @@ Returns nil if format of ADDRESS is invalid. */)
1305 1305
1306 if (size == 4 || (size == 5 && !NILP (omit_port))) 1306 if (size == 4 || (size == 5 && !NILP (omit_port)))
1307 { 1307 {
1308 args[0] = build_string ("%d.%d.%d.%d"); 1308 args[0] = build_local_string ("%d.%d.%d.%d");
1309 nargs = 4; 1309 nargs = 4;
1310 } 1310 }
1311 else if (size == 5) 1311 else if (size == 5)
1312 { 1312 {
1313 args[0] = build_string ("%d.%d.%d.%d:%d"); 1313 args[0] = build_local_string ("%d.%d.%d.%d:%d");
1314 nargs = 5; 1314 nargs = 5;
1315 } 1315 }
1316 else if (size == 8 || (size == 9 && !NILP (omit_port))) 1316 else if (size == 8 || (size == 9 && !NILP (omit_port)))
1317 { 1317 {
1318 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); 1318 args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
1319 nargs = 8; 1319 nargs = 8;
1320 } 1320 }
1321 else if (size == 9) 1321 else if (size == 9)
1322 { 1322 {
1323 args[0] = build_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d"); 1323 args[0] = build_local_string ("[%x:%x:%x:%x:%x:%x:%x:%x]:%d");
1324 nargs = 9; 1324 nargs = 9;
1325 } 1325 }
1326 else 1326 else
@@ -1339,16 +1339,12 @@ Returns nil if format of ADDRESS is invalid. */)
1339 args[i+1] = p->contents[i]; 1339 args[i+1] = p->contents[i];
1340 } 1340 }
1341 1341
1342 return Fformat (nargs+1, args); 1342 return Fformat (nargs + 1, args);
1343 } 1343 }
1344 1344
1345 if (CONSP (address)) 1345 if (CONSP (address))
1346 { 1346 return Fformat (2, ((Lisp_Object [])
1347 Lisp_Object args[2]; 1347 { build_local_string ("<Family %d>"), Fcar (address) }));
1348 args[0] = build_string ("<Family %d>");
1349 args[1] = Fcar (address);
1350 return Fformat (2, args);
1351 }
1352 1348
1353 return Qnil; 1349 return Qnil;
1354} 1350}
@@ -4061,20 +4057,14 @@ server_accept_connection (Lisp_Object server, int channel)
4061 { 4057 {
4062 case AF_INET: 4058 case AF_INET:
4063 { 4059 {
4064 Lisp_Object args[5];
4065 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; 4060 unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
4066 args[0] = build_string ("%d.%d.%d.%d");
4067 args[1] = make_number (*ip++);
4068 args[2] = make_number (*ip++);
4069 args[3] = make_number (*ip++);
4070 args[4] = make_number (*ip++);
4071 host = Fformat (5, args);
4072 service = make_number (ntohs (saddr.in.sin_port));
4073 4061
4074 args[0] = build_string (" <%s:%d>"); 4062 host = Fformat (5, ((Lisp_Object [])
4075 args[1] = host; 4063 { build_local_string ("%d.%d.%d.%d"), make_number (*ip++),
4076 args[2] = service; 4064 make_number (*ip++), make_number (*ip++), make_number (*ip++) }));
4077 caller = Fformat (3, args); 4065 service = make_number (ntohs (saddr.in.sin_port));
4066 caller = Fformat (3, ((Lisp_Object [])
4067 { build_local_string (" <%s:%d>"), host, service }));
4078 } 4068 }
4079 break; 4069 break;
4080 4070
@@ -4084,16 +4074,14 @@ server_accept_connection (Lisp_Object server, int channel)
4084 Lisp_Object args[9]; 4074 Lisp_Object args[9];
4085 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; 4075 uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr;
4086 int i; 4076 int i;
4087 args[0] = build_string ("%x:%x:%x:%x:%x:%x:%x:%x"); 4077
4078 args[0] = build_local_string ("%x:%x:%x:%x:%x:%x:%x:%x");
4088 for (i = 0; i < 8; i++) 4079 for (i = 0; i < 8; i++)
4089 args[i+1] = make_number (ntohs (ip6[i])); 4080 args[i + 1] = make_number (ntohs (ip6[i]));
4090 host = Fformat (9, args); 4081 host = Fformat (9, args);
4091 service = make_number (ntohs (saddr.in.sin_port)); 4082 service = make_number (ntohs (saddr.in.sin_port));
4092 4083 caller = Fformat (3, ((Lisp_Object [])
4093 args[0] = build_string (" <[%s]:%d>"); 4084 { build_local_string (" <[%s]:%d>"), host, service }));
4094 args[1] = host;
4095 args[2] = service;
4096 caller = Fformat (3, args);
4097 } 4085 }
4098 break; 4086 break;
4099#endif 4087#endif
@@ -4103,7 +4091,8 @@ server_accept_connection (Lisp_Object server, int channel)
4103#endif 4091#endif
4104 default: 4092 default:
4105 caller = Fnumber_to_string (make_number (connect_counter)); 4093 caller = Fnumber_to_string (make_number (connect_counter));
4106 caller = concat3 (build_string (" <"), caller, build_string (">")); 4094 caller = concat3
4095 (build_local_string (" <"), caller, build_local_string (">"));
4107 break; 4096 break;
4108 } 4097 }
4109 4098
@@ -4202,14 +4191,14 @@ server_accept_connection (Lisp_Object server, int channel)
4202 4191
4203 if (!NILP (ps->log)) 4192 if (!NILP (ps->log))
4204 call3 (ps->log, server, proc, 4193 call3 (ps->log, server, proc,
4205 concat3 (build_string ("accept from "), 4194 concat3 (build_local_string ("accept from "),
4206 (STRINGP (host) ? host : build_string ("-")), 4195 (STRINGP (host) ? host : build_local_string ("-")),
4207 build_string ("\n"))); 4196 build_local_string ("\n")));
4208 4197
4209 exec_sentinel (proc, 4198 exec_sentinel (proc,
4210 concat3 (build_string ("open from "), 4199 concat3 (build_local_string ("open from "),
4211 (STRINGP (host) ? host : build_string ("-")), 4200 (STRINGP (host) ? host : build_local_string ("-")),
4212 build_string ("\n"))); 4201 build_local_string ("\n")));
4213} 4202}
4214 4203
4215/* This variable is different from waiting_for_input in keyboard.c. 4204/* This variable is different from waiting_for_input in keyboard.c.
diff --git a/src/textprop.c b/src/textprop.c
index 2eea2d20839..b75b19b25cc 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1317,9 +1317,10 @@ specify the property to add.
1317If the optional fifth argument OBJECT is a buffer (or nil, which means 1317If the optional fifth argument OBJECT is a buffer (or nil, which means
1318the current buffer), START and END are buffer positions (integers or 1318the current buffer), START and END are buffer positions (integers or
1319markers). If OBJECT is a string, START and END are 0-based indices into it. */) 1319markers). If OBJECT is a string, START and END are 0-based indices into it. */)
1320 (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) 1320 (Lisp_Object start, Lisp_Object end, Lisp_Object property,
1321 Lisp_Object value, Lisp_Object object)
1321{ 1322{
1322 Fadd_text_properties (start, end, list2 (property, value), object); 1323 Fadd_text_properties (start, end, scoped_list2 (property, value), object);
1323 return Qnil; 1324 return Qnil;
1324} 1325}
1325 1326
@@ -1360,7 +1361,7 @@ into it. */)
1360 (Lisp_Object start, Lisp_Object end, Lisp_Object face, 1361 (Lisp_Object start, Lisp_Object end, Lisp_Object face,
1361 Lisp_Object append, Lisp_Object object) 1362 Lisp_Object append, Lisp_Object object)
1362{ 1363{
1363 add_text_properties_1 (start, end, list2 (Qface, face), object, 1364 add_text_properties_1 (start, end, scoped_list2 (Qface, face), object,
1364 (NILP (append) 1365 (NILP (append)
1365 ? TEXT_PROPERTY_PREPEND 1366 ? TEXT_PROPERTY_PREPEND
1366 : TEXT_PROPERTY_APPEND)); 1367 : TEXT_PROPERTY_APPEND));
@@ -1909,7 +1910,8 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
1909/* Note this can GC when DEST is a buffer. */ 1910/* Note this can GC when DEST is a buffer. */
1910 1911
1911Lisp_Object 1912Lisp_Object
1912copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop) 1913copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
1914 Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
1913{ 1915{
1914 INTERVAL i; 1916 INTERVAL i;
1915 Lisp_Object res; 1917 Lisp_Object res;
@@ -1962,12 +1964,11 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
1962 plist = Fcdr (Fcdr (plist)); 1964 plist = Fcdr (Fcdr (plist));
1963 } 1965 }
1964 if (! NILP (plist)) 1966 if (! NILP (plist))
1965 { 1967 /* Must defer modifications to the interval tree in case
1966 /* Must defer modifications to the interval tree in case src 1968 src and dest refer to the same string or buffer. */
1967 and dest refer to the same string or buffer. */ 1969 stuff = local_cons
1968 stuff = Fcons (list3 (make_number (p), make_number (p + len), plist), 1970 (local_list3 (make_number (p), make_number (p + len), plist),
1969 stuff); 1971 stuff);
1970 }
1971 1972
1972 i = next_interval (i); 1973 i = next_interval (i);
1973 if (!i) 1974 if (!i)