aboutsummaryrefslogtreecommitdiffstats
path: root/src/marker.c
diff options
context:
space:
mode:
authorDmitry Antipov2012-09-11 08:22:03 +0400
committerDmitry Antipov2012-09-11 08:22:03 +0400
commite578f3813ff7f48663eb4821caee267e3ec47aa8 (patch)
treeb48cd4a8fb778a2a991a342932d357fa8ba4ccc2 /src/marker.c
parent3057e615af94af8d08f475208c7e459f5d7115ac (diff)
downloademacs-e578f3813ff7f48663eb4821caee267e3ec47aa8.tar.gz
emacs-e578f3813ff7f48663eb4821caee267e3ec47aa8.zip
Convenient macro to check whether the buffer is live.
* buffer.h (BUFFER_LIVE_P): New macro. * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c: * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
Diffstat (limited to 'src/marker.c')
-rw-r--r--src/marker.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/marker.c b/src/marker.c
index de3c19c3bcb..bfbb161a71d 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -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;
@@ -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);