diff options
| author | Miles Bader | 2006-02-01 10:07:17 +0000 |
|---|---|---|
| committer | Miles Bader | 2006-02-01 10:07:17 +0000 |
| commit | 06eb776d8e80eaed0f6b04349dbd4df9292131d9 (patch) | |
| tree | f8f308fcd75d052e99c7e176efc100c8488fda7f /src/editfns.c | |
| parent | db856169c248b363fe3dc5ee4e8b1dd18c3a05a2 (diff) | |
| parent | 46e8fe3d6ce114ae3ecd41f7add9ed7f0c13f4b6 (diff) | |
| download | emacs-06eb776d8e80eaed0f6b04349dbd4df9292131d9.tar.gz emacs-06eb776d8e80eaed0f6b04349dbd4df9292131d9.zip | |
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-9
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 16-33)
- Update from CVS
- Install ERC.
- Fix ERC compiler warnings.
- Use utf-8 encoding in ERC ChangeLogs.
- Merge ERC-related Viper hacks into Viper.
- Merge from erc--main--0
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 8-13)
- Merge from emacs--devo--0
- Update from CVS
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/src/editfns.c b/src/editfns.c index c2f73bdea6a..073ee4bff80 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -524,7 +524,9 @@ find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end) | |||
| 524 | = (XFASTINT (pos) > BEGV | 524 | = (XFASTINT (pos) > BEGV |
| 525 | ? get_char_property_and_overlay (make_number (XINT (pos) - 1), | 525 | ? get_char_property_and_overlay (make_number (XINT (pos) - 1), |
| 526 | Qfield, Qnil, NULL) | 526 | Qfield, Qnil, NULL) |
| 527 | : Qnil); | 527 | /* Using nil here would be a more obvious choice, but it would |
| 528 | fail when the buffer starts with a non-sticky field. */ | ||
| 529 | : after_field); | ||
| 528 | 530 | ||
| 529 | /* See if we need to handle the case where MERGE_AT_BOUNDARY is nil | 531 | /* See if we need to handle the case where MERGE_AT_BOUNDARY is nil |
| 530 | and POS is at beginning of a field, which can also be interpreted | 532 | and POS is at beginning of a field, which can also be interpreted |
| @@ -715,7 +717,8 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) | |||
| 715 | { | 717 | { |
| 716 | /* If non-zero, then the original point, before re-positioning. */ | 718 | /* If non-zero, then the original point, before re-positioning. */ |
| 717 | int orig_point = 0; | 719 | int orig_point = 0; |
| 718 | 720 | int fwd, prev_old, prev_new; | |
| 721 | |||
| 719 | if (NILP (new_pos)) | 722 | if (NILP (new_pos)) |
| 720 | /* Use the current point, and afterwards, set it. */ | 723 | /* Use the current point, and afterwards, set it. */ |
| 721 | { | 724 | { |
| @@ -723,23 +726,40 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) | |||
| 723 | XSETFASTINT (new_pos, PT); | 726 | XSETFASTINT (new_pos, PT); |
| 724 | } | 727 | } |
| 725 | 728 | ||
| 729 | CHECK_NUMBER_COERCE_MARKER (new_pos); | ||
| 730 | CHECK_NUMBER_COERCE_MARKER (old_pos); | ||
| 731 | |||
| 732 | fwd = (XFASTINT (new_pos) > XFASTINT (old_pos)); | ||
| 733 | |||
| 734 | prev_old = make_number (XFASTINT (old_pos) - 1); | ||
| 735 | prev_new = make_number (XFASTINT (new_pos) - 1); | ||
| 736 | |||
| 726 | if (NILP (Vinhibit_field_text_motion) | 737 | if (NILP (Vinhibit_field_text_motion) |
| 727 | && !EQ (new_pos, old_pos) | 738 | && !EQ (new_pos, old_pos) |
| 728 | && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) | 739 | && (!NILP (Fget_text_property (new_pos, Qfield, Qnil)) |
| 729 | || !NILP (Fget_char_property (old_pos, Qfield, Qnil))) | 740 | || !NILP (Fget_text_property (old_pos, Qfield, Qnil)) |
| 741 | /* To recognize field boundaries, we must also look at the | ||
| 742 | previous positions; we could use `get_pos_property' | ||
| 743 | instead, but in itself that would fail inside non-sticky | ||
| 744 | fields (like comint prompts). */ | ||
| 745 | || (XFASTINT (new_pos) > BEGV | ||
| 746 | && !NILP (Fget_text_property (prev_new, Qfield, Qnil))) | ||
| 747 | || (XFASTINT (old_pos) > BEGV | ||
| 748 | && !NILP (Fget_text_property (prev_old, Qfield, Qnil)))) | ||
| 730 | && (NILP (inhibit_capture_property) | 749 | && (NILP (inhibit_capture_property) |
| 731 | || NILP (Fget_char_property(old_pos, inhibit_capture_property, Qnil)))) | 750 | /* Field boundaries are again a problem; but now we must |
| 732 | /* NEW_POS is not within the same field as OLD_POS; try to | 751 | decide the case exactly, so we need to call |
| 733 | move NEW_POS so that it is. */ | 752 | `get_pos_property' as well. */ |
| 753 | || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil)) | ||
| 754 | && (XFASTINT (old_pos) <= BEGV | ||
| 755 | || NILP (Fget_text_property (old_pos, inhibit_capture_property, Qnil)) | ||
| 756 | || NILP (Fget_text_property (prev_old, inhibit_capture_property, Qnil)))))) | ||
| 757 | /* It is possible that NEW_POS is not within the same field as | ||
| 758 | OLD_POS; try to move NEW_POS so that it is. */ | ||
| 734 | { | 759 | { |
| 735 | int fwd, shortage; | 760 | int shortage; |
| 736 | Lisp_Object field_bound; | 761 | Lisp_Object field_bound; |
| 737 | 762 | ||
| 738 | CHECK_NUMBER_COERCE_MARKER (new_pos); | ||
| 739 | CHECK_NUMBER_COERCE_MARKER (old_pos); | ||
| 740 | |||
| 741 | fwd = (XFASTINT (new_pos) > XFASTINT (old_pos)); | ||
| 742 | |||
| 743 | if (fwd) | 763 | if (fwd) |
| 744 | field_bound = Ffield_end (old_pos, escape_from_edge, new_pos); | 764 | field_bound = Ffield_end (old_pos, escape_from_edge, new_pos); |
| 745 | else | 765 | else |
| @@ -780,9 +800,10 @@ DEFUN ("line-beginning-position", | |||
| 780 | With argument N not nil or 1, move forward N - 1 lines first. | 800 | With argument N not nil or 1, move forward N - 1 lines first. |
| 781 | If scan reaches end of buffer, return that position. | 801 | If scan reaches end of buffer, return that position. |
| 782 | 802 | ||
| 783 | The scan does not cross a field boundary unless doing so would move | 803 | This function constrains the returned position to the current field |
| 784 | beyond there to a different line; if N is nil or 1, and scan starts at a | 804 | unless that would be on a different line than the original, |
| 785 | field boundary, the scan stops as soon as it starts. To ignore field | 805 | unconstrained result. If N is nil or 1, and a front-sticky field |
| 806 | starts at point, the scan stops as soon as it starts. To ignore field | ||
| 786 | boundaries bind `inhibit-field-text-motion' to t. | 807 | boundaries bind `inhibit-field-text-motion' to t. |
| 787 | 808 | ||
| 788 | This function does not move point. */) | 809 | This function does not move point. */) |
| @@ -814,9 +835,10 @@ DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, | |||
| 814 | With argument N not nil or 1, move forward N - 1 lines first. | 835 | With argument N not nil or 1, move forward N - 1 lines first. |
| 815 | If scan reaches end of buffer, return that position. | 836 | If scan reaches end of buffer, return that position. |
| 816 | 837 | ||
| 817 | The scan does not cross a field boundary unless doing so would move | 838 | This function constrains the returned position to the current field |
| 818 | beyond there to a different line; if N is nil or 1, and scan starts at a | 839 | unless that would be on a different line than the original, |
| 819 | field boundary, the scan stops as soon as it starts. To ignore field | 840 | unconstrained result. If N is nil or 1, and a rear-sticky field ends |
| 841 | at point, the scan stops as soon as it starts. To ignore field | ||
| 820 | boundaries bind `inhibit-field-text-motion' to t. | 842 | boundaries bind `inhibit-field-text-motion' to t. |
| 821 | 843 | ||
| 822 | This function does not move point. */) | 844 | This function does not move point. */) |