summaryrefslogtreecommitdiff
path: root/src/thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-03-18 08:48:53 -0600
committerTom Tromey <tromey@redhat.com>2013-03-18 08:48:53 -0600
commitcbcba8ce7f980b01c18c0fd561ef6687b1361507 (patch)
tree140c65bdc6c44e7539d853cb9f66bc5a7e500351 /src/thread.c
parentdad8121b0e4438e68b23d388585f703e75951337 (diff)
downloademacs-cbcba8ce7f980b01c18c0fd561ef6687b1361507.tar.gz
emacs-cbcba8ce7f980b01c18c0fd561ef6687b1361507.tar.bz2
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.c19
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,
+int
+thread_check_current_buffer (struct buffer *buffer)
+{
+ struct thread_state *iter;
+
+ for (iter = all_threads; iter; iter = iter->next_thread)
+ {
+ if (iter == current_thread)
+ continue;
+
+ if (iter->m_current_buffer == buffer)
+ return 1;
+ }
+
+ return 0;
+}
+
+
+
static void
init_primary_thread (void)
{