Mercurial > emacs
comparison src/editfns.c @ 68392:a0208539b9a3
(Fconstrain_to_field): Use get_pos_property, not Fget_char_property,
to fix handling of field boundaries. Fix bogus comment.
(Fline_beginning_position, Fline_end_position): Clarify confusing doc
string.
author | Károly Lőrentey <lorentey@elte.hu> |
---|---|
date | Thu, 26 Jan 2006 03:12:45 +0000 |
parents | 8392b2926dd8 |
children | 0b6d0aad4517 |
comparison
equal
deleted
inserted
replaced
68391:64fbda7a8666 | 68392:a0208539b9a3 |
---|---|
725 XSETFASTINT (new_pos, PT); | 725 XSETFASTINT (new_pos, PT); |
726 } | 726 } |
727 | 727 |
728 if (NILP (Vinhibit_field_text_motion) | 728 if (NILP (Vinhibit_field_text_motion) |
729 && !EQ (new_pos, old_pos) | 729 && !EQ (new_pos, old_pos) |
730 && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) | 730 && (!NILP (get_pos_property (new_pos, Qfield, Qnil)) |
731 || !NILP (Fget_char_property (old_pos, Qfield, Qnil))) | 731 || !NILP (get_pos_property (old_pos, Qfield, Qnil))) |
732 && (NILP (inhibit_capture_property) | 732 && (NILP (inhibit_capture_property) |
733 || NILP (Fget_char_property(old_pos, inhibit_capture_property, Qnil)))) | 733 || NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil)))) |
734 /* NEW_POS is not within the same field as OLD_POS; try to | 734 /* It is possible that NEW_POS is not within the same field as |
735 move NEW_POS so that it is. */ | 735 OLD_POS; try to move NEW_POS so that it is. */ |
736 { | 736 { |
737 int fwd, shortage; | 737 int fwd, shortage; |
738 Lisp_Object field_bound; | 738 Lisp_Object field_bound; |
739 | 739 |
740 CHECK_NUMBER_COERCE_MARKER (new_pos); | 740 CHECK_NUMBER_COERCE_MARKER (new_pos); |
780 Fline_beginning_position, Sline_beginning_position, 0, 1, 0, | 780 Fline_beginning_position, Sline_beginning_position, 0, 1, 0, |
781 doc: /* Return the character position of the first character on the current line. | 781 doc: /* Return the character position of the first character on the current line. |
782 With argument N not nil or 1, move forward N - 1 lines first. | 782 With argument N not nil or 1, move forward N - 1 lines first. |
783 If scan reaches end of buffer, return that position. | 783 If scan reaches end of buffer, return that position. |
784 | 784 |
785 The scan does not cross a field boundary unless doing so would move | 785 This function constrains the returned position to the current field |
786 beyond there to a different line; if N is nil or 1, and scan starts at a | 786 unless that would be on a different line than the original, |
787 field boundary, the scan stops as soon as it starts. To ignore field | 787 unconstrained result. If N is nil or 1, and a front-sticky field |
788 starts at point, the scan stops as soon as it starts. To ignore field | |
788 boundaries bind `inhibit-field-text-motion' to t. | 789 boundaries bind `inhibit-field-text-motion' to t. |
789 | 790 |
790 This function does not move point. */) | 791 This function does not move point. */) |
791 (n) | 792 (n) |
792 Lisp_Object n; | 793 Lisp_Object n; |
814 DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, | 815 DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, |
815 doc: /* Return the character position of the last character on the current line. | 816 doc: /* Return the character position of the last character on the current line. |
816 With argument N not nil or 1, move forward N - 1 lines first. | 817 With argument N not nil or 1, move forward N - 1 lines first. |
817 If scan reaches end of buffer, return that position. | 818 If scan reaches end of buffer, return that position. |
818 | 819 |
819 The scan does not cross a field boundary unless doing so would move | 820 This function constrains the returned position to the current field |
820 beyond there to a different line; if N is nil or 1, and scan starts at a | 821 unless that would be on a different line than the original, |
821 field boundary, the scan stops as soon as it starts. To ignore field | 822 unconstrained result. If N is nil or 1, and a rear-sticky field ends |
823 at point, the scan stops as soon as it starts. To ignore field | |
822 boundaries bind `inhibit-field-text-motion' to t. | 824 boundaries bind `inhibit-field-text-motion' to t. |
823 | 825 |
824 This function does not move point. */) | 826 This function does not move point. */) |
825 (n) | 827 (n) |
826 Lisp_Object n; | 828 Lisp_Object n; |