Mercurial > hg > xemacs-beta
comparison src/insdel.c @ 167:85ec50267440 r20-3b10
Import from CVS: tag r20-3b10
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:45:46 +0200 |
parents | 59463afc5666 |
children | e121b013d1f0 |
comparison
equal
deleted
inserted
replaced
166:7a77eb660975 | 167:85ec50267440 |
---|---|
1403 | 1403 |
1404 Bufpos | 1404 Bufpos |
1405 get_buffer_or_string_pos_char (Lisp_Object object, Lisp_Object pos, | 1405 get_buffer_or_string_pos_char (Lisp_Object object, Lisp_Object pos, |
1406 unsigned int flags) | 1406 unsigned int flags) |
1407 { | 1407 { |
1408 if (STRINGP (object)) | 1408 return STRINGP (object) ? |
1409 return get_string_pos_char (object, pos, flags); | 1409 get_string_pos_char (object, pos, flags) : |
1410 else | 1410 get_buffer_pos_char (XBUFFER (object), pos, flags); |
1411 return get_buffer_pos_char (XBUFFER (object), pos, flags); | |
1412 } | 1411 } |
1413 | 1412 |
1414 Bytind | 1413 Bytind |
1415 get_buffer_or_string_pos_byte (Lisp_Object object, Lisp_Object pos, | 1414 get_buffer_or_string_pos_byte (Lisp_Object object, Lisp_Object pos, |
1416 unsigned int flags) | 1415 unsigned int flags) |
1417 { | 1416 { |
1418 if (STRINGP (object)) | 1417 return STRINGP (object) ? |
1419 return get_string_pos_byte (object, pos, flags); | 1418 get_string_pos_byte (object, pos, flags) : |
1420 else | 1419 get_buffer_pos_byte (XBUFFER (object), pos, flags); |
1421 return get_buffer_pos_byte (XBUFFER (object), pos, flags); | |
1422 } | 1420 } |
1423 | 1421 |
1424 void | 1422 void |
1425 get_buffer_or_string_range_char (Lisp_Object object, Lisp_Object from, | 1423 get_buffer_or_string_range_char (Lisp_Object object, Lisp_Object from, |
1426 Lisp_Object to, Bufpos *from_out, | 1424 Lisp_Object to, Bufpos *from_out, |
1427 Bufpos *to_out, unsigned int flags) | 1425 Bufpos *to_out, unsigned int flags) |
1428 { | 1426 { |
1429 if (STRINGP (object)) | 1427 if (STRINGP (object)) |
1430 get_string_range_char (object, from, to, from_out, to_out, flags); | 1428 get_string_range_char (object, from, to, from_out, to_out, flags); |
1431 else | 1429 else |
1432 get_buffer_range_char (XBUFFER (object), from, to, from_out, to_out, | 1430 get_buffer_range_char (XBUFFER (object), from, to, from_out, to_out, flags); |
1433 flags); | |
1434 } | 1431 } |
1435 | 1432 |
1436 void | 1433 void |
1437 get_buffer_or_string_range_byte (Lisp_Object object, Lisp_Object from, | 1434 get_buffer_or_string_range_byte (Lisp_Object object, Lisp_Object from, |
1438 Lisp_Object to, Bytind *from_out, | 1435 Lisp_Object to, Bytind *from_out, |
1439 Bytind *to_out, unsigned int flags) | 1436 Bytind *to_out, unsigned int flags) |
1440 { | 1437 { |
1441 if (STRINGP (object)) | 1438 if (STRINGP (object)) |
1442 get_string_range_byte (object, from, to, from_out, to_out, flags); | 1439 get_string_range_byte (object, from, to, from_out, to_out, flags); |
1443 else | 1440 else |
1444 get_buffer_range_byte (XBUFFER (object), from, to, from_out, to_out, | 1441 get_buffer_range_byte (XBUFFER (object), from, to, from_out, to_out, flags); |
1445 flags); | |
1446 } | 1442 } |
1447 | 1443 |
1448 Bufpos | 1444 Bufpos |
1449 buffer_or_string_accessible_begin_char (Lisp_Object object) | 1445 buffer_or_string_accessible_begin_char (Lisp_Object object) |
1450 { | 1446 { |
1451 if (STRINGP (object)) | 1447 return STRINGP (object) ? 0 : BUF_BEGV (XBUFFER (object)); |
1452 return 0; | |
1453 return BUF_BEGV (XBUFFER (object)); | |
1454 } | 1448 } |
1455 | 1449 |
1456 Bufpos | 1450 Bufpos |
1457 buffer_or_string_accessible_end_char (Lisp_Object object) | 1451 buffer_or_string_accessible_end_char (Lisp_Object object) |
1458 { | 1452 { |
1459 if (STRINGP (object)) | 1453 return STRINGP (object) ? |
1460 return string_char_length (XSTRING (object)); | 1454 string_char_length (XSTRING (object)) : BUF_ZV (XBUFFER (object)); |
1461 return BUF_ZV (XBUFFER (object)); | |
1462 } | 1455 } |
1463 | 1456 |
1464 Bytind | 1457 Bytind |
1465 buffer_or_string_accessible_begin_byte (Lisp_Object object) | 1458 buffer_or_string_accessible_begin_byte (Lisp_Object object) |
1466 { | 1459 { |
1467 if (STRINGP (object)) | 1460 return STRINGP (object) ? 0 : BI_BUF_BEGV (XBUFFER (object)); |
1468 return 0; | |
1469 return BI_BUF_BEGV (XBUFFER (object)); | |
1470 } | 1461 } |
1471 | 1462 |
1472 Bytind | 1463 Bytind |
1473 buffer_or_string_accessible_end_byte (Lisp_Object object) | 1464 buffer_or_string_accessible_end_byte (Lisp_Object object) |
1474 { | 1465 { |
1475 if (STRINGP (object)) | 1466 return STRINGP (object) ? |
1476 return XSTRING_LENGTH (object); | 1467 XSTRING_LENGTH (object) : BI_BUF_ZV (XBUFFER (object)); |
1477 return BI_BUF_ZV (XBUFFER (object)); | |
1478 } | 1468 } |
1479 | 1469 |
1480 Bufpos | 1470 Bufpos |
1481 buffer_or_string_absolute_begin_char (Lisp_Object object) | 1471 buffer_or_string_absolute_begin_char (Lisp_Object object) |
1482 { | 1472 { |
1483 if (STRINGP (object)) | 1473 return STRINGP (object) ? 0 : BUF_BEG (XBUFFER (object)); |
1484 return 0; | |
1485 return BUF_BEG (XBUFFER (object)); | |
1486 } | 1474 } |
1487 | 1475 |
1488 Bufpos | 1476 Bufpos |
1489 buffer_or_string_absolute_end_char (Lisp_Object object) | 1477 buffer_or_string_absolute_end_char (Lisp_Object object) |
1490 { | 1478 { |
1491 if (STRINGP (object)) | 1479 return STRINGP (object) ? |
1492 return string_char_length (XSTRING (object)); | 1480 string_char_length (XSTRING (object)) : BUF_Z (XBUFFER (object)); |
1493 return BUF_Z (XBUFFER (object)); | |
1494 } | 1481 } |
1495 | 1482 |
1496 Bytind | 1483 Bytind |
1497 buffer_or_string_absolute_begin_byte (Lisp_Object object) | 1484 buffer_or_string_absolute_begin_byte (Lisp_Object object) |
1498 { | 1485 { |
1499 if (STRINGP (object)) | 1486 return STRINGP (object) ? 0 : BI_BUF_BEG (XBUFFER (object)); |
1500 return 0; | |
1501 return BI_BUF_BEG (XBUFFER (object)); | |
1502 } | 1487 } |
1503 | 1488 |
1504 Bytind | 1489 Bytind |
1505 buffer_or_string_absolute_end_byte (Lisp_Object object) | 1490 buffer_or_string_absolute_end_byte (Lisp_Object object) |
1506 { | 1491 { |
1507 if (STRINGP (object)) | 1492 return STRINGP (object) ? |
1508 return XSTRING_LENGTH (object); | 1493 XSTRING_LENGTH (object) : BI_BUF_Z (XBUFFER (object)); |
1509 return BI_BUF_Z (XBUFFER (object)); | |
1510 } | 1494 } |
1511 | 1495 |
1512 | 1496 |
1513 /************************************************************************/ | 1497 /************************************************************************/ |
1514 /* point and marker adjustment */ | 1498 /* point and marker adjustment */ |
2324 #if 0 /* FSFmacs */ | 2308 #if 0 /* FSFmacs */ |
2325 Vdeactivate_mark = Qt; | 2309 Vdeactivate_mark = Qt; |
2326 #endif | 2310 #endif |
2327 | 2311 |
2328 buf->point_before_scroll = Qnil; | 2312 buf->point_before_scroll = Qnil; |
2329 | |
2330 /* BUF_MODIFF (buf)++; -- should be done by callers (insert, delete range) | |
2331 else record_first_change isn't called */ | |
2332 } | 2313 } |
2333 | 2314 |
2334 | 2315 |
2335 /************************************************************************/ | 2316 /************************************************************************/ |
2336 /* Insertion of strings */ | 2317 /* Insertion of strings */ |