# HG changeset patch # User Miles Bader # Date 963674315 0 # Node ID bfc202f38a224f9bbb6df1f25b54e629be442949 # Parent c56062542bae2d2093322b3eaf28d8ac1ba1f382 (char_property_eq, char_property_stickiness): Renamed from `text_property_eq' and `text_property_stickiness', respectively. (find_field, Fconstrain_to_field, char_property_eq, char_property_stickiness): Changed to call char-property functions instead of text-property-only ones. diff -r c56062542bae -r bfc202f38a22 src/editfns.c --- a/src/editfns.c Sat Jul 15 15:17:11 2000 +0000 +++ b/src/editfns.c Sat Jul 15 15:18:35 2000 +0000 @@ -281,25 +281,25 @@ for the text property PROP. */ static int -text_property_eq (prop, pos1, pos2) +char_property_eq (prop, pos1, pos2) Lisp_Object prop; Lisp_Object pos1, pos2; { Lisp_Object pval1, pval2; - pval1 = Fget_text_property (pos1, prop, Qnil); - pval2 = Fget_text_property (pos2, prop, Qnil); + pval1 = Fget_char_property (pos1, prop, Qnil); + pval2 = Fget_char_property (pos2, prop, Qnil); return EQ (pval1, pval2); } -/* Return the direction from which the text-property PROP would be +/* Return the direction from which the char-property PROP would be inherited by any new text inserted at POS: 1 if it would be inherited from the char after POS, -1 if it would be inherited from the char before POS, and 0 if from neither. */ static int -text_property_stickiness (prop, pos) +char_property_stickiness (prop, pos) Lisp_Object prop; Lisp_Object pos; { @@ -311,7 +311,7 @@ Lisp_Object prev_pos, rear_non_sticky; prev_pos = make_number (XINT (pos) - 1); - rear_non_sticky = Fget_text_property (prev_pos, Qrear_nonsticky, Qnil); + rear_non_sticky = Fget_char_property (prev_pos, Qrear_nonsticky, Qnil); if (EQ (rear_non_sticky, Qnil) || (CONSP (rear_non_sticky) @@ -322,7 +322,7 @@ } /* Consider following character. */ - front_sticky = Fget_text_property (pos, Qfront_sticky, Qnil); + front_sticky = Fget_char_property (pos, Qfront_sticky, Qnil); if (EQ (front_sticky, Qt) || (CONSP (front_sticky) @@ -376,14 +376,14 @@ /* First see if POS is actually *at* a boundary. */ Lisp_Object after_field, before_field; - after_field = Fget_text_property (pos, Qfield, Qnil); - before_field = Fget_text_property (make_number (XINT (pos) - 1), + after_field = Fget_char_property (pos, Qfield, Qnil); + before_field = Fget_char_property (make_number (XINT (pos) - 1), Qfield, Qnil); if (! EQ (after_field, before_field)) /* We are at a boundary, see which direction is inclusive. */ { - int stickiness = text_property_stickiness (Qfield, pos); + int stickiness = char_property_stickiness (Qfield, pos); if (stickiness > 0) at_field_start = 1; @@ -391,7 +391,7 @@ at_field_end = 1; else /* STICKINESS == 0 means that any inserted text will get a - `field' text-property of nil, so check to see if that + `field' char-property of nil, so check to see if that matches either of the adjacent characters (this being a kind of "stickiness by default"). */ { @@ -413,7 +413,8 @@ /* Find the previous field boundary. */ { Lisp_Object prev; - prev = Fprevious_single_property_change (pos, Qfield, Qnil, Qnil); + prev = + Fprevious_single_char_property_change (pos, Qfield, Qnil, Qnil); *beg = NILP (prev) ? BEGV : XFASTINT (prev); } } @@ -428,7 +429,7 @@ /* Find the next field boundary. */ { Lisp_Object next; - next = Fnext_single_property_change (pos, Qfield, Qnil, Qnil); + next = Fnext_single_char_property_change (pos, Qfield, Qnil, Qnil); *end = NILP (next) ? ZV : XFASTINT (next); } } @@ -509,7 +510,7 @@ If OLD-POS is at the boundary of two fields, then the allowable\n\ positions for NEW-POS depends on the value of the optional argument\n\ ESCAPE-FROM-EDGE: If ESCAPE-FROM-EDGE is nil, then NEW-POS is\n\ -constrained to the field that has the same `field' text-property\n\ +constrained to the field that has the same `field' char-property\n\ as any new characters inserted at OLD-POS, whereas if ESCAPE-FROM-EDGE\n\ is non-nil, NEW-POS is constrained to the union of the two adjacent\n\ fields.\n\ @@ -536,7 +537,7 @@ if (NILP (Vinhibit_field_text_motion) && !EQ (new_pos, old_pos) - && !text_property_eq (Qfield, new_pos, old_pos)) + && !char_property_eq (Qfield, new_pos, old_pos)) /* NEW_POS is not within the same field as OLD_POS; try to move NEW_POS so that it is. */ {