diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index f019863e80b..99e298a5cd0 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1,5 +1,5 @@ | |||
| 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. |
| @@ -2518,6 +2518,40 @@ overlays_in (beg, end, extend, vec_ptr, len_ptr, next_ptr, 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 |