diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/buffer.c b/src/buffer.c index 3af45122a0d..d512547d34e 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -388,7 +388,7 @@ DEFUN ("buffer-live-p", Fbuffer_live_p, Sbuffer_live_p, 1, 1, 0, | |||
| 388 | Value is nil if OBJECT is not a buffer or if it has been killed. */) | 388 | Value is nil if OBJECT is not a buffer or if it has been killed. */) |
| 389 | (Lisp_Object object) | 389 | (Lisp_Object object) |
| 390 | { | 390 | { |
| 391 | return ((BUFFERP (object) && ! NILP (BVAR (XBUFFER (object), name))) | 391 | return ((BUFFERP (object) && BUFFER_LIVE_P (XBUFFER (object))) |
| 392 | ? Qt : Qnil); | 392 | ? Qt : Qnil); |
| 393 | } | 393 | } |
| 394 | 394 | ||
| @@ -776,7 +776,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 776 | base_buffer = Fget_buffer (base_buffer); | 776 | base_buffer = Fget_buffer (base_buffer); |
| 777 | if (NILP (base_buffer)) | 777 | if (NILP (base_buffer)) |
| 778 | error ("No such buffer: `%s'", SDATA (tem)); | 778 | error ("No such buffer: `%s'", SDATA (tem)); |
| 779 | if (NILP (BVAR (XBUFFER (base_buffer), name))) | 779 | if (!BUFFER_LIVE_P (XBUFFER (base_buffer))) |
| 780 | error ("Base buffer has been killed"); | 780 | error ("Base buffer has been killed"); |
| 781 | 781 | ||
| 782 | if (SCHARS (name) == 0) | 782 | if (SCHARS (name) == 0) |
| @@ -1553,7 +1553,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) | |||
| 1553 | { | 1553 | { |
| 1554 | buf = XCAR (tail); | 1554 | buf = XCAR (tail); |
| 1555 | if (BUFFERP (buf) && !EQ (buf, buffer) | 1555 | if (BUFFERP (buf) && !EQ (buf, buffer) |
| 1556 | && !NILP (BVAR (XBUFFER (buf), name)) | 1556 | && BUFFER_LIVE_P (XBUFFER (buf)) |
| 1557 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') | 1557 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') |
| 1558 | /* If the frame has a buffer_predicate, disregard buffers that | 1558 | /* If the frame has a buffer_predicate, disregard buffers that |
| 1559 | don't fit the predicate. */ | 1559 | don't fit the predicate. */ |
| @@ -1573,7 +1573,7 @@ exists, return the buffer `*scratch*' (creating it if necessary). */) | |||
| 1573 | { | 1573 | { |
| 1574 | buf = Fcdr (XCAR (tail)); | 1574 | buf = Fcdr (XCAR (tail)); |
| 1575 | if (BUFFERP (buf) && !EQ (buf, buffer) | 1575 | if (BUFFERP (buf) && !EQ (buf, buffer) |
| 1576 | && !NILP (BVAR (XBUFFER (buf), name)) | 1576 | && BUFFER_LIVE_P (XBUFFER (buf)) |
| 1577 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') | 1577 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ') |
| 1578 | /* If the frame has a buffer_predicate, disregard buffers that | 1578 | /* If the frame has a buffer_predicate, disregard buffers that |
| 1579 | don't fit the predicate. */ | 1579 | don't fit the predicate. */ |
| @@ -1615,7 +1615,7 @@ other_buffer_safely (Lisp_Object buffer) | |||
| 1615 | { | 1615 | { |
| 1616 | buf = Fcdr (XCAR (tail)); | 1616 | buf = Fcdr (XCAR (tail)); |
| 1617 | if (BUFFERP (buf) && !EQ (buf, buffer) | 1617 | if (BUFFERP (buf) && !EQ (buf, buffer) |
| 1618 | && !NILP (BVAR (XBUFFER (buf), name)) | 1618 | && BUFFER_LIVE_P (XBUFFER (buf)) |
| 1619 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')) | 1619 | && (SREF (BVAR (XBUFFER (buf), name), 0) != ' ')) |
| 1620 | return buf; | 1620 | return buf; |
| 1621 | } | 1621 | } |
| @@ -1734,7 +1734,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1734 | b = XBUFFER (buffer); | 1734 | b = XBUFFER (buffer); |
| 1735 | 1735 | ||
| 1736 | /* Avoid trouble for buffer already dead. */ | 1736 | /* Avoid trouble for buffer already dead. */ |
| 1737 | if (NILP (BVAR (b, name))) | 1737 | if (!BUFFER_LIVE_P (b)) |
| 1738 | return Qnil; | 1738 | return Qnil; |
| 1739 | 1739 | ||
| 1740 | /* Query if the buffer is still modified. */ | 1740 | /* Query if the buffer is still modified. */ |
| @@ -1770,7 +1770,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1770 | } | 1770 | } |
| 1771 | 1771 | ||
| 1772 | /* If the hooks have killed the buffer, exit now. */ | 1772 | /* If the hooks have killed the buffer, exit now. */ |
| 1773 | if (NILP (BVAR (b, name))) | 1773 | if (!BUFFER_LIVE_P (b)) |
| 1774 | return Qt; | 1774 | return Qt; |
| 1775 | 1775 | ||
| 1776 | /* We have no more questions to ask. Verify that it is valid | 1776 | /* We have no more questions to ask. Verify that it is valid |
| @@ -1802,7 +1802,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1802 | UNGCPRO; | 1802 | UNGCPRO; |
| 1803 | 1803 | ||
| 1804 | /* Exit if we now have killed the base buffer (Bug#11665). */ | 1804 | /* Exit if we now have killed the base buffer (Bug#11665). */ |
| 1805 | if (NILP (BVAR (b, name))) | 1805 | if (!BUFFER_LIVE_P (b)) |
| 1806 | return Qt; | 1806 | return Qt; |
| 1807 | } | 1807 | } |
| 1808 | 1808 | ||
| @@ -1813,7 +1813,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1813 | replace_buffer_in_windows (buffer); | 1813 | replace_buffer_in_windows (buffer); |
| 1814 | 1814 | ||
| 1815 | /* Exit if replacing the buffer in windows has killed our buffer. */ | 1815 | /* Exit if replacing the buffer in windows has killed our buffer. */ |
| 1816 | if (NILP (BVAR (b, name))) | 1816 | if (!BUFFER_LIVE_P (b)) |
| 1817 | return Qt; | 1817 | return Qt; |
| 1818 | 1818 | ||
| 1819 | /* Make this buffer not be current. Exit if it is the sole visible | 1819 | /* Make this buffer not be current. Exit if it is the sole visible |
| @@ -1846,7 +1846,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1846 | 1846 | ||
| 1847 | /* Killing buffer processes may run sentinels which may have killed | 1847 | /* Killing buffer processes may run sentinels which may have killed |
| 1848 | our buffer. */ | 1848 | our buffer. */ |
| 1849 | if (NILP (BVAR (b, name))) | 1849 | if (!BUFFER_LIVE_P (b)) |
| 1850 | return Qt; | 1850 | return Qt; |
| 1851 | 1851 | ||
| 1852 | /* These may run Lisp code and into infinite loops (if someone | 1852 | /* These may run Lisp code and into infinite loops (if someone |
| @@ -1878,7 +1878,7 @@ cleaning up all windows currently displaying the buffer to be killed. */) | |||
| 1878 | } | 1878 | } |
| 1879 | 1879 | ||
| 1880 | /* Deleting an auto-save file could have killed our buffer. */ | 1880 | /* Deleting an auto-save file could have killed our buffer. */ |
| 1881 | if (NILP (BVAR (b, name))) | 1881 | if (!BUFFER_LIVE_P (b)) |
| 1882 | return Qt; | 1882 | return Qt; |
| 1883 | 1883 | ||
| 1884 | if (b->base_buffer) | 1884 | if (b->base_buffer) |
| @@ -2047,7 +2047,7 @@ the current buffer's major mode. */) | |||
| 2047 | 2047 | ||
| 2048 | CHECK_BUFFER (buffer); | 2048 | CHECK_BUFFER (buffer); |
| 2049 | 2049 | ||
| 2050 | if (NILP (BVAR (XBUFFER (buffer), name))) | 2050 | if (!BUFFER_LIVE_P (XBUFFER (buffer))) |
| 2051 | error ("Attempt to set major mode for a dead buffer"); | 2051 | error ("Attempt to set major mode for a dead buffer"); |
| 2052 | 2052 | ||
| 2053 | if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) | 2053 | if (strcmp (SSDATA (BVAR (XBUFFER (buffer), name)), "*scratch*") == 0) |
| @@ -2183,7 +2183,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 2183 | buffer = Fget_buffer (buffer_or_name); | 2183 | buffer = Fget_buffer (buffer_or_name); |
| 2184 | if (NILP (buffer)) | 2184 | if (NILP (buffer)) |
| 2185 | nsberror (buffer_or_name); | 2185 | nsberror (buffer_or_name); |
| 2186 | if (NILP (BVAR (XBUFFER (buffer), name))) | 2186 | if (!BUFFER_LIVE_P (XBUFFER (buffer))) |
| 2187 | error ("Selecting deleted buffer"); | 2187 | error ("Selecting deleted buffer"); |
| 2188 | set_buffer_internal (XBUFFER (buffer)); | 2188 | set_buffer_internal (XBUFFER (buffer)); |
| 2189 | return buffer; | 2189 | return buffer; |
| @@ -2194,7 +2194,7 @@ ends when the current command terminates. Use `switch-to-buffer' or | |||
| 2194 | Lisp_Object | 2194 | Lisp_Object |
| 2195 | set_buffer_if_live (Lisp_Object buffer) | 2195 | set_buffer_if_live (Lisp_Object buffer) |
| 2196 | { | 2196 | { |
| 2197 | if (! NILP (BVAR (XBUFFER (buffer), name))) | 2197 | if (BUFFER_LIVE_P (XBUFFER (buffer))) |
| 2198 | set_buffer_internal (XBUFFER (buffer)); | 2198 | set_buffer_internal (XBUFFER (buffer)); |
| 2199 | return Qnil; | 2199 | return Qnil; |
| 2200 | } | 2200 | } |
| @@ -2289,7 +2289,7 @@ DEFUN ("buffer-swap-text", Fbuffer_swap_text, Sbuffer_swap_text, | |||
| 2289 | CHECK_BUFFER (buffer); | 2289 | CHECK_BUFFER (buffer); |
| 2290 | other_buffer = XBUFFER (buffer); | 2290 | other_buffer = XBUFFER (buffer); |
| 2291 | 2291 | ||
| 2292 | if (NILP (BVAR (other_buffer, name))) | 2292 | if (!BUFFER_LIVE_P (other_buffer)) |
| 2293 | error ("Cannot swap a dead buffer's text"); | 2293 | error ("Cannot swap a dead buffer's text"); |
| 2294 | 2294 | ||
| 2295 | /* Actually, it probably works just fine. | 2295 | /* Actually, it probably works just fine. |
| @@ -2685,7 +2685,7 @@ current buffer is cleared. */) | |||
| 2685 | /* Copy this buffer's new multibyte status | 2685 | /* Copy this buffer's new multibyte status |
| 2686 | into all of its indirect buffers. */ | 2686 | into all of its indirect buffers. */ |
| 2687 | FOR_EACH_BUFFER (other) | 2687 | FOR_EACH_BUFFER (other) |
| 2688 | if (other->base_buffer == current_buffer && !NILP (BVAR (other, name))) | 2688 | if (other->base_buffer == current_buffer && BUFFER_LIVE_P (other)) |
| 2689 | { | 2689 | { |
| 2690 | BVAR (other, enable_multibyte_characters) | 2690 | BVAR (other, enable_multibyte_characters) |
| 2691 | = BVAR (current_buffer, enable_multibyte_characters); | 2691 | = BVAR (current_buffer, enable_multibyte_characters); |