aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/editfns.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/editfns.c b/src/editfns.c
index d2734a0166a..2e5cc4a9463 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -281,25 +281,25 @@ If you set the marker not to point anywhere, the buffer will have no mark.")
281 for the text property PROP. */ 281 for the text property PROP. */
282 282
283static int 283static int
284text_property_eq (prop, pos1, pos2) 284char_property_eq (prop, pos1, pos2)
285 Lisp_Object prop; 285 Lisp_Object prop;
286 Lisp_Object pos1, pos2; 286 Lisp_Object pos1, pos2;
287{ 287{
288 Lisp_Object pval1, pval2; 288 Lisp_Object pval1, pval2;
289 289
290 pval1 = Fget_text_property (pos1, prop, Qnil); 290 pval1 = Fget_char_property (pos1, prop, Qnil);
291 pval2 = Fget_text_property (pos2, prop, Qnil); 291 pval2 = Fget_char_property (pos2, prop, Qnil);
292 292
293 return EQ (pval1, pval2); 293 return EQ (pval1, pval2);
294} 294}
295 295
296/* Return the direction from which the text-property PROP would be 296/* Return the direction from which the char-property PROP would be
297 inherited by any new text inserted at POS: 1 if it would be 297 inherited by any new text inserted at POS: 1 if it would be
298 inherited from the char after POS, -1 if it would be inherited from 298 inherited from the char after POS, -1 if it would be inherited from
299 the char before POS, and 0 if from neither. */ 299 the char before POS, and 0 if from neither. */
300 300
301static int 301static int
302text_property_stickiness (prop, pos) 302char_property_stickiness (prop, pos)
303 Lisp_Object prop; 303 Lisp_Object prop;
304 Lisp_Object pos; 304 Lisp_Object pos;
305{ 305{
@@ -311,7 +311,7 @@ text_property_stickiness (prop, pos)
311 Lisp_Object prev_pos, rear_non_sticky; 311 Lisp_Object prev_pos, rear_non_sticky;
312 312
313 prev_pos = make_number (XINT (pos) - 1); 313 prev_pos = make_number (XINT (pos) - 1);
314 rear_non_sticky = Fget_text_property (prev_pos, Qrear_nonsticky, Qnil); 314 rear_non_sticky = Fget_char_property (prev_pos, Qrear_nonsticky, Qnil);
315 315
316 if (EQ (rear_non_sticky, Qnil) 316 if (EQ (rear_non_sticky, Qnil)
317 || (CONSP (rear_non_sticky) 317 || (CONSP (rear_non_sticky)
@@ -322,7 +322,7 @@ text_property_stickiness (prop, pos)
322 } 322 }
323 323
324 /* Consider following character. */ 324 /* Consider following character. */
325 front_sticky = Fget_text_property (pos, Qfront_sticky, Qnil); 325 front_sticky = Fget_char_property (pos, Qfront_sticky, Qnil);
326 326
327 if (EQ (front_sticky, Qt) 327 if (EQ (front_sticky, Qt)
328 || (CONSP (front_sticky) 328 || (CONSP (front_sticky)
@@ -376,14 +376,14 @@ find_field (pos, merge_at_boundary, beg, end)
376 /* First see if POS is actually *at* a boundary. */ 376 /* First see if POS is actually *at* a boundary. */
377 Lisp_Object after_field, before_field; 377 Lisp_Object after_field, before_field;
378 378
379 after_field = Fget_text_property (pos, Qfield, Qnil); 379 after_field = Fget_char_property (pos, Qfield, Qnil);
380 before_field = Fget_text_property (make_number (XINT (pos) - 1), 380 before_field = Fget_char_property (make_number (XINT (pos) - 1),
381 Qfield, Qnil); 381 Qfield, Qnil);
382 382
383 if (! EQ (after_field, before_field)) 383 if (! EQ (after_field, before_field))
384 /* We are at a boundary, see which direction is inclusive. */ 384 /* We are at a boundary, see which direction is inclusive. */
385 { 385 {
386 int stickiness = text_property_stickiness (Qfield, pos); 386 int stickiness = char_property_stickiness (Qfield, pos);
387 387
388 if (stickiness > 0) 388 if (stickiness > 0)
389 at_field_start = 1; 389 at_field_start = 1;
@@ -391,7 +391,7 @@ find_field (pos, merge_at_boundary, beg, end)
391 at_field_end = 1; 391 at_field_end = 1;
392 else 392 else
393 /* STICKINESS == 0 means that any inserted text will get a 393 /* STICKINESS == 0 means that any inserted text will get a
394 `field' text-property of nil, so check to see if that 394 `field' char-property of nil, so check to see if that
395 matches either of the adjacent characters (this being a 395 matches either of the adjacent characters (this being a
396 kind of "stickiness by default"). */ 396 kind of "stickiness by default"). */
397 { 397 {
@@ -413,7 +413,8 @@ find_field (pos, merge_at_boundary, beg, end)
413 /* Find the previous field boundary. */ 413 /* Find the previous field boundary. */
414 { 414 {
415 Lisp_Object prev; 415 Lisp_Object prev;
416 prev = Fprevious_single_property_change (pos, Qfield, Qnil, Qnil); 416 prev =
417 Fprevious_single_char_property_change (pos, Qfield, Qnil, Qnil);
417 *beg = NILP (prev) ? BEGV : XFASTINT (prev); 418 *beg = NILP (prev) ? BEGV : XFASTINT (prev);
418 } 419 }
419 } 420 }
@@ -428,7 +429,7 @@ find_field (pos, merge_at_boundary, beg, end)
428 /* Find the next field boundary. */ 429 /* Find the next field boundary. */
429 { 430 {
430 Lisp_Object next; 431 Lisp_Object next;
431 next = Fnext_single_property_change (pos, Qfield, Qnil, Qnil); 432 next = Fnext_single_char_property_change (pos, Qfield, Qnil, Qnil);
432 *end = NILP (next) ? ZV : XFASTINT (next); 433 *end = NILP (next) ? ZV : XFASTINT (next);
433 } 434 }
434 } 435 }
@@ -509,7 +510,7 @@ constrained position if that is is different.\n\
509If OLD-POS is at the boundary of two fields, then the allowable\n\ 510If OLD-POS is at the boundary of two fields, then the allowable\n\
510positions for NEW-POS depends on the value of the optional argument\n\ 511positions for NEW-POS depends on the value of the optional argument\n\
511ESCAPE-FROM-EDGE: If ESCAPE-FROM-EDGE is nil, then NEW-POS is\n\ 512ESCAPE-FROM-EDGE: If ESCAPE-FROM-EDGE is nil, then NEW-POS is\n\
512constrained to the field that has the same `field' text-property\n\ 513constrained to the field that has the same `field' char-property\n\
513as any new characters inserted at OLD-POS, whereas if ESCAPE-FROM-EDGE\n\ 514as any new characters inserted at OLD-POS, whereas if ESCAPE-FROM-EDGE\n\
514is non-nil, NEW-POS is constrained to the union of the two adjacent\n\ 515is non-nil, NEW-POS is constrained to the union of the two adjacent\n\
515fields.\n\ 516fields.\n\
@@ -536,7 +537,7 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil.")
536 537
537 if (NILP (Vinhibit_field_text_motion) 538 if (NILP (Vinhibit_field_text_motion)
538 && !EQ (new_pos, old_pos) 539 && !EQ (new_pos, old_pos)
539 && !text_property_eq (Qfield, new_pos, old_pos)) 540 && !char_property_eq (Qfield, new_pos, old_pos))
540 /* NEW_POS is not within the same field as OLD_POS; try to 541 /* NEW_POS is not within the same field as OLD_POS; try to
541 move NEW_POS so that it is. */ 542 move NEW_POS so that it is. */
542 { 543 {