summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2014-09-15 18:53:23 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2014-09-15 18:53:23 +0400
commitedb0288b83b45d295df52ce7644e897613358971 (patch)
tree8f169c257e9752ca860764cc19ec232d287eb189 /src/textprop.c
parent497daa12743ed71a70e41f966631d1c8856248cc (diff)
downloademacs-edb0288b83b45d295df52ce7644e897613358971.tar.gz
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/textprop.c')
-rw-r--r--src/textprop.c21
1 files changed, 11 insertions, 10 deletions
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.
If the optional fifth argument OBJECT is a buffer (or nil, which means
the current buffer), START and END are buffer positions (integers or
markers). If OBJECT is a string, START and END are 0-based indices into it. */)
- (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object)
+ (Lisp_Object start, Lisp_Object end, Lisp_Object property,
+ Lisp_Object value, Lisp_Object object)
{
- Fadd_text_properties (start, end, list2 (property, value), object);
+ Fadd_text_properties (start, end, scoped_list2 (property, value), object);
return Qnil;
}
@@ -1360,7 +1361,7 @@ into it. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object face,
Lisp_Object append, Lisp_Object object)
{
- add_text_properties_1 (start, end, list2 (Qface, face), object,
+ add_text_properties_1 (start, end, scoped_list2 (Qface, face), object,
(NILP (append)
? TEXT_PROPERTY_PREPEND
: TEXT_PROPERTY_APPEND));
@@ -1909,7 +1910,8 @@ text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer)
/* Note this can GC when DEST is a buffer. */
Lisp_Object
-copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
+copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src,
+ Lisp_Object pos, Lisp_Object dest, Lisp_Object prop)
{
INTERVAL i;
Lisp_Object res;
@@ -1962,12 +1964,11 @@ copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_
plist = Fcdr (Fcdr (plist));
}
if (! NILP (plist))
- {
- /* Must defer modifications to the interval tree in case src
- and dest refer to the same string or buffer. */
- stuff = Fcons (list3 (make_number (p), make_number (p + len), plist),
- stuff);
- }
+ /* Must defer modifications to the interval tree in case
+ src and dest refer to the same string or buffer. */
+ stuff = local_cons
+ (local_list3 (make_number (p), make_number (p + len), plist),
+ stuff);
i = next_interval (i);
if (!i)