diff options
| author | Dmitry Antipov | 2012-09-11 08:22:03 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-09-11 08:22:03 +0400 |
| commit | e578f3813ff7f48663eb4821caee267e3ec47aa8 (patch) | |
| tree | b48cd4a8fb778a2a991a342932d357fa8ba4ccc2 /src/window.c | |
| parent | 3057e615af94af8d08f475208c7e459f5d7115ac (diff) | |
| download | emacs-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/window.c')
| -rw-r--r-- | src/window.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/window.c b/src/window.c index 1869a3b65cf..4a833a120b3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2668,7 +2668,7 @@ window_loop (enum window_loop type, Lisp_Object obj, int mini, Lisp_Object frame | |||
| 2668 | /* Check for a window that has a killed buffer. */ | 2668 | /* Check for a window that has a killed buffer. */ |
| 2669 | case CHECK_ALL_WINDOWS: | 2669 | case CHECK_ALL_WINDOWS: |
| 2670 | if (! NILP (w->buffer) | 2670 | if (! NILP (w->buffer) |
| 2671 | && NILP (BVAR (XBUFFER (w->buffer), name))) | 2671 | && !BUFFER_LIVE_P (XBUFFER (w->buffer))) |
| 2672 | emacs_abort (); | 2672 | emacs_abort (); |
| 2673 | break; | 2673 | break; |
| 2674 | 2674 | ||
| @@ -3273,7 +3273,7 @@ This function runs `window-scroll-functions' before running | |||
| 3273 | XSETWINDOW (window, w); | 3273 | XSETWINDOW (window, w); |
| 3274 | buffer = Fget_buffer (buffer_or_name); | 3274 | buffer = Fget_buffer (buffer_or_name); |
| 3275 | CHECK_BUFFER (buffer); | 3275 | CHECK_BUFFER (buffer); |
| 3276 | if (NILP (BVAR (XBUFFER (buffer), name))) | 3276 | if (!BUFFER_LIVE_P (XBUFFER (buffer))) |
| 3277 | error ("Attempt to display deleted buffer"); | 3277 | error ("Attempt to display deleted buffer"); |
| 3278 | 3278 | ||
| 3279 | tem = w->buffer; | 3279 | tem = w->buffer; |
| @@ -3338,7 +3338,7 @@ displaying that buffer. */) | |||
| 3338 | 3338 | ||
| 3339 | if (STRINGP (object)) | 3339 | if (STRINGP (object)) |
| 3340 | object = Fget_buffer (object); | 3340 | object = Fget_buffer (object); |
| 3341 | if (BUFFERP (object) && !NILP (BVAR (XBUFFER (object), name))) | 3341 | if (BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) |
| 3342 | { | 3342 | { |
| 3343 | /* Walk all windows looking for buffer, and force update | 3343 | /* Walk all windows looking for buffer, and force update |
| 3344 | of each of those windows. */ | 3344 | of each of those windows. */ |
| @@ -5549,7 +5549,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5549 | saved_windows = XVECTOR (data->saved_windows); | 5549 | saved_windows = XVECTOR (data->saved_windows); |
| 5550 | 5550 | ||
| 5551 | new_current_buffer = data->current_buffer; | 5551 | new_current_buffer = data->current_buffer; |
| 5552 | if (NILP (BVAR (XBUFFER (new_current_buffer), name))) | 5552 | if (!BUFFER_LIVE_P (XBUFFER (new_current_buffer))) |
| 5553 | new_current_buffer = Qnil; | 5553 | new_current_buffer = Qnil; |
| 5554 | else | 5554 | else |
| 5555 | { | 5555 | { |
| @@ -5624,7 +5624,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5624 | w = XWINDOW (window); | 5624 | w = XWINDOW (window); |
| 5625 | if (!NILP (w->buffer) | 5625 | if (!NILP (w->buffer) |
| 5626 | && !EQ (w->buffer, p->buffer) | 5626 | && !EQ (w->buffer, p->buffer) |
| 5627 | && !NILP (BVAR (XBUFFER (p->buffer), name))) | 5627 | && BUFFER_LIVE_P (XBUFFER (p->buffer))) |
| 5628 | /* If a window we restore gets another buffer, record the | 5628 | /* If a window we restore gets another buffer, record the |
| 5629 | window's old buffer. */ | 5629 | window's old buffer. */ |
| 5630 | call1 (Qrecord_window_buffer, window); | 5630 | call1 (Qrecord_window_buffer, window); |
| @@ -5774,7 +5774,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5774 | if (NILP (p->buffer)) | 5774 | if (NILP (p->buffer)) |
| 5775 | /* An internal window. */ | 5775 | /* An internal window. */ |
| 5776 | wset_buffer (w, p->buffer); | 5776 | wset_buffer (w, p->buffer); |
| 5777 | else if (!NILP (BVAR (XBUFFER (p->buffer), name))) | 5777 | else if (BUFFER_LIVE_P (XBUFFER (p->buffer))) |
| 5778 | /* If saved buffer is alive, install it. */ | 5778 | /* If saved buffer is alive, install it. */ |
| 5779 | { | 5779 | { |
| 5780 | wset_buffer (w, p->buffer); | 5780 | wset_buffer (w, p->buffer); |
| @@ -5793,7 +5793,7 @@ the return value is nil. Otherwise the value is t. */) | |||
| 5793 | Fgoto_char (w->pointm); | 5793 | Fgoto_char (w->pointm); |
| 5794 | } | 5794 | } |
| 5795 | else if (!NILP (w->buffer) | 5795 | else if (!NILP (w->buffer) |
| 5796 | && !NILP (BVAR (XBUFFER (w->buffer), name))) | 5796 | && BUFFER_LIVE_P (XBUFFER (w->buffer))) |
| 5797 | /* Keep window's old buffer; make sure the markers are | 5797 | /* Keep window's old buffer; make sure the markers are |
| 5798 | real. */ | 5798 | real. */ |
| 5799 | { | 5799 | { |