diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/editfns.c b/src/editfns.c index 5c9c34dc352..355a7a3e299 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -437,6 +437,27 @@ find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, | |||
| 437 | 437 | ||
| 438 | after_field | 438 | after_field |
| 439 | = get_char_property_and_overlay (pos, Qfield, Qnil, NULL); | 439 | = get_char_property_and_overlay (pos, Qfield, Qnil, NULL); |
| 440 | |||
| 441 | /* We're not in a field, so find the prev/next area with a field | ||
| 442 | property. */ | ||
| 443 | if (NILP (after_field)) | ||
| 444 | { | ||
| 445 | if (beg) | ||
| 446 | { | ||
| 447 | Lisp_Object p = Fprevious_single_char_property_change (pos, Qfield, | ||
| 448 | Qnil, | ||
| 449 | beg_limit); | ||
| 450 | *beg = NILP (p) ? BEGV : XFIXNAT (p); | ||
| 451 | } | ||
| 452 | if (end) | ||
| 453 | { | ||
| 454 | Lisp_Object p = Fnext_single_char_property_change (pos, Qfield, Qnil, | ||
| 455 | end_limit); | ||
| 456 | *end = NILP (p) ? ZV : XFIXNAT (p); | ||
| 457 | } | ||
| 458 | return; | ||
| 459 | } | ||
| 460 | |||
| 440 | before_field | 461 | before_field |
| 441 | = (XFIXNAT (pos) > BEGV | 462 | = (XFIXNAT (pos) > BEGV |
| 442 | ? get_char_property_and_overlay (make_fixnum (XFIXNUM (pos) - 1), | 463 | ? get_char_property_and_overlay (make_fixnum (XFIXNUM (pos) - 1), |