comparison lispref/text.texi @ 72975:77837c7f1fa0

(Fields): Clarify explanation of constrain-to-field.
author Richard M. Stallman <rms@gnu.org>
date Mon, 18 Sep 2006 21:56:26 +0000
parents 4300054c252b
children 3d45362f1d38 b5c13d1564a9
comparison
equal deleted inserted replaced
72974:54ea774c3eed 72975:77837c7f1fa0
3781 This function ``constrains'' @var{new-pos} to the field that 3781 This function ``constrains'' @var{new-pos} to the field that
3782 @var{old-pos} belongs to---in other words, it returns the position 3782 @var{old-pos} belongs to---in other words, it returns the position
3783 closest to @var{new-pos} that is in the same field as @var{old-pos}. 3783 closest to @var{new-pos} that is in the same field as @var{old-pos}.
3784 3784
3785 If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses 3785 If @var{new-pos} is @code{nil}, then @code{constrain-to-field} uses
3786 the value of point instead, and moves point to the resulting position. 3786 the value of point instead, and moves point to the resulting position
3787 as well as returning it.
3787 3788
3788 If @var{old-pos} is at the boundary of two fields, then the acceptable 3789 If @var{old-pos} is at the boundary of two fields, then the acceptable
3789 positions for @var{new-pos} depend on the value of the optional argument 3790 final positions depend on the argument @var{escape-from-edge}. If
3790 @var{escape-from-edge}. If @var{escape-from-edge} is @code{nil}, then 3791 @var{escape-from-edge} is @code{nil}, then @var{new-pos} must be in
3791 @var{new-pos} is constrained to the field that has the same @code{field} 3792 the field whose @code{field} property equals what new characters
3792 property (either a text-property or an overlay property) that new 3793 inserted at @var{old-pos} would inherit. (This depends on the
3793 characters inserted at @var{old-pos} would get. (This depends on the
3794 stickiness of the @code{field} property for the characters before and 3794 stickiness of the @code{field} property for the characters before and
3795 after @var{old-pos}.) If @var{escape-from-edge} is non-@code{nil}, 3795 after @var{old-pos}.) If @var{escape-from-edge} is non-@code{nil},
3796 @var{new-pos} is constrained to the union of the two adjacent fields. 3796 @var{new-pos} can be anywhere in the two adjacent fields.
3797 Additionally, if two fields are separated by another field with the 3797 Additionally, if two fields are separated by another field with the
3798 special value @code{boundary}, then any point within this special field 3798 special value @code{boundary}, then any point within this special
3799 is also considered to be ``on the boundary.'' 3799 field is also considered to be ``on the boundary.''
3800
3801 Commands like @kbd{C-a} with no argumemt, that normally move backward
3802 to a specific kind of location and stay there once there, probably
3803 should specify @code{nil} for @var{escape-from-edge}. Other motion
3804 commands that check fields should probably pass @code{t}.
3800 3805
3801 If the optional argument @var{only-in-line} is non-@code{nil}, and 3806 If the optional argument @var{only-in-line} is non-@code{nil}, and
3802 constraining @var{new-pos} in the usual way would move it to a different 3807 constraining @var{new-pos} in the usual way would move it to a different
3803 line, @var{new-pos} is returned unconstrained. This used in commands 3808 line, @var{new-pos} is returned unconstrained. This used in commands
3804 that move by line, such as @code{next-line} and 3809 that move by line, such as @code{next-line} and