diff options
| author | Tom Tromey | 2013-03-18 08:48:53 -0600 |
|---|---|---|
| committer | Tom Tromey | 2013-03-18 08:48:53 -0600 |
| commit | cbcba8ce7f980b01c18c0fd561ef6687b1361507 (patch) | |
| tree | 140c65bdc6c44e7539d853cb9f66bc5a7e500351 /src/thread.c | |
| parent | dad8121b0e4438e68b23d388585f703e75951337 (diff) | |
| download | emacs-cbcba8ce7f980b01c18c0fd561ef6687b1361507.tar.gz emacs-cbcba8ce7f980b01c18c0fd561ef6687b1361507.zip | |
don't let kill-buffer kill a buffer if it is current in any thread
Diffstat (limited to 'src/thread.c')
| -rw-r--r-- | src/thread.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/thread.c b/src/thread.c index 551f3de10e4..7de260ee3c0 100644 --- a/src/thread.c +++ b/src/thread.c | |||
| @@ -881,6 +881,25 @@ DEFUN ("all-threads", Fall_threads, Sall_threads, 0, 0, 0, | |||
| 881 | 881 | ||
| 882 | 882 | ||
| 883 | 883 | ||
| 884 | int | ||
| 885 | thread_check_current_buffer (struct buffer *buffer) | ||
| 886 | { | ||
| 887 | struct thread_state *iter; | ||
| 888 | |||
| 889 | for (iter = all_threads; iter; iter = iter->next_thread) | ||
| 890 | { | ||
| 891 | if (iter == current_thread) | ||
| 892 | continue; | ||
| 893 | |||
| 894 | if (iter->m_current_buffer == buffer) | ||
| 895 | return 1; | ||
| 896 | } | ||
| 897 | |||
| 898 | return 0; | ||
| 899 | } | ||
| 900 | |||
| 901 | |||
| 902 | |||
| 884 | static void | 903 | static void |
| 885 | init_primary_thread (void) | 904 | init_primary_thread (void) |
| 886 | { | 905 | { |