diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index 6e2f097ae88..15cb9f29356 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1471,7 +1471,16 @@ with SIGHUP. */) | |||
| 1471 | unlock_buffer (b); | 1471 | unlock_buffer (b); |
| 1472 | #endif /* CLASH_DETECTION */ | 1472 | #endif /* CLASH_DETECTION */ |
| 1473 | 1473 | ||
| 1474 | GCPRO1 (buf); | ||
| 1474 | kill_buffer_processes (buf); | 1475 | kill_buffer_processes (buf); |
| 1476 | UNGCPRO; | ||
| 1477 | |||
| 1478 | /* Killing buffer processes may run sentinels which may | ||
| 1479 | have called kill-buffer. */ | ||
| 1480 | |||
| 1481 | if (NILP (b->name)) | ||
| 1482 | return Qnil; | ||
| 1483 | |||
| 1475 | clear_charpos_cache (b); | 1484 | clear_charpos_cache (b); |
| 1476 | 1485 | ||
| 1477 | tem = Vinhibit_quit; | 1486 | tem = Vinhibit_quit; |
| @@ -1644,6 +1653,8 @@ the current buffer's major mode. */) | |||
| 1644 | int count; | 1653 | int count; |
| 1645 | Lisp_Object function; | 1654 | Lisp_Object function; |
| 1646 | 1655 | ||
| 1656 | CHECK_BUFFER (buffer); | ||
| 1657 | |||
| 1647 | if (STRINGP (XBUFFER (buffer)->name) | 1658 | if (STRINGP (XBUFFER (buffer)->name) |
| 1648 | && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) | 1659 | && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) |
| 1649 | function = find_symbol_value (intern ("initial-major-mode")); | 1660 | function = find_symbol_value (intern ("initial-major-mode")); |