Mercurial > emacs
comparison src/buffer.c @ 26164:d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
| author | Ken Raeburn <raeburn@raeburn.org> |
|---|---|
| date | Mon, 25 Oct 1999 04:58:18 +0000 |
| parents | b7aa6ac26872 |
| children | 8455090c3fb2 |
comparison
equal
deleted
inserted
replaced
| 26163:99c35bcce8c0 | 26164:d39ec0a27081 |
|---|---|
| 212 | 212 |
| 213 /* Remove from GENERAL any buffer that duplicates one in FRAMELIST. */ | 213 /* Remove from GENERAL any buffer that duplicates one in FRAMELIST. */ |
| 214 tail = framelist; | 214 tail = framelist; |
| 215 while (! NILP (tail)) | 215 while (! NILP (tail)) |
| 216 { | 216 { |
| 217 general = Fdelq (XCONS (tail)->car, general); | 217 general = Fdelq (XCAR (tail), general); |
| 218 tail = XCONS (tail)->cdr; | 218 tail = XCDR (tail); |
| 219 } | 219 } |
| 220 return nconc2 (framelist, general); | 220 return nconc2 (framelist, general); |
| 221 } | 221 } |
| 222 | 222 |
| 223 return general; | 223 return general; |
| 276 call the corresponding file handler. */ | 276 call the corresponding file handler. */ |
| 277 handler = Ffind_file_name_handler (filename, Qget_file_buffer); | 277 handler = Ffind_file_name_handler (filename, Qget_file_buffer); |
| 278 if (!NILP (handler)) | 278 if (!NILP (handler)) |
| 279 return call2 (handler, Qget_file_buffer, filename); | 279 return call2 (handler, Qget_file_buffer, filename); |
| 280 | 280 |
| 281 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) | 281 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) |
| 282 { | 282 { |
| 283 buf = Fcdr (XCONS (tail)->car); | 283 buf = Fcdr (XCAR (tail)); |
| 284 if (!BUFFERP (buf)) continue; | 284 if (!BUFFERP (buf)) continue; |
| 285 if (!STRINGP (XBUFFER (buf)->filename)) continue; | 285 if (!STRINGP (XBUFFER (buf)->filename)) continue; |
| 286 tem = Fstring_equal (XBUFFER (buf)->filename, filename); | 286 tem = Fstring_equal (XBUFFER (buf)->filename, filename); |
| 287 if (!NILP (tem)) | 287 if (!NILP (tem)) |
| 288 return buf; | 288 return buf; |
| 294 get_truename_buffer (filename) | 294 get_truename_buffer (filename) |
| 295 register Lisp_Object filename; | 295 register Lisp_Object filename; |
| 296 { | 296 { |
| 297 register Lisp_Object tail, buf, tem; | 297 register Lisp_Object tail, buf, tem; |
| 298 | 298 |
| 299 for (tail = Vbuffer_alist; CONSP (tail); tail = XCONS (tail)->cdr) | 299 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail)) |
| 300 { | 300 { |
| 301 buf = Fcdr (XCONS (tail)->car); | 301 buf = Fcdr (XCAR (tail)); |
| 302 if (!BUFFERP (buf)) continue; | 302 if (!BUFFERP (buf)) continue; |
| 303 if (!STRINGP (XBUFFER (buf)->file_truename)) continue; | 303 if (!STRINGP (XBUFFER (buf)->file_truename)) continue; |
| 304 tem = Fstring_equal (XBUFFER (buf)->file_truename, filename); | 304 tem = Fstring_equal (XBUFFER (buf)->file_truename, filename); |
| 305 if (!NILP (tem)) | 305 if (!NILP (tem)) |
| 306 return buf; | 306 return buf; |
| 729 | 729 |
| 730 result = Qnil; | 730 result = Qnil; |
| 731 | 731 |
| 732 { | 732 { |
| 733 register Lisp_Object tail; | 733 register Lisp_Object tail; |
| 734 for (tail = buf->local_var_alist; CONSP (tail); tail = XCONS (tail)->cdr) | 734 for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) |
| 735 { | 735 { |
| 736 Lisp_Object val, elt; | 736 Lisp_Object val, elt; |
| 737 | 737 |
| 738 elt = XCONS (tail)->car; | 738 elt = XCAR (tail); |
| 739 | 739 |
| 740 /* Reference each variable in the alist in buf. | 740 /* Reference each variable in the alist in buf. |
| 741 If inquiring about the current buffer, this gets the current values, | 741 If inquiring about the current buffer, this gets the current values, |
| 742 so store them into the alist so the alist is up to date. | 742 so store them into the alist so the alist is up to date. |
| 743 If inquiring about some other buffer, this swaps out any values | 743 If inquiring about some other buffer, this swaps out any values |
| 744 for that buffer, making the alist up to date automatically. */ | 744 for that buffer, making the alist up to date automatically. */ |
| 745 val = find_symbol_value (XCONS (elt)->car); | 745 val = find_symbol_value (XCAR (elt)); |
| 746 /* Use the current buffer value only if buf is the current buffer. */ | 746 /* Use the current buffer value only if buf is the current buffer. */ |
| 747 if (buf != current_buffer) | 747 if (buf != current_buffer) |
| 748 val = XCONS (elt)->cdr; | 748 val = XCDR (elt); |
| 749 | 749 |
| 750 /* If symbol is unbound, put just the symbol in the list. */ | 750 /* If symbol is unbound, put just the symbol in the list. */ |
| 751 if (EQ (val, Qunbound)) | 751 if (EQ (val, Qunbound)) |
| 752 result = Fcons (XCONS (elt)->car, result); | 752 result = Fcons (XCAR (elt), result); |
| 753 /* Otherwise, put (symbol . value) in the list. */ | 753 /* Otherwise, put (symbol . value) in the list. */ |
| 754 else | 754 else |
| 755 result = Fcons (Fcons (XCONS (elt)->car, val), result); | 755 result = Fcons (Fcons (XCAR (elt), val), result); |
| 756 } | 756 } |
| 757 } | 757 } |
| 758 | 758 |
| 759 /* Add on all the variables stored in special slots. */ | 759 /* Add on all the variables stored in special slots. */ |
| 760 { | 760 { |
| 926 | 926 |
| 927 tem = frame_buffer_list (frame); | 927 tem = frame_buffer_list (frame); |
| 928 add_ons = Qnil; | 928 add_ons = Qnil; |
| 929 while (CONSP (tem)) | 929 while (CONSP (tem)) |
| 930 { | 930 { |
| 931 if (BUFFERP (XCONS (tem)->car)) | 931 if (BUFFERP (XCAR (tem))) |
| 932 add_ons = Fcons (Fcons (Qnil, XCONS (tem)->car), add_ons); | 932 add_ons = Fcons (Fcons (Qnil, XCAR (tem)), add_ons); |
| 933 tem = XCONS (tem)->cdr; | 933 tem = XCDR (tem); |
| 934 } | 934 } |
| 935 tail = nconc2 (Fnreverse (add_ons), tail); | 935 tail = nconc2 (Fnreverse (add_ons), tail); |
| 936 | 936 |
| 937 for (; !NILP (tail); tail = Fcdr (tail)) | 937 for (; !NILP (tail); tail = Fcdr (tail)) |
| 938 { | 938 { |
| 1235 register Lisp_Object link, prev; | 1235 register Lisp_Object link, prev; |
| 1236 Lisp_Object frame; | 1236 Lisp_Object frame; |
| 1237 frame = selected_frame; | 1237 frame = selected_frame; |
| 1238 | 1238 |
| 1239 prev = Qnil; | 1239 prev = Qnil; |
| 1240 for (link = Vbuffer_alist; CONSP (link); link = XCONS (link)->cdr) | 1240 for (link = Vbuffer_alist; CONSP (link); link = XCDR (link)) |
| 1241 { | 1241 { |
| 1242 if (EQ (XCONS (XCONS (link)->car)->cdr, buf)) | 1242 if (EQ (XCDR (XCAR (link)), buf)) |
| 1243 break; | 1243 break; |
| 1244 prev = link; | 1244 prev = link; |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist); | 1247 /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist); |
| 1248 we cannot use Fdelq itself here because it allows quitting. */ | 1248 we cannot use Fdelq itself here because it allows quitting. */ |
| 1249 | 1249 |
| 1250 if (NILP (prev)) | 1250 if (NILP (prev)) |
| 1251 Vbuffer_alist = XCONS (Vbuffer_alist)->cdr; | 1251 Vbuffer_alist = XCDR (Vbuffer_alist); |
| 1252 else | 1252 else |
| 1253 XCONS (prev)->cdr = XCONS (XCONS (prev)->cdr)->cdr; | 1253 XCDR (prev) = XCDR (XCDR (prev)); |
| 1254 | 1254 |
| 1255 XCONS (link)->cdr = Vbuffer_alist; | 1255 XCDR (link) = Vbuffer_alist; |
| 1256 Vbuffer_alist = link; | 1256 Vbuffer_alist = link; |
| 1257 | 1257 |
| 1258 /* Now move this buffer to the front of frame_buffer_list also. */ | 1258 /* Now move this buffer to the front of frame_buffer_list also. */ |
| 1259 | 1259 |
| 1260 prev = Qnil; | 1260 prev = Qnil; |
| 1261 for (link = frame_buffer_list (frame); CONSP (link); | 1261 for (link = frame_buffer_list (frame); CONSP (link); |
| 1262 link = XCONS (link)->cdr) | 1262 link = XCDR (link)) |
| 1263 { | 1263 { |
| 1264 if (EQ (XCONS (link)->car, buf)) | 1264 if (EQ (XCAR (link), buf)) |
| 1265 break; | 1265 break; |
| 1266 prev = link; | 1266 prev = link; |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 /* Effectively do delq. */ | 1269 /* Effectively do delq. */ |
| 1270 | 1270 |
| 1271 if (CONSP (link)) | 1271 if (CONSP (link)) |
| 1272 { | 1272 { |
| 1273 if (NILP (prev)) | 1273 if (NILP (prev)) |
| 1274 set_frame_buffer_list (frame, | 1274 set_frame_buffer_list (frame, |
| 1275 XCONS (frame_buffer_list (frame))->cdr); | 1275 XCDR (frame_buffer_list (frame))); |
| 1276 else | 1276 else |
| 1277 XCONS (prev)->cdr = XCONS (XCONS (prev)->cdr)->cdr; | 1277 XCDR (prev) = XCDR (XCDR (prev)); |
| 1278 | 1278 |
| 1279 XCONS (link)->cdr = frame_buffer_list (frame); | 1279 XCDR (link) = frame_buffer_list (frame); |
| 1280 set_frame_buffer_list (frame, link); | 1280 set_frame_buffer_list (frame, link); |
| 1281 } | 1281 } |
| 1282 else | 1282 else |
| 1283 set_frame_buffer_list (frame, Fcons (buf, frame_buffer_list (frame))); | 1283 set_frame_buffer_list (frame, Fcons (buf, frame_buffer_list (frame))); |
| 1284 } | 1284 } |
| 1514 } | 1514 } |
| 1515 | 1515 |
| 1516 /* Look down buffer's list of local Lisp variables | 1516 /* Look down buffer's list of local Lisp variables |
| 1517 to find and update any that forward into C variables. */ | 1517 to find and update any that forward into C variables. */ |
| 1518 | 1518 |
| 1519 for (tail = b->local_var_alist; !NILP (tail); tail = XCONS (tail)->cdr) | 1519 for (tail = b->local_var_alist; !NILP (tail); tail = XCDR (tail)) |
| 1520 { | 1520 { |
| 1521 valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; | 1521 valcontents = XSYMBOL (XCAR (XCAR (tail)))->value; |
| 1522 if ((BUFFER_LOCAL_VALUEP (valcontents) | 1522 if ((BUFFER_LOCAL_VALUEP (valcontents) |
| 1523 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | 1523 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
| 1524 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | 1524 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, |
| 1525 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | 1525 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) |
| 1526 /* Just reference the variable | 1526 /* Just reference the variable |
| 1527 to cause it to become set for this buffer. */ | 1527 to cause it to become set for this buffer. */ |
| 1528 Fsymbol_value (XCONS (XCONS (tail)->car)->car); | 1528 Fsymbol_value (XCAR (XCAR (tail))); |
| 1529 } | 1529 } |
| 1530 | 1530 |
| 1531 /* Do the same with any others that were local to the previous buffer */ | 1531 /* Do the same with any others that were local to the previous buffer */ |
| 1532 | 1532 |
| 1533 if (old_buf) | 1533 if (old_buf) |
| 1534 for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCONS (tail)->cdr) | 1534 for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCDR (tail)) |
| 1535 { | 1535 { |
| 1536 valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; | 1536 valcontents = XSYMBOL (XCAR (XCAR (tail)))->value; |
| 1537 if ((BUFFER_LOCAL_VALUEP (valcontents) | 1537 if ((BUFFER_LOCAL_VALUEP (valcontents) |
| 1538 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | 1538 || SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
| 1539 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, | 1539 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, |
| 1540 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) | 1540 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) |
| 1541 /* Just reference the variable | 1541 /* Just reference the variable |
| 1542 to cause it to become set for this buffer. */ | 1542 to cause it to become set for this buffer. */ |
| 1543 Fsymbol_value (XCONS (XCONS (tail)->car)->car); | 1543 Fsymbol_value (XCAR (XCAR (tail))); |
| 1544 } | 1544 } |
| 1545 } | 1545 } |
| 1546 | 1546 |
| 1547 /* Switch to buffer B temporarily for redisplay purposes. | 1547 /* Switch to buffer B temporarily for redisplay purposes. |
| 1548 This avoids certain things that don't need to be done within redisplay. */ | 1548 This avoids certain things that don't need to be done within redisplay. */ |
| 1680 register Lisp_Object aelt, link; | 1680 register Lisp_Object aelt, link; |
| 1681 | 1681 |
| 1682 aelt = Frassq (buffer, Vbuffer_alist); | 1682 aelt = Frassq (buffer, Vbuffer_alist); |
| 1683 link = Fmemq (aelt, Vbuffer_alist); | 1683 link = Fmemq (aelt, Vbuffer_alist); |
| 1684 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); | 1684 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); |
| 1685 XCONS (link)->cdr = Qnil; | 1685 XCDR (link) = Qnil; |
| 1686 Vbuffer_alist = nconc2 (Vbuffer_alist, link); | 1686 Vbuffer_alist = nconc2 (Vbuffer_alist, link); |
| 1687 } | 1687 } |
| 1688 | 1688 |
| 1689 frames_bury_buffer (buffer); | 1689 frames_bury_buffer (buffer); |
| 1690 | 1690 |
| 1933 update_mode_lines++; | 1933 update_mode_lines++; |
| 1934 | 1934 |
| 1935 /* Any which are supposed to be permanent, | 1935 /* Any which are supposed to be permanent, |
| 1936 make local again, with the same values they had. */ | 1936 make local again, with the same values they had. */ |
| 1937 | 1937 |
| 1938 for (alist = oalist; !NILP (alist); alist = XCONS (alist)->cdr) | 1938 for (alist = oalist; !NILP (alist); alist = XCDR (alist)) |
| 1939 { | 1939 { |
| 1940 sym = XCONS (XCONS (alist)->car)->car; | 1940 sym = XCAR (XCAR (alist)); |
| 1941 tem = Fget (sym, Qpermanent_local); | 1941 tem = Fget (sym, Qpermanent_local); |
| 1942 if (! NILP (tem)) | 1942 if (! NILP (tem)) |
| 1943 { | 1943 { |
| 1944 Fmake_local_variable (sym); | 1944 Fmake_local_variable (sym); |
| 1945 Fset (sym, XCONS (XCONS (alist)->car)->cdr); | 1945 Fset (sym, XCDR (XCAR (alist))); |
| 1946 } | 1946 } |
| 1947 } | 1947 } |
| 1948 | 1948 |
| 1949 /* Force mode-line redisplay. Useful here because all major mode | 1949 /* Force mode-line redisplay. Useful here because all major mode |
| 1950 commands call this function. */ | 1950 commands call this function. */ |
| 1963 Lisp_Object oalist, alist, sym, tem, buffer; | 1963 Lisp_Object oalist, alist, sym, tem, buffer; |
| 1964 | 1964 |
| 1965 XSETBUFFER (buffer, b); | 1965 XSETBUFFER (buffer, b); |
| 1966 oalist = b->local_var_alist; | 1966 oalist = b->local_var_alist; |
| 1967 | 1967 |
| 1968 for (alist = oalist; !NILP (alist); alist = XCONS (alist)->cdr) | 1968 for (alist = oalist; !NILP (alist); alist = XCDR (alist)) |
| 1969 { | 1969 { |
| 1970 sym = XCONS (XCONS (alist)->car)->car; | 1970 sym = XCAR (XCAR (alist)); |
| 1971 | 1971 |
| 1972 /* Need not do anything if some other buffer's binding is now encached. */ | 1972 /* Need not do anything if some other buffer's binding is now encached. */ |
| 1973 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer; | 1973 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer; |
| 1974 if (XBUFFER (tem) == current_buffer) | 1974 if (XBUFFER (tem) == current_buffer) |
| 1975 { | 1975 { |
| 1979 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr; | 1979 tem = XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->cdr; |
| 1980 /* Store the symbol's current value into the alist entry | 1980 /* Store the symbol's current value into the alist entry |
| 1981 it is currently set up for. This is so that, if the | 1981 it is currently set up for. This is so that, if the |
| 1982 local is marked permanent, and we make it local again | 1982 local is marked permanent, and we make it local again |
| 1983 later in Fkill_all_local_variables, we don't lose the value. */ | 1983 later in Fkill_all_local_variables, we don't lose the value. */ |
| 1984 XCONS (XCONS (tem)->car)->cdr | 1984 XCDR (XCAR (tem)) |
| 1985 = do_symval_forwarding (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue); | 1985 = do_symval_forwarding (XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue); |
| 1986 /* Switch to the symbol's default-value alist entry. */ | 1986 /* Switch to the symbol's default-value alist entry. */ |
| 1987 XCONS (tem)->car = tem; | 1987 XCAR (tem) = tem; |
| 1988 /* Mark it as current for buffer B. */ | 1988 /* Mark it as current for buffer B. */ |
| 1989 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer = buffer; | 1989 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->buffer = buffer; |
| 1990 /* Store the current value into any forwarding in the symbol. */ | 1990 /* Store the current value into any forwarding in the symbol. */ |
| 1991 store_symval_forwarding (sym, | 1991 store_symval_forwarding (sym, |
| 1992 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue, | 1992 XBUFFER_LOCAL_VALUE (XSYMBOL (sym)->value)->realvalue, |
| 1993 XCONS (tem)->cdr); | 1993 XCDR (tem)); |
| 1994 } | 1994 } |
| 1995 } | 1995 } |
| 1996 } | 1996 } |
| 1997 | 1997 |
| 1998 /* Find all the overlays in the current buffer that contain position POS. | 1998 /* Find all the overlays in the current buffer that contain position POS. |
| 2030 int prev = BEGV; | 2030 int prev = BEGV; |
| 2031 int inhibit_storing = 0; | 2031 int inhibit_storing = 0; |
| 2032 | 2032 |
| 2033 for (tail = current_buffer->overlays_before; | 2033 for (tail = current_buffer->overlays_before; |
| 2034 GC_CONSP (tail); | 2034 GC_CONSP (tail); |
| 2035 tail = XCONS (tail)->cdr) | 2035 tail = XCDR (tail)) |
| 2036 { | 2036 { |
| 2037 int startpos, endpos; | 2037 int startpos, endpos; |
| 2038 | 2038 |
| 2039 overlay = XCONS (tail)->car; | 2039 overlay = XCAR (tail); |
| 2040 | 2040 |
| 2041 start = OVERLAY_START (overlay); | 2041 start = OVERLAY_START (overlay); |
| 2042 end = OVERLAY_END (overlay); | 2042 end = OVERLAY_END (overlay); |
| 2043 endpos = OVERLAY_POSITION (end); | 2043 endpos = OVERLAY_POSITION (end); |
| 2044 if (endpos < pos) | 2044 if (endpos < pos) |
| 2083 next = startpos; | 2083 next = startpos; |
| 2084 } | 2084 } |
| 2085 | 2085 |
| 2086 for (tail = current_buffer->overlays_after; | 2086 for (tail = current_buffer->overlays_after; |
| 2087 GC_CONSP (tail); | 2087 GC_CONSP (tail); |
| 2088 tail = XCONS (tail)->cdr) | 2088 tail = XCDR (tail)) |
| 2089 { | 2089 { |
| 2090 int startpos, endpos; | 2090 int startpos, endpos; |
| 2091 | 2091 |
| 2092 overlay = XCONS (tail)->car; | 2092 overlay = XCAR (tail); |
| 2093 | 2093 |
| 2094 start = OVERLAY_START (overlay); | 2094 start = OVERLAY_START (overlay); |
| 2095 end = OVERLAY_END (overlay); | 2095 end = OVERLAY_END (overlay); |
| 2096 startpos = OVERLAY_POSITION (start); | 2096 startpos = OVERLAY_POSITION (start); |
| 2097 if (pos < startpos) | 2097 if (pos < startpos) |
| 2173 int prev = BEGV; | 2173 int prev = BEGV; |
| 2174 int inhibit_storing = 0; | 2174 int inhibit_storing = 0; |
| 2175 | 2175 |
| 2176 for (tail = current_buffer->overlays_before; | 2176 for (tail = current_buffer->overlays_before; |
| 2177 GC_CONSP (tail); | 2177 GC_CONSP (tail); |
| 2178 tail = XCONS (tail)->cdr) | 2178 tail = XCDR (tail)) |
| 2179 { | 2179 { |
| 2180 int startpos, endpos; | 2180 int startpos, endpos; |
| 2181 | 2181 |
| 2182 overlay = XCONS (tail)->car; | 2182 overlay = XCAR (tail); |
| 2183 | 2183 |
| 2184 ostart = OVERLAY_START (overlay); | 2184 ostart = OVERLAY_START (overlay); |
| 2185 oend = OVERLAY_END (overlay); | 2185 oend = OVERLAY_END (overlay); |
| 2186 endpos = OVERLAY_POSITION (oend); | 2186 endpos = OVERLAY_POSITION (oend); |
| 2187 if (endpos < beg) | 2187 if (endpos < beg) |
| 2219 next = startpos; | 2219 next = startpos; |
| 2220 } | 2220 } |
| 2221 | 2221 |
| 2222 for (tail = current_buffer->overlays_after; | 2222 for (tail = current_buffer->overlays_after; |
| 2223 GC_CONSP (tail); | 2223 GC_CONSP (tail); |
| 2224 tail = XCONS (tail)->cdr) | 2224 tail = XCDR (tail)) |
| 2225 { | 2225 { |
| 2226 int startpos, endpos; | 2226 int startpos, endpos; |
| 2227 | 2227 |
| 2228 overlay = XCONS (tail)->car; | 2228 overlay = XCAR (tail); |
| 2229 | 2229 |
| 2230 ostart = OVERLAY_START (overlay); | 2230 ostart = OVERLAY_START (overlay); |
| 2231 oend = OVERLAY_END (overlay); | 2231 oend = OVERLAY_END (overlay); |
| 2232 startpos = OVERLAY_POSITION (ostart); | 2232 startpos = OVERLAY_POSITION (ostart); |
| 2233 if (end < startpos) | 2233 if (end < startpos) |
| 2275 int pos; | 2275 int pos; |
| 2276 { | 2276 { |
| 2277 Lisp_Object tail, overlay; | 2277 Lisp_Object tail, overlay; |
| 2278 | 2278 |
| 2279 for (tail = current_buffer->overlays_before; GC_CONSP (tail); | 2279 for (tail = current_buffer->overlays_before; GC_CONSP (tail); |
| 2280 tail = XCONS (tail)->cdr) | 2280 tail = XCDR (tail)) |
| 2281 { | 2281 { |
| 2282 int endpos; | 2282 int endpos; |
| 2283 | 2283 |
| 2284 overlay = XCONS (tail)->car; | 2284 overlay = XCAR (tail); |
| 2285 if (!GC_OVERLAYP (overlay)) | 2285 if (!GC_OVERLAYP (overlay)) |
| 2286 abort (); | 2286 abort (); |
| 2287 | 2287 |
| 2288 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2288 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 2289 if (endpos < pos) | 2289 if (endpos < pos) |
| 2291 if (endpos == pos || OVERLAY_POSITION (OVERLAY_START (overlay)) == pos) | 2291 if (endpos == pos || OVERLAY_POSITION (OVERLAY_START (overlay)) == pos) |
| 2292 return 1; | 2292 return 1; |
| 2293 } | 2293 } |
| 2294 | 2294 |
| 2295 for (tail = current_buffer->overlays_after; GC_CONSP (tail); | 2295 for (tail = current_buffer->overlays_after; GC_CONSP (tail); |
| 2296 tail = XCONS (tail)->cdr) | 2296 tail = XCDR (tail)) |
| 2297 { | 2297 { |
| 2298 int startpos; | 2298 int startpos; |
| 2299 | 2299 |
| 2300 overlay = XCONS (tail)->car; | 2300 overlay = XCAR (tail); |
| 2301 if (!GC_OVERLAYP (overlay)) | 2301 if (!GC_OVERLAYP (overlay)) |
| 2302 abort (); | 2302 abort (); |
| 2303 | 2303 |
| 2304 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2304 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2305 if (pos < startpos) | 2305 if (pos < startpos) |
| 2500 int startpos, endpos; | 2500 int startpos, endpos; |
| 2501 int multibyte = ! NILP (current_buffer->enable_multibyte_characters); | 2501 int multibyte = ! NILP (current_buffer->enable_multibyte_characters); |
| 2502 | 2502 |
| 2503 overlay_heads.used = overlay_heads.bytes = 0; | 2503 overlay_heads.used = overlay_heads.bytes = 0; |
| 2504 overlay_tails.used = overlay_tails.bytes = 0; | 2504 overlay_tails.used = overlay_tails.bytes = 0; |
| 2505 for (ov = current_buffer->overlays_before; CONSP (ov); ov = XCONS (ov)->cdr) | 2505 for (ov = current_buffer->overlays_before; CONSP (ov); ov = XCDR (ov)) |
| 2506 { | 2506 { |
| 2507 overlay = XCONS (ov)->car; | 2507 overlay = XCAR (ov); |
| 2508 if (!OVERLAYP (overlay)) | 2508 if (!OVERLAYP (overlay)) |
| 2509 abort (); | 2509 abort (); |
| 2510 | 2510 |
| 2511 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2511 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2512 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2512 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 2529 && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))) | 2529 && (str = Foverlay_get (overlay, Qafter_string), STRINGP (str))) |
| 2530 record_overlay_string (&overlay_tails, str, Qnil, | 2530 record_overlay_string (&overlay_tails, str, Qnil, |
| 2531 Foverlay_get (overlay, Qpriority), | 2531 Foverlay_get (overlay, Qpriority), |
| 2532 endpos - startpos); | 2532 endpos - startpos); |
| 2533 } | 2533 } |
| 2534 for (ov = current_buffer->overlays_after; CONSP (ov); ov = XCONS (ov)->cdr) | 2534 for (ov = current_buffer->overlays_after; CONSP (ov); ov = XCDR (ov)) |
| 2535 { | 2535 { |
| 2536 overlay = XCONS (ov)->car; | 2536 overlay = XCAR (ov); |
| 2537 if (!OVERLAYP (overlay)) | 2537 if (!OVERLAYP (overlay)) |
| 2538 abort (); | 2538 abort (); |
| 2539 | 2539 |
| 2540 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2540 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2541 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2541 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 2632 prev = Qnil; | 2632 prev = Qnil; |
| 2633 for (tail = buf->overlays_before; | 2633 for (tail = buf->overlays_before; |
| 2634 CONSP (tail); | 2634 CONSP (tail); |
| 2635 prev = tail, tail = next) | 2635 prev = tail, tail = next) |
| 2636 { | 2636 { |
| 2637 next = XCONS (tail)->cdr; | 2637 next = XCDR (tail); |
| 2638 overlay = XCONS (tail)->car; | 2638 overlay = XCAR (tail); |
| 2639 | 2639 |
| 2640 /* If the overlay is not valid, get rid of it. */ | 2640 /* If the overlay is not valid, get rid of it. */ |
| 2641 if (!OVERLAY_VALID (overlay)) | 2641 if (!OVERLAY_VALID (overlay)) |
| 2642 #if 1 | 2642 #if 1 |
| 2643 abort (); | 2643 abort (); |
| 2644 #else | 2644 #else |
| 2645 { | 2645 { |
| 2646 /* Splice the cons cell TAIL out of overlays_before. */ | 2646 /* Splice the cons cell TAIL out of overlays_before. */ |
| 2647 if (!NILP (prev)) | 2647 if (!NILP (prev)) |
| 2648 XCONS (prev)->cdr = next; | 2648 XCDR (prev) = next; |
| 2649 else | 2649 else |
| 2650 buf->overlays_before = next; | 2650 buf->overlays_before = next; |
| 2651 tail = prev; | 2651 tail = prev; |
| 2652 continue; | 2652 continue; |
| 2653 } | 2653 } |
| 2662 int where = OVERLAY_POSITION (beg); | 2662 int where = OVERLAY_POSITION (beg); |
| 2663 Lisp_Object other, other_prev; | 2663 Lisp_Object other, other_prev; |
| 2664 | 2664 |
| 2665 /* Splice the cons cell TAIL out of overlays_before. */ | 2665 /* Splice the cons cell TAIL out of overlays_before. */ |
| 2666 if (!NILP (prev)) | 2666 if (!NILP (prev)) |
| 2667 XCONS (prev)->cdr = next; | 2667 XCDR (prev) = next; |
| 2668 else | 2668 else |
| 2669 buf->overlays_before = next; | 2669 buf->overlays_before = next; |
| 2670 | 2670 |
| 2671 /* Search thru overlays_after for where to put it. */ | 2671 /* Search thru overlays_after for where to put it. */ |
| 2672 other_prev = Qnil; | 2672 other_prev = Qnil; |
| 2673 for (other = buf->overlays_after; | 2673 for (other = buf->overlays_after; |
| 2674 CONSP (other); | 2674 CONSP (other); |
| 2675 other_prev = other, other = XCONS (other)->cdr) | 2675 other_prev = other, other = XCDR (other)) |
| 2676 { | 2676 { |
| 2677 Lisp_Object otherbeg, otheroverlay; | 2677 Lisp_Object otherbeg, otheroverlay; |
| 2678 | 2678 |
| 2679 otheroverlay = XCONS (other)->car; | 2679 otheroverlay = XCAR (other); |
| 2680 if (! OVERLAY_VALID (otheroverlay)) | 2680 if (! OVERLAY_VALID (otheroverlay)) |
| 2681 abort (); | 2681 abort (); |
| 2682 | 2682 |
| 2683 otherbeg = OVERLAY_START (otheroverlay); | 2683 otherbeg = OVERLAY_START (otheroverlay); |
| 2684 if (OVERLAY_POSITION (otherbeg) >= where) | 2684 if (OVERLAY_POSITION (otherbeg) >= where) |
| 2685 break; | 2685 break; |
| 2686 } | 2686 } |
| 2687 | 2687 |
| 2688 /* Add TAIL to overlays_after before OTHER. */ | 2688 /* Add TAIL to overlays_after before OTHER. */ |
| 2689 XCONS (tail)->cdr = other; | 2689 XCDR (tail) = other; |
| 2690 if (!NILP (other_prev)) | 2690 if (!NILP (other_prev)) |
| 2691 XCONS (other_prev)->cdr = tail; | 2691 XCDR (other_prev) = tail; |
| 2692 else | 2692 else |
| 2693 buf->overlays_after = tail; | 2693 buf->overlays_after = tail; |
| 2694 tail = prev; | 2694 tail = prev; |
| 2695 } | 2695 } |
| 2696 else | 2696 else |
| 2704 prev = Qnil; | 2704 prev = Qnil; |
| 2705 for (tail = buf->overlays_after; | 2705 for (tail = buf->overlays_after; |
| 2706 CONSP (tail); | 2706 CONSP (tail); |
| 2707 prev = tail, tail = next) | 2707 prev = tail, tail = next) |
| 2708 { | 2708 { |
| 2709 next = XCONS (tail)->cdr; | 2709 next = XCDR (tail); |
| 2710 overlay = XCONS (tail)->car; | 2710 overlay = XCAR (tail); |
| 2711 | 2711 |
| 2712 /* If the overlay is not valid, get rid of it. */ | 2712 /* If the overlay is not valid, get rid of it. */ |
| 2713 if (!OVERLAY_VALID (overlay)) | 2713 if (!OVERLAY_VALID (overlay)) |
| 2714 #if 1 | 2714 #if 1 |
| 2715 abort (); | 2715 abort (); |
| 2716 #else | 2716 #else |
| 2717 { | 2717 { |
| 2718 /* Splice the cons cell TAIL out of overlays_after. */ | 2718 /* Splice the cons cell TAIL out of overlays_after. */ |
| 2719 if (!NILP (prev)) | 2719 if (!NILP (prev)) |
| 2720 XCONS (prev)->cdr = next; | 2720 XCDR (prev) = next; |
| 2721 else | 2721 else |
| 2722 buf->overlays_after = next; | 2722 buf->overlays_after = next; |
| 2723 tail = prev; | 2723 tail = prev; |
| 2724 continue; | 2724 continue; |
| 2725 } | 2725 } |
| 2739 int where = OVERLAY_POSITION (end); | 2739 int where = OVERLAY_POSITION (end); |
| 2740 Lisp_Object other, other_prev; | 2740 Lisp_Object other, other_prev; |
| 2741 | 2741 |
| 2742 /* Splice the cons cell TAIL out of overlays_after. */ | 2742 /* Splice the cons cell TAIL out of overlays_after. */ |
| 2743 if (!NILP (prev)) | 2743 if (!NILP (prev)) |
| 2744 XCONS (prev)->cdr = next; | 2744 XCDR (prev) = next; |
| 2745 else | 2745 else |
| 2746 buf->overlays_after = next; | 2746 buf->overlays_after = next; |
| 2747 | 2747 |
| 2748 /* Search thru overlays_before for where to put it. */ | 2748 /* Search thru overlays_before for where to put it. */ |
| 2749 other_prev = Qnil; | 2749 other_prev = Qnil; |
| 2750 for (other = buf->overlays_before; | 2750 for (other = buf->overlays_before; |
| 2751 CONSP (other); | 2751 CONSP (other); |
| 2752 other_prev = other, other = XCONS (other)->cdr) | 2752 other_prev = other, other = XCDR (other)) |
| 2753 { | 2753 { |
| 2754 Lisp_Object otherend, otheroverlay; | 2754 Lisp_Object otherend, otheroverlay; |
| 2755 | 2755 |
| 2756 otheroverlay = XCONS (other)->car; | 2756 otheroverlay = XCAR (other); |
| 2757 if (! OVERLAY_VALID (otheroverlay)) | 2757 if (! OVERLAY_VALID (otheroverlay)) |
| 2758 abort (); | 2758 abort (); |
| 2759 | 2759 |
| 2760 otherend = OVERLAY_END (otheroverlay); | 2760 otherend = OVERLAY_END (otheroverlay); |
| 2761 if (OVERLAY_POSITION (otherend) <= where) | 2761 if (OVERLAY_POSITION (otherend) <= where) |
| 2762 break; | 2762 break; |
| 2763 } | 2763 } |
| 2764 | 2764 |
| 2765 /* Add TAIL to overlays_before before OTHER. */ | 2765 /* Add TAIL to overlays_before before OTHER. */ |
| 2766 XCONS (tail)->cdr = other; | 2766 XCDR (tail) = other; |
| 2767 if (!NILP (other_prev)) | 2767 if (!NILP (other_prev)) |
| 2768 XCONS (other_prev)->cdr = tail; | 2768 XCDR (other_prev) = tail; |
| 2769 else | 2769 else |
| 2770 buf->overlays_before = tail; | 2770 buf->overlays_before = tail; |
| 2771 tail = prev; | 2771 tail = prev; |
| 2772 } | 2772 } |
| 2773 } | 2773 } |
| 2831 *pbefore (resp. *pafter) points to, is still uninitialized. | 2831 *pbefore (resp. *pafter) points to, is still uninitialized. |
| 2832 So it's not a bug that before_list isn't initialized, although | 2832 So it's not a bug that before_list isn't initialized, although |
| 2833 it may look strange. */ | 2833 it may look strange. */ |
| 2834 for (ptail = ¤t_buffer->overlays_before; CONSP (*ptail);) | 2834 for (ptail = ¤t_buffer->overlays_before; CONSP (*ptail);) |
| 2835 { | 2835 { |
| 2836 overlay = XCONS (*ptail)->car; | 2836 overlay = XCAR (*ptail); |
| 2837 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2837 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 2838 if (endpos < start) | 2838 if (endpos < start) |
| 2839 break; | 2839 break; |
| 2840 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2840 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2841 if (endpos < end | 2841 if (endpos < end |
| 2854 /* Add it to the end of the wrong list. Later on, | 2854 /* Add it to the end of the wrong list. Later on, |
| 2855 recenter_overlay_lists will move it to the right place. */ | 2855 recenter_overlay_lists will move it to the right place. */ |
| 2856 if (endpos < XINT (current_buffer->overlay_center)) | 2856 if (endpos < XINT (current_buffer->overlay_center)) |
| 2857 { | 2857 { |
| 2858 *pafter = *ptail; | 2858 *pafter = *ptail; |
| 2859 pafter = &XCONS (*ptail)->cdr; | 2859 pafter = &XCDR (*ptail); |
| 2860 } | 2860 } |
| 2861 else | 2861 else |
| 2862 { | 2862 { |
| 2863 *pbefore = *ptail; | 2863 *pbefore = *ptail; |
| 2864 pbefore = &XCONS (*ptail)->cdr; | 2864 pbefore = &XCDR (*ptail); |
| 2865 } | 2865 } |
| 2866 *ptail = XCONS (*ptail)->cdr; | 2866 *ptail = XCDR (*ptail); |
| 2867 } | 2867 } |
| 2868 else | 2868 else |
| 2869 ptail = &XCONS (*ptail)->cdr; | 2869 ptail = &XCDR (*ptail); |
| 2870 } | 2870 } |
| 2871 for (ptail = ¤t_buffer->overlays_after; CONSP (*ptail);) | 2871 for (ptail = ¤t_buffer->overlays_after; CONSP (*ptail);) |
| 2872 { | 2872 { |
| 2873 overlay = XCONS (*ptail)->car; | 2873 overlay = XCAR (*ptail); |
| 2874 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 2874 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 2875 if (startpos >= end) | 2875 if (startpos >= end) |
| 2876 break; | 2876 break; |
| 2877 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 2877 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 2878 if (startpos >= start | 2878 if (startpos >= start |
| 2888 tem = startpos; startpos = endpos; endpos = tem; | 2888 tem = startpos; startpos = endpos; endpos = tem; |
| 2889 } | 2889 } |
| 2890 if (endpos < XINT (current_buffer->overlay_center)) | 2890 if (endpos < XINT (current_buffer->overlay_center)) |
| 2891 { | 2891 { |
| 2892 *pafter = *ptail; | 2892 *pafter = *ptail; |
| 2893 pafter = &XCONS (*ptail)->cdr; | 2893 pafter = &XCDR (*ptail); |
| 2894 } | 2894 } |
| 2895 else | 2895 else |
| 2896 { | 2896 { |
| 2897 *pbefore = *ptail; | 2897 *pbefore = *ptail; |
| 2898 pbefore = &XCONS (*ptail)->cdr; | 2898 pbefore = &XCDR (*ptail); |
| 2899 } | 2899 } |
| 2900 *ptail = XCONS (*ptail)->cdr; | 2900 *ptail = XCDR (*ptail); |
| 2901 } | 2901 } |
| 2902 else | 2902 else |
| 2903 ptail = &XCONS (*ptail)->cdr; | 2903 ptail = &XCDR (*ptail); |
| 2904 } | 2904 } |
| 2905 | 2905 |
| 2906 /* Splice the constructed (wrong) lists into the buffer's lists, | 2906 /* Splice the constructed (wrong) lists into the buffer's lists, |
| 2907 and let the recenter function make it sane again. */ | 2907 and let the recenter function make it sane again. */ |
| 2908 *pbefore = current_buffer->overlays_before; | 2908 *pbefore = current_buffer->overlays_before; |
| 2947 /* At first, find a place where disordered overlays should be linked | 2947 /* At first, find a place where disordered overlays should be linked |
| 2948 in. It is where an overlay which end before POS exists. (i.e. an | 2948 in. It is where an overlay which end before POS exists. (i.e. an |
| 2949 overlay whose ending marker is after-insertion-marker if disorder | 2949 overlay whose ending marker is after-insertion-marker if disorder |
| 2950 exists). */ | 2950 exists). */ |
| 2951 while (!NILP (*tailp) | 2951 while (!NILP (*tailp) |
| 2952 && ((end = OVERLAY_POSITION (OVERLAY_END (XCONS (*tailp)->car))) | 2952 && ((end = OVERLAY_POSITION (OVERLAY_END (XCAR (*tailp)))) |
| 2953 >= pos)) | 2953 >= pos)) |
| 2954 tailp = &XCONS (*tailp)->cdr; | 2954 tailp = &XCDR (*tailp); |
| 2955 | 2955 |
| 2956 /* If we don't find such an overlay, | 2956 /* If we don't find such an overlay, |
| 2957 or the found one ends before PREV, | 2957 or the found one ends before PREV, |
| 2958 or the found one is the last one in the list, | 2958 or the found one is the last one in the list, |
| 2959 we don't have to fix anything. */ | 2959 we don't have to fix anything. */ |
| 2960 if (NILP (*tailp) | 2960 if (NILP (*tailp) |
| 2961 || end < prev | 2961 || end < prev |
| 2962 || NILP (XCONS (*tailp)->cdr)) | 2962 || NILP (XCDR (*tailp))) |
| 2963 return; | 2963 return; |
| 2964 | 2964 |
| 2965 right_place = tailp; | 2965 right_place = tailp; |
| 2966 tailp = &XCONS (*tailp)->cdr; | 2966 tailp = &XCDR (*tailp); |
| 2967 | 2967 |
| 2968 /* Now, end position of overlays in the list *TAILP should be before | 2968 /* Now, end position of overlays in the list *TAILP should be before |
| 2969 or equal to PREV. In the loop, an overlay which ends at POS is | 2969 or equal to PREV. In the loop, an overlay which ends at POS is |
| 2970 moved ahead to the place pointed by RIGHT_PLACE. If we found an | 2970 moved ahead to the place pointed by RIGHT_PLACE. If we found an |
| 2971 overlay which ends before PREV, the remaining overlays are in | 2971 overlay which ends before PREV, the remaining overlays are in |
| 2972 correct order. */ | 2972 correct order. */ |
| 2973 while (!NILP (*tailp)) | 2973 while (!NILP (*tailp)) |
| 2974 { | 2974 { |
| 2975 end = OVERLAY_POSITION (OVERLAY_END (XCONS (*tailp)->car)); | 2975 end = OVERLAY_POSITION (OVERLAY_END (XCAR (*tailp))); |
| 2976 | 2976 |
| 2977 if (end == pos) | 2977 if (end == pos) |
| 2978 { /* This overlay is disordered. */ | 2978 { /* This overlay is disordered. */ |
| 2979 Lisp_Object found = *tailp; | 2979 Lisp_Object found = *tailp; |
| 2980 | 2980 |
| 2981 /* Unlink the found overlay. */ | 2981 /* Unlink the found overlay. */ |
| 2982 *tailp = XCONS (found)->cdr; | 2982 *tailp = XCDR (found); |
| 2983 /* Move an overlay at RIGHT_PLACE to the next of the found one. */ | 2983 /* Move an overlay at RIGHT_PLACE to the next of the found one. */ |
| 2984 XCONS (found)->cdr = *right_place; | 2984 XCDR (found) = *right_place; |
| 2985 /* Link it into the right place. */ | 2985 /* Link it into the right place. */ |
| 2986 *right_place = found; | 2986 *right_place = found; |
| 2987 } | 2987 } |
| 2988 else if (end == prev) | 2988 else if (end == prev) |
| 2989 tailp = &XCONS (*tailp)->cdr; | 2989 tailp = &XCDR (*tailp); |
| 2990 else /* No more disordered overlay. */ | 2990 else /* No more disordered overlay. */ |
| 2991 break; | 2991 break; |
| 2992 } | 2992 } |
| 2993 } | 2993 } |
| 2994 | 2994 |
| 3455 CHECK_OVERLAY (overlay, 0); | 3455 CHECK_OVERLAY (overlay, 0); |
| 3456 | 3456 |
| 3457 fallback = Qnil; | 3457 fallback = Qnil; |
| 3458 | 3458 |
| 3459 for (plist = XOVERLAY (overlay)->plist; | 3459 for (plist = XOVERLAY (overlay)->plist; |
| 3460 CONSP (plist) && CONSP (XCONS (plist)->cdr); | 3460 CONSP (plist) && CONSP (XCDR (plist)); |
| 3461 plist = XCONS (XCONS (plist)->cdr)->cdr) | 3461 plist = XCDR (XCDR (plist))) |
| 3462 { | 3462 { |
| 3463 if (EQ (XCONS (plist)->car, prop)) | 3463 if (EQ (XCAR (plist), prop)) |
| 3464 return XCONS (XCONS (plist)->cdr)->car; | 3464 return XCAR (XCDR (plist)); |
| 3465 else if (EQ (XCONS (plist)->car, Qcategory)) | 3465 else if (EQ (XCAR (plist), Qcategory)) |
| 3466 { | 3466 { |
| 3467 Lisp_Object tem; | 3467 Lisp_Object tem; |
| 3468 tem = Fcar (Fcdr (plist)); | 3468 tem = Fcar (Fcdr (plist)); |
| 3469 if (SYMBOLP (tem)) | 3469 if (SYMBOLP (tem)) |
| 3470 fallback = Fget (tem, prop); | 3470 fallback = Fget (tem, prop); |
| 3485 CHECK_OVERLAY (overlay, 0); | 3485 CHECK_OVERLAY (overlay, 0); |
| 3486 | 3486 |
| 3487 buffer = Fmarker_buffer (OVERLAY_START (overlay)); | 3487 buffer = Fmarker_buffer (OVERLAY_START (overlay)); |
| 3488 | 3488 |
| 3489 for (tail = XOVERLAY (overlay)->plist; | 3489 for (tail = XOVERLAY (overlay)->plist; |
| 3490 CONSP (tail) && CONSP (XCONS (tail)->cdr); | 3490 CONSP (tail) && CONSP (XCDR (tail)); |
| 3491 tail = XCONS (XCONS (tail)->cdr)->cdr) | 3491 tail = XCDR (XCDR (tail))) |
| 3492 if (EQ (XCONS (tail)->car, prop)) | 3492 if (EQ (XCAR (tail), prop)) |
| 3493 { | 3493 { |
| 3494 changed = !EQ (XCONS (XCONS (tail)->cdr)->car, value); | 3494 changed = !EQ (XCAR (XCDR (tail)), value); |
| 3495 XCONS (XCONS (tail)->cdr)->car = value; | 3495 XCAR (XCDR (tail)) = value; |
| 3496 goto found; | 3496 goto found; |
| 3497 } | 3497 } |
| 3498 /* It wasn't in the list, so add it to the front. */ | 3498 /* It wasn't in the list, so add it to the front. */ |
| 3499 changed = !NILP (value); | 3499 changed = !NILP (value); |
| 3500 XOVERLAY (overlay)->plist | 3500 XOVERLAY (overlay)->plist |
| 3613 Scan the overlays to find the functions to call. */ | 3613 Scan the overlays to find the functions to call. */ |
| 3614 last_overlay_modification_hooks_used = 0; | 3614 last_overlay_modification_hooks_used = 0; |
| 3615 tail_copied = 0; | 3615 tail_copied = 0; |
| 3616 for (tail = current_buffer->overlays_before; | 3616 for (tail = current_buffer->overlays_before; |
| 3617 CONSP (tail); | 3617 CONSP (tail); |
| 3618 tail = XCONS (tail)->cdr) | 3618 tail = XCDR (tail)) |
| 3619 { | 3619 { |
| 3620 int startpos, endpos; | 3620 int startpos, endpos; |
| 3621 Lisp_Object ostart, oend; | 3621 Lisp_Object ostart, oend; |
| 3622 | 3622 |
| 3623 overlay = XCONS (tail)->car; | 3623 overlay = XCAR (tail); |
| 3624 | 3624 |
| 3625 ostart = OVERLAY_START (overlay); | 3625 ostart = OVERLAY_START (overlay); |
| 3626 oend = OVERLAY_END (overlay); | 3626 oend = OVERLAY_END (overlay); |
| 3627 endpos = OVERLAY_POSITION (oend); | 3627 endpos = OVERLAY_POSITION (oend); |
| 3628 if (XFASTINT (start) > endpos) | 3628 if (XFASTINT (start) > endpos) |
| 3669 } | 3669 } |
| 3670 | 3670 |
| 3671 tail_copied = 0; | 3671 tail_copied = 0; |
| 3672 for (tail = current_buffer->overlays_after; | 3672 for (tail = current_buffer->overlays_after; |
| 3673 CONSP (tail); | 3673 CONSP (tail); |
| 3674 tail = XCONS (tail)->cdr) | 3674 tail = XCDR (tail)) |
| 3675 { | 3675 { |
| 3676 int startpos, endpos; | 3676 int startpos, endpos; |
| 3677 Lisp_Object ostart, oend; | 3677 Lisp_Object ostart, oend; |
| 3678 | 3678 |
| 3679 overlay = XCONS (tail)->car; | 3679 overlay = XCAR (tail); |
| 3680 | 3680 |
| 3681 ostart = OVERLAY_START (overlay); | 3681 ostart = OVERLAY_START (overlay); |
| 3682 oend = OVERLAY_END (overlay); | 3682 oend = OVERLAY_END (overlay); |
| 3683 startpos = OVERLAY_POSITION (ostart); | 3683 startpos = OVERLAY_POSITION (ostart); |
| 3684 endpos = OVERLAY_POSITION (oend); | 3684 endpos = OVERLAY_POSITION (oend); |
| 3758 Lisp_Object tail, overlay, hit_list; | 3758 Lisp_Object tail, overlay, hit_list; |
| 3759 | 3759 |
| 3760 hit_list = Qnil; | 3760 hit_list = Qnil; |
| 3761 if (pos <= XFASTINT (current_buffer->overlay_center)) | 3761 if (pos <= XFASTINT (current_buffer->overlay_center)) |
| 3762 for (tail = current_buffer->overlays_before; CONSP (tail); | 3762 for (tail = current_buffer->overlays_before; CONSP (tail); |
| 3763 tail = XCONS (tail)->cdr) | 3763 tail = XCDR (tail)) |
| 3764 { | 3764 { |
| 3765 int endpos; | 3765 int endpos; |
| 3766 overlay = XCONS (tail)->car; | 3766 overlay = XCAR (tail); |
| 3767 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); | 3767 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); |
| 3768 if (endpos < pos) | 3768 if (endpos < pos) |
| 3769 break; | 3769 break; |
| 3770 if (endpos == pos && OVERLAY_POSITION (OVERLAY_START (overlay)) == pos | 3770 if (endpos == pos && OVERLAY_POSITION (OVERLAY_START (overlay)) == pos |
| 3771 && ! NILP (Foverlay_get (overlay, Qevaporate))) | 3771 && ! NILP (Foverlay_get (overlay, Qevaporate))) |
| 3772 hit_list = Fcons (overlay, hit_list); | 3772 hit_list = Fcons (overlay, hit_list); |
| 3773 } | 3773 } |
| 3774 else | 3774 else |
| 3775 for (tail = current_buffer->overlays_after; CONSP (tail); | 3775 for (tail = current_buffer->overlays_after; CONSP (tail); |
| 3776 tail = XCONS (tail)->cdr) | 3776 tail = XCDR (tail)) |
| 3777 { | 3777 { |
| 3778 int startpos; | 3778 int startpos; |
| 3779 overlay = XCONS (tail)->car; | 3779 overlay = XCAR (tail); |
| 3780 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); | 3780 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); |
| 3781 if (startpos > pos) | 3781 if (startpos > pos) |
| 3782 break; | 3782 break; |
| 3783 if (startpos == pos && OVERLAY_POSITION (OVERLAY_END (overlay)) == pos | 3783 if (startpos == pos && OVERLAY_POSITION (OVERLAY_END (overlay)) == pos |
| 3784 && ! NILP (Foverlay_get (overlay, Qevaporate))) | 3784 && ! NILP (Foverlay_get (overlay, Qevaporate))) |
| 3785 hit_list = Fcons (overlay, hit_list); | 3785 hit_list = Fcons (overlay, hit_list); |
| 3786 } | 3786 } |
| 3787 for (; CONSP (hit_list); hit_list = XCONS (hit_list)->cdr) | 3787 for (; CONSP (hit_list); hit_list = XCDR (hit_list)) |
| 3788 Fdelete_overlay (XCONS (hit_list)->car); | 3788 Fdelete_overlay (XCAR (hit_list)); |
| 3789 } | 3789 } |
| 3790 | 3790 |
| 3791 /* Somebody has tried to store a value with an unacceptable type | 3791 /* Somebody has tried to store a value with an unacceptable type |
| 3792 in the slot with offset OFFSET. */ | 3792 in the slot with offset OFFSET. */ |
| 3793 | 3793 |
