comparison src/buffer.c @ 36584:1f80152aeddc

(mouse_face_overlay_overlaps): New function.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 06 Mar 2001 15:28:48 +0000
parents e5e6579e8308
children c9ab48ddfcfe
comparison
equal deleted inserted replaced
36583:adb23d572f63 36584:1f80152aeddc
1 /* Buffer manipulation primitives for GNU Emacs. 1 /* Buffer manipulation primitives for GNU Emacs.
2 Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000 2 Copyright (C) 1985,86,87,88,89,93,94,95,97,98, 1999, 2000, 2001
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
6 6
7 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
2516 *next_ptr = next; 2516 *next_ptr = next;
2517 if (prev_ptr) 2517 if (prev_ptr)
2518 *prev_ptr = prev; 2518 *prev_ptr = prev;
2519 return idx; 2519 return idx;
2520 } 2520 }
2521
2522
2523 /* Return non-zero if there exists an overlay with a non-nil
2524 `mouse-face' property overlapping OVERLAY. */
2525
2526 int
2527 mouse_face_overlay_overlaps (overlay)
2528 Lisp_Object overlay;
2529 {
2530 int start = OVERLAY_POSITION (OVERLAY_START (overlay));
2531 int end = OVERLAY_POSITION (OVERLAY_END (overlay));
2532 int n, i;
2533 Lisp_Object *v, tem;
2534
2535 n = 10;
2536 v = (Lisp_Object *) alloca (n * sizeof *v);
2537 i = overlays_in (start, end, 0, &v, &n, NULL, NULL);
2538 if (i > n)
2539 {
2540 n = i;
2541 v = (Lisp_Object *) alloca (n * sizeof *v);
2542 overlays_in (start, end, 0, &v, &n, NULL, NULL);
2543 }
2544
2545 for (i = 0; i < n; ++i)
2546 if (!EQ (v[i], overlay)
2547 && (tem = Foverlay_get (overlay, Qmouse_face),
2548 !NILP (tem)))
2549 break;
2550
2551 return i < n;
2552 }
2553
2554
2521 2555
2522 /* Fast function to just test if we're at an overlay boundary. */ 2556 /* Fast function to just test if we're at an overlay boundary. */
2523 int 2557 int
2524 overlay_touches_p (pos) 2558 overlay_touches_p (pos)
2525 int pos; 2559 int pos;