aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-05-17 22:48:56 +0000
committerKim F. Storm2004-05-17 22:48:56 +0000
commit7994a99147bb20963e0e47792cbca1a9db9de7cd (patch)
tree32d333688fd1ebffbed315d9b4c42ee46e450fbc /src
parentb5be4dbe9664b278c6c7d1ab782b0e44434f21eb (diff)
downloademacs-7994a99147bb20963e0e47792cbca1a9db9de7cd.tar.gz
emacs-7994a99147bb20963e0e47792cbca1a9db9de7cd.zip
(next_overlay_change, note_mouse_highlight): Use GET_OVERLAYS_AT.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index a9506c66b4d..45424db474c 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -2734,19 +2734,10 @@ next_overlay_change (pos)
2734 int noverlays; 2734 int noverlays;
2735 int endpos; 2735 int endpos;
2736 Lisp_Object *overlays; 2736 Lisp_Object *overlays;
2737 int len;
2738 int i; 2737 int i;
2739 2738
2740 /* Get all overlays at the given position. */ 2739 /* Get all overlays at the given position. */
2741 len = 10; 2740 GET_OVERLAYS_AT (pos, overlays, noverlays, &endpos, 1);
2742 overlays = (Lisp_Object *) alloca (len * sizeof *overlays);
2743 noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1);
2744 if (noverlays > len)
2745 {
2746 len = noverlays;
2747 overlays = (Lisp_Object *) alloca (len * sizeof *overlays);
2748 noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1);
2749 }
2750 2741
2751 /* If any of these overlays ends before endpos, 2742 /* If any of these overlays ends before endpos,
2752 use its ending point instead. */ 2743 use its ending point instead. */
@@ -20834,7 +20825,7 @@ note_mouse_highlight (f, x, y)
20834 Lisp_Object object; 20825 Lisp_Object object;
20835 Lisp_Object mouse_face = Qnil, overlay = Qnil, position; 20826 Lisp_Object mouse_face = Qnil, overlay = Qnil, position;
20836 Lisp_Object *overlay_vec = NULL; 20827 Lisp_Object *overlay_vec = NULL;
20837 int len, noverlays; 20828 int noverlays;
20838 struct buffer *obuf; 20829 struct buffer *obuf;
20839 int obegv, ozv, same_region; 20830 int obegv, ozv, same_region;
20840 20831
@@ -20921,19 +20912,8 @@ note_mouse_highlight (f, x, y)
20921 20912
20922 if (BUFFERP (object)) 20913 if (BUFFERP (object))
20923 { 20914 {
20924 /* Put all the overlays we want in a vector in overlay_vec. 20915 /* Put all the overlays we want in a vector in overlay_vec. */
20925 Store the length in len. If there are more than 40, make 20916 GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0);
20926 enough space for all, and try again. */
20927 len = 40;
20928 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
20929 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0);
20930 if (noverlays > len)
20931 {
20932 len = noverlays;
20933 overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object));
20934 noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL,0);
20935 }
20936
20937 /* Sort overlays into increasing priority order. */ 20917 /* Sort overlays into increasing priority order. */
20938 noverlays = sort_overlays (overlay_vec, noverlays, w); 20918 noverlays = sort_overlays (overlay_vec, noverlays, w);
20939 } 20919 }