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/textprop.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/textprop.c')
| -rw-r--r-- | src/textprop.c | 21 |
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. | |||
| 1317 | If the optional fifth argument OBJECT is a buffer (or nil, which means | 1317 | If the optional fifth argument OBJECT is a buffer (or nil, which means |
| 1318 | the current buffer), START and END are buffer positions (integers or | 1318 | the current buffer), START and END are buffer positions (integers or |
| 1319 | markers). If OBJECT is a string, START and END are 0-based indices into it. */) | 1319 | markers). 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 | ||
| 1911 | Lisp_Object | 1912 | Lisp_Object |
| 1912 | copy_text_properties (Lisp_Object start, Lisp_Object end, Lisp_Object src, Lisp_Object pos, Lisp_Object dest, Lisp_Object prop) | 1913 | copy_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) |