From ce6b02e050118c7bc5837bda0f6bc5568870fc91 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sat, 22 Jul 2000 13:37:47 +0000 Subject: [PATCH] (Fprevious_single_char_property_change): The initial property value should be from the position preceding POSITION, not following it. --- src/textprop.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/textprop.c b/src/textprop.c index 8160aaa6ec..f96e6bb6e7 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -769,7 +769,6 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT.") } else { - Lisp_Object initial_value, value; int count = specpdl_ptr - specpdl; if (! NILP (object)) @@ -786,19 +785,31 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT.") else CHECK_NUMBER_COERCE_MARKER (limit, 0); - initial_value = Fget_char_property (position, prop, object); - - for (;;) + if (XFASTINT (position) <= XFASTINT (limit)) + position = limit; + else { - position = Fprevious_char_property_change (position, limit); - if (XFASTINT (position) <= XFASTINT (limit)) { - position = limit; - break; - } + Lisp_Object initial_value = + Fget_char_property (position - 1, prop, object); + + for (;;) + { + position = Fprevious_char_property_change (position, limit); - value = Fget_char_property (position - 1, prop, object); - if (!EQ (value, initial_value)) - break; + if (XFASTINT (position) <= XFASTINT (limit)) + { + position = limit; + break; + } + else + { + Lisp_Object value = + Fget_char_property (position - 1, prop, object); + + if (!EQ (value, initial_value)) + break; + } + } } unbind_to (count, Qnil); -- 2.39.2