diff options
| author | Miles Bader | 2000-07-22 13:37:47 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-07-22 13:37:47 +0000 |
| commit | ce6b02e050118c7bc5837bda0f6bc5568870fc91 (patch) | |
| tree | 29f7c4cfac1e6cb7a1b64772d3069dcc48757690 | |
| parent | e2db306902063e163b7343ec2287e837e3026ae5 (diff) | |
| download | emacs-ce6b02e050118c7bc5837bda0f6bc5568870fc91.tar.gz emacs-ce6b02e050118c7bc5837bda0f6bc5568870fc91.zip | |
(Fprevious_single_char_property_change):
The initial property value should be from the position preceding
POSITION, not following it.
| -rw-r--r-- | src/textprop.c | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/textprop.c b/src/textprop.c index 8160aaa6ec9..f96e6bb6e7d 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.") | |||
| 769 | } | 769 | } |
| 770 | else | 770 | else |
| 771 | { | 771 | { |
| 772 | Lisp_Object initial_value, value; | ||
| 773 | int count = specpdl_ptr - specpdl; | 772 | int count = specpdl_ptr - specpdl; |
| 774 | 773 | ||
| 775 | if (! NILP (object)) | 774 | if (! NILP (object)) |
| @@ -786,19 +785,31 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT.") | |||
| 786 | else | 785 | else |
| 787 | CHECK_NUMBER_COERCE_MARKER (limit, 0); | 786 | CHECK_NUMBER_COERCE_MARKER (limit, 0); |
| 788 | 787 | ||
| 789 | initial_value = Fget_char_property (position, prop, object); | 788 | if (XFASTINT (position) <= XFASTINT (limit)) |
| 790 | 789 | position = limit; | |
| 791 | for (;;) | 790 | else |
| 792 | { | 791 | { |
| 793 | position = Fprevious_char_property_change (position, limit); | 792 | Lisp_Object initial_value = |
| 794 | if (XFASTINT (position) <= XFASTINT (limit)) { | 793 | Fget_char_property (position - 1, prop, object); |
| 795 | position = limit; | 794 | |
| 796 | break; | 795 | for (;;) |
| 797 | } | 796 | { |
| 797 | position = Fprevious_char_property_change (position, limit); | ||
| 798 | 798 | ||
| 799 | value = Fget_char_property (position - 1, prop, object); | 799 | if (XFASTINT (position) <= XFASTINT (limit)) |
| 800 | if (!EQ (value, initial_value)) | 800 | { |
| 801 | break; | 801 | position = limit; |
| 802 | break; | ||
| 803 | } | ||
| 804 | else | ||
| 805 | { | ||
| 806 | Lisp_Object value = | ||
| 807 | Fget_char_property (position - 1, prop, object); | ||
| 808 | |||
| 809 | if (!EQ (value, initial_value)) | ||
| 810 | break; | ||
| 811 | } | ||
| 812 | } | ||
| 802 | } | 813 | } |
| 803 | 814 | ||
| 804 | unbind_to (count, Qnil); | 815 | unbind_to (count, Qnil); |