diff options
| author | Miles Bader | 2007-04-11 00:17:47 +0000 |
|---|---|---|
| committer | Miles Bader | 2007-04-11 00:17:47 +0000 |
| commit | 57cb2e6f261bb0aad81a9f7e6f3017b54adee068 (patch) | |
| tree | 6ceb46f2e3bf08f16468d77f4fbfd201f637596a /src/intervals.c | |
| parent | 3bd1d328e94787ac52ef6ba5dfec3b94ba23917a (diff) | |
| parent | c429815a6b9d271a57eed4956125f6bc89d1d72b (diff) | |
| download | emacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.tar.gz emacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.zip | |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 675-697)
- Update from CVS
- Merge from gnus--rel--5.10
- Release ERC 5.2.
* gnus--rel--5.10 (patch 211-215)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-189
Diffstat (limited to 'src/intervals.c')
| -rw-r--r-- | src/intervals.c | 68 |
1 files changed, 39 insertions, 29 deletions
diff --git a/src/intervals.c b/src/intervals.c index ef97aa4973a..33ff321f0db 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -125,18 +125,24 @@ merge_properties (source, target) | |||
| 125 | while (CONSP (o)) | 125 | while (CONSP (o)) |
| 126 | { | 126 | { |
| 127 | sym = XCAR (o); | 127 | sym = XCAR (o); |
| 128 | val = Fmemq (sym, target->plist); | 128 | o = XCDR (o); |
| 129 | CHECK_CONS (o); | ||
| 130 | |||
| 131 | val = target->plist; | ||
| 132 | while (CONSP (val) && !EQ (XCAR (val), sym)) | ||
| 133 | { | ||
| 134 | val = XCDR (val); | ||
| 135 | if (!CONSP (val)) | ||
| 136 | break; | ||
| 137 | val = XCDR (val); | ||
| 138 | } | ||
| 129 | 139 | ||
| 130 | if (NILP (val)) | 140 | if (NILP (val)) |
| 131 | { | 141 | { |
| 132 | o = XCDR (o); | ||
| 133 | CHECK_CONS (o); | ||
| 134 | val = XCAR (o); | 142 | val = XCAR (o); |
| 135 | target->plist = Fcons (sym, Fcons (val, target->plist)); | 143 | target->plist = Fcons (sym, Fcons (val, target->plist)); |
| 136 | o = XCDR (o); | ||
| 137 | } | 144 | } |
| 138 | else | 145 | o = XCDR (o); |
| 139 | o = Fcdr (XCDR (o)); | ||
| 140 | } | 146 | } |
| 141 | } | 147 | } |
| 142 | 148 | ||
| @@ -147,8 +153,8 @@ int | |||
| 147 | intervals_equal (i0, i1) | 153 | intervals_equal (i0, i1) |
| 148 | INTERVAL i0, i1; | 154 | INTERVAL i0, i1; |
| 149 | { | 155 | { |
| 150 | register Lisp_Object i0_cdr, i0_sym, i1_val; | 156 | register Lisp_Object i0_cdr, i0_sym; |
| 151 | register int i1_len; | 157 | register Lisp_Object i1_cdr, i1_val; |
| 152 | 158 | ||
| 153 | if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1)) | 159 | if (DEFAULT_INTERVAL_P (i0) && DEFAULT_INTERVAL_P (i1)) |
| 154 | return 1; | 160 | return 1; |
| @@ -156,39 +162,43 @@ intervals_equal (i0, i1) | |||
| 156 | if (DEFAULT_INTERVAL_P (i0) || DEFAULT_INTERVAL_P (i1)) | 162 | if (DEFAULT_INTERVAL_P (i0) || DEFAULT_INTERVAL_P (i1)) |
| 157 | return 0; | 163 | return 0; |
| 158 | 164 | ||
| 159 | i1_len = XFASTINT (Flength (i1->plist)); | ||
| 160 | if (i1_len & 0x1) /* Paranoia -- plists are always even */ | ||
| 161 | abort (); | ||
| 162 | i1_len /= 2; | ||
| 163 | i0_cdr = i0->plist; | 165 | i0_cdr = i0->plist; |
| 164 | while (CONSP (i0_cdr)) | 166 | i1_cdr = i1->plist; |
| 167 | while (CONSP (i0_cdr) && CONSP (i1_cdr)) | ||
| 165 | { | 168 | { |
| 166 | /* Lengths of the two plists were unequal. */ | ||
| 167 | if (i1_len == 0) | ||
| 168 | return 0; | ||
| 169 | |||
| 170 | i0_sym = XCAR (i0_cdr); | 169 | i0_sym = XCAR (i0_cdr); |
| 171 | i1_val = Fmemq (i0_sym, i1->plist); | 170 | i0_cdr = XCDR (i0_cdr); |
| 171 | if (!CONSP (i0_cdr)) | ||
| 172 | return 0; /* abort (); */ | ||
| 173 | i1_val = i1->plist; | ||
| 174 | while (CONSP (i1_val) && !EQ (XCAR (i1_val), i0_sym)) | ||
| 175 | { | ||
| 176 | i1_val = XCDR (i1_val); | ||
| 177 | if (!CONSP (i1_val)) | ||
| 178 | return 0; /* abort (); */ | ||
| 179 | i1_val = XCDR (i1_val); | ||
| 180 | } | ||
| 172 | 181 | ||
| 173 | /* i0 has something i1 doesn't. */ | 182 | /* i0 has something i1 doesn't. */ |
| 174 | if (EQ (i1_val, Qnil)) | 183 | if (EQ (i1_val, Qnil)) |
| 175 | return 0; | 184 | return 0; |
| 176 | 185 | ||
| 177 | /* i0 and i1 both have sym, but it has different values in each. */ | 186 | /* i0 and i1 both have sym, but it has different values in each. */ |
| 178 | i0_cdr = XCDR (i0_cdr); | 187 | if (!CONSP (i1_val) |
| 179 | CHECK_CONS (i0_cdr); | 188 | || (i1_val = XCDR (i1_val), !CONSP (i1_val)) |
| 180 | if (!EQ (Fcar (Fcdr (i1_val)), XCAR (i0_cdr))) | 189 | || !EQ (XCAR (i1_val), XCAR (i0_cdr))) |
| 181 | return 0; | 190 | return 0; |
| 182 | 191 | ||
| 183 | i0_cdr = XCDR (i0_cdr); | 192 | i0_cdr = XCDR (i0_cdr); |
| 184 | i1_len--; | ||
| 185 | } | ||
| 186 | 193 | ||
| 187 | /* Lengths of the two plists were unequal. */ | 194 | i1_cdr = XCDR (i1_cdr); |
| 188 | if (i1_len > 0) | 195 | if (!CONSP (i1_cdr)) |
| 189 | return 0; | 196 | return 0; /* abort (); */ |
| 197 | i1_cdr = XCDR (i1_cdr); | ||
| 198 | } | ||
| 190 | 199 | ||
| 191 | return 1; | 200 | /* Lengths of the two plists were equal. */ |
| 201 | return (NILP (i0_cdr) && NILP (i1_cdr)); | ||
| 192 | } | 202 | } |
| 193 | 203 | ||
| 194 | 204 | ||
| @@ -2538,7 +2548,7 @@ set_intervals_multibyte_1 (i, multi_flag, start, start_byte, end, end_byte) | |||
| 2538 | temp = CHAR_TO_BYTE (left_end); | 2548 | temp = CHAR_TO_BYTE (left_end); |
| 2539 | 2549 | ||
| 2540 | /* If LEFT_END_BYTE is in the middle of a character, | 2550 | /* If LEFT_END_BYTE is in the middle of a character, |
| 2541 | adjust it and LEFT_END to a char boundary. */ | 2551 | adjust it and LEFT_END to a char boundary. */ |
| 2542 | if (left_end_byte > temp) | 2552 | if (left_end_byte > temp) |
| 2543 | { | 2553 | { |
| 2544 | left_end_byte = temp; | 2554 | left_end_byte = temp; |
| @@ -2570,7 +2580,7 @@ set_intervals_multibyte_1 (i, multi_flag, start, start_byte, end, end_byte) | |||
| 2570 | right_start = BYTE_TO_CHAR (right_start_byte); | 2580 | right_start = BYTE_TO_CHAR (right_start_byte); |
| 2571 | 2581 | ||
| 2572 | /* If RIGHT_START_BYTE is in the middle of a character, | 2582 | /* If RIGHT_START_BYTE is in the middle of a character, |
| 2573 | adjust it and RIGHT_START to a char boundary. */ | 2583 | adjust it and RIGHT_START to a char boundary. */ |
| 2574 | temp = CHAR_TO_BYTE (right_start); | 2584 | temp = CHAR_TO_BYTE (right_start); |
| 2575 | 2585 | ||
| 2576 | if (right_start_byte < temp) | 2586 | if (right_start_byte < temp) |