diff options
Diffstat (limited to 'src/marker.c')
| -rw-r--r-- | src/marker.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/marker.c b/src/marker.c index 4ea06c7cd57..0c4e8cb3b55 100644 --- a/src/marker.c +++ b/src/marker.c | |||
| @@ -18,7 +18,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 18 | 18 | ||
| 19 | 19 | ||
| 20 | #include <config.h> | 20 | #include <config.h> |
| 21 | #include <setjmp.h> | 21 | |
| 22 | #include "lisp.h" | 22 | #include "lisp.h" |
| 23 | #include "character.h" | 23 | #include "character.h" |
| 24 | #include "buffer.h" | 24 | #include "buffer.h" |
| @@ -59,7 +59,7 @@ byte_char_debug_check (struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos) | |||
| 59 | bytepos - BUF_BEG_BYTE (b)); | 59 | bytepos - BUF_BEG_BYTE (b)); |
| 60 | 60 | ||
| 61 | if (charpos - 1 != nchars) | 61 | if (charpos - 1 != nchars) |
| 62 | abort (); | 62 | emacs_abort (); |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | #else /* not MARKER_DEBUG */ | 65 | #else /* not MARKER_DEBUG */ |
| @@ -67,7 +67,7 @@ byte_char_debug_check (struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos) | |||
| 67 | #define byte_char_debug_check(b, charpos, bytepos) do { } while (0) | 67 | #define byte_char_debug_check(b, charpos, bytepos) do { } while (0) |
| 68 | 68 | ||
| 69 | #endif /* MARKER_DEBUG */ | 69 | #endif /* MARKER_DEBUG */ |
| 70 | 70 | ||
| 71 | void | 71 | void |
| 72 | clear_charpos_cache (struct buffer *b) | 72 | clear_charpos_cache (struct buffer *b) |
| 73 | { | 73 | { |
| @@ -142,7 +142,7 @@ buf_charpos_to_bytepos (struct buffer *b, ptrdiff_t charpos) | |||
| 142 | ptrdiff_t best_below, best_below_byte; | 142 | ptrdiff_t best_below, best_below_byte; |
| 143 | 143 | ||
| 144 | if (charpos < BUF_BEG (b) || charpos > BUF_Z (b)) | 144 | if (charpos < BUF_BEG (b) || charpos > BUF_Z (b)) |
| 145 | abort (); | 145 | emacs_abort (); |
| 146 | 146 | ||
| 147 | best_above = BUF_Z (b); | 147 | best_above = BUF_Z (b); |
| 148 | best_above_byte = BUF_Z_BYTE (b); | 148 | best_above_byte = BUF_Z_BYTE (b); |
| @@ -296,7 +296,7 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) | |||
| 296 | ptrdiff_t best_below, best_below_byte; | 296 | ptrdiff_t best_below, best_below_byte; |
| 297 | 297 | ||
| 298 | if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b)) | 298 | if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b)) |
| 299 | abort (); | 299 | emacs_abort (); |
| 300 | 300 | ||
| 301 | best_above = BUF_Z (b); | 301 | best_above = BUF_Z (b); |
| 302 | best_above_byte = BUF_Z_BYTE (b); | 302 | best_above_byte = BUF_Z_BYTE (b); |
| @@ -407,7 +407,7 @@ Returns nil if MARKER points into a dead buffer. */) | |||
| 407 | does not preserve the buffer from being GC'd (it's weak), so | 407 | does not preserve the buffer from being GC'd (it's weak), so |
| 408 | markers have to be unlinked from their buffer as soon as the buffer | 408 | markers have to be unlinked from their buffer as soon as the buffer |
| 409 | is killed. */ | 409 | is killed. */ |
| 410 | eassert (!NILP (BVAR (XBUFFER (buf), name))); | 410 | eassert (BUFFER_LIVE_P (XBUFFER (buf))); |
| 411 | return buf; | 411 | return buf; |
| 412 | } | 412 | } |
| 413 | return Qnil; | 413 | return Qnil; |
| @@ -462,13 +462,13 @@ live_buffer (Lisp_Object buffer) | |||
| 462 | if (NILP (buffer)) | 462 | if (NILP (buffer)) |
| 463 | { | 463 | { |
| 464 | b = current_buffer; | 464 | b = current_buffer; |
| 465 | eassert (!NILP (BVAR (b, name))); | 465 | eassert (BUFFER_LIVE_P (b)); |
| 466 | } | 466 | } |
| 467 | else | 467 | else |
| 468 | { | 468 | { |
| 469 | CHECK_BUFFER (buffer); | 469 | CHECK_BUFFER (buffer); |
| 470 | b = XBUFFER (buffer); | 470 | b = XBUFFER (buffer); |
| 471 | if (NILP (BVAR (b, name))) | 471 | if (!BUFFER_LIVE_P (b)) |
| 472 | b = NULL; | 472 | b = NULL; |
| 473 | } | 473 | } |
| 474 | return b; | 474 | return b; |
| @@ -506,7 +506,7 @@ set_marker_internal (Lisp_Object marker, Lisp_Object position, | |||
| 506 | else | 506 | else |
| 507 | { | 507 | { |
| 508 | register ptrdiff_t charpos, bytepos; | 508 | register ptrdiff_t charpos, bytepos; |
| 509 | 509 | ||
| 510 | CHECK_NUMBER_COERCE_MARKER (position); | 510 | CHECK_NUMBER_COERCE_MARKER (position); |
| 511 | charpos = clip_to_bounds (restricted ? BUF_BEGV (b) : BUF_BEG (b), | 511 | charpos = clip_to_bounds (restricted ? BUF_BEGV (b) : BUF_BEG (b), |
| 512 | XINT (position), | 512 | XINT (position), |
| @@ -570,8 +570,8 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, | |||
| 570 | 570 | ||
| 571 | if (b) | 571 | if (b) |
| 572 | { | 572 | { |
| 573 | attach_marker | 573 | attach_marker |
| 574 | (m, b, | 574 | (m, b, |
| 575 | clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b)), | 575 | clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b)), |
| 576 | clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b))); | 576 | clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b))); |
| 577 | } | 577 | } |
| @@ -595,7 +595,7 @@ unchain_marker (register struct Lisp_Marker *marker) | |||
| 595 | register struct Lisp_Marker *tail, **prev; | 595 | register struct Lisp_Marker *tail, **prev; |
| 596 | 596 | ||
| 597 | /* No dead buffers here. */ | 597 | /* No dead buffers here. */ |
| 598 | eassert (!NILP (BVAR (b, name))); | 598 | eassert (BUFFER_LIVE_P (b)); |
| 599 | 599 | ||
| 600 | marker->buffer = NULL; | 600 | marker->buffer = NULL; |
| 601 | prev = &BUF_MARKERS (b); | 601 | prev = &BUF_MARKERS (b); |
| @@ -605,12 +605,12 @@ unchain_marker (register struct Lisp_Marker *marker) | |||
| 605 | { | 605 | { |
| 606 | if (*prev == BUF_MARKERS (b)) | 606 | if (*prev == BUF_MARKERS (b)) |
| 607 | { | 607 | { |
| 608 | /* Deleting first marker from the buffer's chain. Crash | 608 | /* Deleting first marker from the buffer's chain. Crash |
| 609 | if new first marker in chain does not say it belongs | 609 | if new first marker in chain does not say it belongs |
| 610 | to the same buffer, or at least that they have the same | 610 | to the same buffer, or at least that they have the same |
| 611 | base buffer. */ | 611 | base buffer. */ |
| 612 | if (tail->next && b->text != tail->next->buffer->text) | 612 | if (tail->next && b->text != tail->next->buffer->text) |
| 613 | abort (); | 613 | emacs_abort (); |
| 614 | } | 614 | } |
| 615 | *prev = tail->next; | 615 | *prev = tail->next; |
| 616 | /* We have removed the marker from the chain; | 616 | /* We have removed the marker from the chain; |