diff options
author | Kim F. Storm <storm@cua.dk> | 2004-05-17 22:48:07 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2004-05-17 22:48:07 +0000 |
commit | b5be4dbe9664b278c6c7d1ab782b0e44434f21eb (patch) | |
tree | 9b44a72366d1b1c769d1c821200255a3c17d0749 /src/textprop.c | |
parent | 28b8f74030ab824a230ba4f6e317928a91907d98 (diff) | |
download | emacs-b5be4dbe9664b278c6c7d1ab782b0e44434f21eb.tar.gz |
(get_char_property_and_overlay): Use GET_OVERLAYS_AT.
Diffstat (limited to 'src/textprop.c')
-rw-r--r-- | src/textprop.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/textprop.c b/src/textprop.c index 4f13aefb1be..c8ec008dcbd 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -637,30 +637,13 @@ get_char_property_and_overlay (position, prop, object, overlay) } if (BUFFERP (object)) { - int posn = XINT (position); int noverlays; - Lisp_Object *overlay_vec, tem; - int len; + Lisp_Object *overlay_vec; struct buffer *obuf = current_buffer; set_buffer_temp (XBUFFER (object)); - /* First try with room for 40 overlays. */ - len = 40; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - - noverlays = overlays_at (posn, 0, &overlay_vec, &len, - NULL, NULL, 0); - - /* If there are more than 40, - make enough space for all, and try again. */ - if (noverlays > len) - { - len = noverlays; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (posn, 0, &overlay_vec, &len, - NULL, NULL, 0); - } + GET_OVERLAYS_AT (XINT (position), overlay_vec, noverlays, NULL, 0); noverlays = sort_overlays (overlay_vec, noverlays, w); set_buffer_temp (obuf); @@ -668,7 +651,7 @@ get_char_property_and_overlay (position, prop, object, overlay) /* Now check the overlays in order of decreasing priority. */ while (--noverlays >= 0) { - tem = Foverlay_get (overlay_vec[noverlays], prop); + Lisp_Object tem = Foverlay_get (overlay_vec[noverlays], prop); if (!NILP (tem)) { if (overlay) |