diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/editfns.c b/src/editfns.c index add2f37109b..e78f301e433 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -94,7 +94,8 @@ extern Lisp_Object w32_get_internal_run_time (void); | |||
| 94 | #endif | 94 | #endif |
| 95 | 95 | ||
| 96 | static int tm_diff (struct tm *, struct tm *); | 96 | static int tm_diff (struct tm *, struct tm *); |
| 97 | static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *); | 97 | static void find_field (Lisp_Object, Lisp_Object, Lisp_Object, |
| 98 | EMACS_INT *, Lisp_Object, EMACS_INT *); | ||
| 98 | static void update_buffer_properties (int, int); | 99 | static void update_buffer_properties (int, int); |
| 99 | static Lisp_Object region_limit (int); | 100 | static Lisp_Object region_limit (int); |
| 100 | static size_t emacs_memftimeu (char *, size_t, const char *, | 101 | static size_t emacs_memftimeu (char *, size_t, const char *, |
| @@ -515,7 +516,9 @@ get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object o | |||
| 515 | is not stored. */ | 516 | is not stored. */ |
| 516 | 517 | ||
| 517 | static void | 518 | static void |
| 518 | find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, Lisp_Object beg_limit, int *beg, Lisp_Object end_limit, int *end) | 519 | find_field (Lisp_Object pos, Lisp_Object merge_at_boundary, |
| 520 | Lisp_Object beg_limit, | ||
| 521 | EMACS_INT *beg, Lisp_Object end_limit, EMACS_INT *end) | ||
| 519 | { | 522 | { |
| 520 | /* Fields right before and after the point. */ | 523 | /* Fields right before and after the point. */ |
| 521 | Lisp_Object before_field, after_field; | 524 | Lisp_Object before_field, after_field; |
| @@ -631,7 +634,7 @@ A field is a region of text with the same `field' property. | |||
| 631 | If POS is nil, the value of point is used for POS. */) | 634 | If POS is nil, the value of point is used for POS. */) |
| 632 | (Lisp_Object pos) | 635 | (Lisp_Object pos) |
| 633 | { | 636 | { |
| 634 | int beg, end; | 637 | EMACS_INT beg, end; |
| 635 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 638 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 636 | if (beg != end) | 639 | if (beg != end) |
| 637 | del_range (beg, end); | 640 | del_range (beg, end); |
| @@ -644,7 +647,7 @@ A field is a region of text with the same `field' property. | |||
| 644 | If POS is nil, the value of point is used for POS. */) | 647 | If POS is nil, the value of point is used for POS. */) |
| 645 | (Lisp_Object pos) | 648 | (Lisp_Object pos) |
| 646 | { | 649 | { |
| 647 | int beg, end; | 650 | EMACS_INT beg, end; |
| 648 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 651 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 649 | return make_buffer_string (beg, end, 1); | 652 | return make_buffer_string (beg, end, 1); |
| 650 | } | 653 | } |
| @@ -655,7 +658,7 @@ A field is a region of text with the same `field' property. | |||
| 655 | If POS is nil, the value of point is used for POS. */) | 658 | If POS is nil, the value of point is used for POS. */) |
| 656 | (Lisp_Object pos) | 659 | (Lisp_Object pos) |
| 657 | { | 660 | { |
| 658 | int beg, end; | 661 | EMACS_INT beg, end; |
| 659 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); | 662 | find_field (pos, Qnil, Qnil, &beg, Qnil, &end); |
| 660 | return make_buffer_string (beg, end, 0); | 663 | return make_buffer_string (beg, end, 0); |
| 661 | } | 664 | } |
| @@ -670,7 +673,7 @@ If LIMIT is non-nil, it is a buffer position; if the beginning of the field | |||
| 670 | is before LIMIT, then LIMIT will be returned instead. */) | 673 | is before LIMIT, then LIMIT will be returned instead. */) |
| 671 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) | 674 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) |
| 672 | { | 675 | { |
| 673 | int beg; | 676 | EMACS_INT beg; |
| 674 | find_field (pos, escape_from_edge, limit, &beg, Qnil, 0); | 677 | find_field (pos, escape_from_edge, limit, &beg, Qnil, 0); |
| 675 | return make_number (beg); | 678 | return make_number (beg); |
| 676 | } | 679 | } |
| @@ -685,7 +688,7 @@ If LIMIT is non-nil, it is a buffer position; if the end of the field | |||
| 685 | is after LIMIT, then LIMIT will be returned instead. */) | 688 | is after LIMIT, then LIMIT will be returned instead. */) |
| 686 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) | 689 | (Lisp_Object pos, Lisp_Object escape_from_edge, Lisp_Object limit) |
| 687 | { | 690 | { |
| 688 | int end; | 691 | EMACS_INT end; |
| 689 | find_field (pos, escape_from_edge, Qnil, 0, limit, &end); | 692 | find_field (pos, escape_from_edge, Qnil, 0, limit, &end); |
| 690 | return make_number (end); | 693 | return make_number (end); |
| 691 | } | 694 | } |
| @@ -2343,10 +2346,10 @@ from adjoining text, if those properties are sticky. */) | |||
| 2343 | buffer substrings. */ | 2346 | buffer substrings. */ |
| 2344 | 2347 | ||
| 2345 | Lisp_Object | 2348 | Lisp_Object |
| 2346 | make_buffer_string (int start, int end, int props) | 2349 | make_buffer_string (EMACS_INT start, EMACS_INT end, int props) |
| 2347 | { | 2350 | { |
| 2348 | int start_byte = CHAR_TO_BYTE (start); | 2351 | EMACS_INT start_byte = CHAR_TO_BYTE (start); |
| 2349 | int end_byte = CHAR_TO_BYTE (end); | 2352 | EMACS_INT end_byte = CHAR_TO_BYTE (end); |
| 2350 | 2353 | ||
| 2351 | return make_buffer_string_both (start, start_byte, end, end_byte, props); | 2354 | return make_buffer_string_both (start, start_byte, end, end_byte, props); |
| 2352 | } | 2355 | } |
| @@ -2367,7 +2370,8 @@ make_buffer_string (int start, int end, int props) | |||
| 2367 | buffer substrings. */ | 2370 | buffer substrings. */ |
| 2368 | 2371 | ||
| 2369 | Lisp_Object | 2372 | Lisp_Object |
| 2370 | make_buffer_string_both (int start, int start_byte, int end, int end_byte, int props) | 2373 | make_buffer_string_both (EMACS_INT start, EMACS_INT start_byte, |
| 2374 | EMACS_INT end, EMACS_INT end_byte, int props) | ||
| 2371 | { | 2375 | { |
| 2372 | Lisp_Object result, tem, tem1; | 2376 | Lisp_Object result, tem, tem1; |
| 2373 | 2377 | ||
| @@ -2439,7 +2443,7 @@ into the result string; if you don't want the text properties, | |||
| 2439 | use `buffer-substring-no-properties' instead. */) | 2443 | use `buffer-substring-no-properties' instead. */) |
| 2440 | (Lisp_Object start, Lisp_Object end) | 2444 | (Lisp_Object start, Lisp_Object end) |
| 2441 | { | 2445 | { |
| 2442 | register int b, e; | 2446 | register EMACS_INT b, e; |
| 2443 | 2447 | ||
| 2444 | validate_region (&start, &end); | 2448 | validate_region (&start, &end); |
| 2445 | b = XINT (start); | 2449 | b = XINT (start); |
| @@ -2455,7 +2459,7 @@ The two arguments START and END are character positions; | |||
| 2455 | they can be in either order. */) | 2459 | they can be in either order. */) |
| 2456 | (Lisp_Object start, Lisp_Object end) | 2460 | (Lisp_Object start, Lisp_Object end) |
| 2457 | { | 2461 | { |
| 2458 | register int b, e; | 2462 | register EMACS_INT b, e; |
| 2459 | 2463 | ||
| 2460 | validate_region (&start, &end); | 2464 | validate_region (&start, &end); |
| 2461 | b = XINT (start); | 2465 | b = XINT (start); |