From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.multi-tty,gmane.emacs.devel Subject: Re: Emacs routinely gets stuck in single_kboard mode Date: Mon, 12 Jul 2004 19:58:04 -0400 Sender: multi-tty-bounces@lists.fnord.hu Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1089676765 15940 80.91.224.253 (12 Jul 2004 23:59:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Jul 2004 23:59:25 +0000 (UTC) Cc: multi-tty@lists.fnord.hu, emacs-devel@gnu.org Original-X-From: multi-tty-bounces@lists.fnord.hu Tue Jul 13 01:59:19 2004 Return-path: Original-Received: from ninsei.hu ([212.92.23.158] helo=chatsubo.ninsei.hu) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BkAhY-0000AD-00 for ; Tue, 13 Jul 2004 01:59:17 +0200 Original-Received: from [127.0.0.1] (nixon [127.0.0.1]) by chatsubo.ninsei.hu (Postfix) with ESMTP id 99E7A1AC8F; Tue, 13 Jul 2004 01:59:01 +0200 (CEST) Original-Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164]) by chatsubo.ninsei.hu (Postfix) with ESMTP id EE8961AC8D for ; Tue, 13 Jul 2004 01:58:58 +0200 (CEST) Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1BkAgO-0000yr-28; Mon, 12 Jul 2004 19:58:04 -0400 Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Sun, 11 Jul 2004 19:23:45 -0400) X-BeenThere: multi-tty@lists.fnord.hu X-Mailman-Version: 2.1.4 Precedence: list List-Id: Discussions of multiple tty support in Emacs List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: multi-tty-bounces@lists.fnord.hu Xref: main.gmane.org gmane.emacs.multi-tty:25 gmane.emacs.devel:25634 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:25634 Killing the sole frame on a certain display should exit single_kboard mode if it is enabled on tht display. Would someone like to implement that? I decided to write it rather than wonder if someone would. Does this fix it? Add the following function to keyboard.c and install the patch below. /* If we're in single_kboard state for kboard KBOARD, get out of it. */ void not_single_kboard_state (kboard) KBOARD *kboard; { if (kboard == current_kboard) single_kboard = 0; } *** frame.c 16 Nov 2003 20:36:24 -0500 1.306 --- frame.c 12 Jul 2004 16:55:02 -0400 *************** *** 1327,1332 **** --- 1327,1362 ---- } } + /* If there's no other frame on the same kboard, get out of + single-kboard state if we're in it for this kboard. */ + { + Lisp_Object frames; + /* Some frame we found on the same kboard, or nil if there are none. */ + Lisp_Object frame_on_same_kboard; + + frame_on_same_kboard = Qnil; + + for (frames = Vframe_list; + CONSP (frames); + frames = XCDR (frames)) + { + Lisp_Object this; + struct frame *f1; + + this = XCAR (frames); + if (!FRAMEP (this)) + abort (); + f1 = XFRAME (this); + + if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)) + frame_on_same_kboard = this; + } + + if (NILP (frame_on_same_kboard)) + not_single_kboard_state (FRAME_KBOARD (f)); + } + + /* If we've deleted this keyboard's default_minibuffer_frame, try to find another one. Prefer minibuffer-only frames, but also notice frames with other windows. */