From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: multiple displays and ttys Date: Fri, 21 Sep 2007 04:08:01 -0400 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190362100 12384 80.91.229.12 (21 Sep 2007 08:08:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2007 08:08:20 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 21 10:08:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IYdYY-0005IZ-Ie for ged-emacs-devel@m.gmane.org; Fri, 21 Sep 2007 10:08:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYdYW-0002nU-Ir for ged-emacs-devel@m.gmane.org; Fri, 21 Sep 2007 04:08:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYdYS-0002lE-SU for emacs-devel@gnu.org; Fri, 21 Sep 2007 04:08:04 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYdYR-0002iV-4d for emacs-devel@gnu.org; Fri, 21 Sep 2007 04:08:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYdYR-0002iB-0g for emacs-devel@gnu.org; Fri, 21 Sep 2007 04:08:03 -0400 Original-Received: from tomts43.bellnexxia.net ([209.226.175.110] helo=tomts43-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IYdYQ-0002ve-J8 for emacs-devel@gnu.org; Fri, 21 Sep 2007 04:08:02 -0400 Original-Received: from ceviche.home ([70.53.192.71]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070921080801.NVXV26794.tomts43-srv.bellnexxia.net@ceviche.home> for ; Fri, 21 Sep 2007 04:08:01 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 74BBCB4134; Fri, 21 Sep 2007 04:08:01 -0400 (EDT) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:79425 Archived-At: Now that I'm using emacsclient even more, I more often bump into situations where Emacs displays a buffer in some display that I cannot see. I suggest the patch below which makes that only the frames on the `current terminal' are considered as visible. This way, when you're working on /dev/pts/2, all the frames on ":0.0" are considered as invisible, and similarly between different X displays. I find this invaluable. Any objection? Stefan diff -u -b /home/monnier/src/emacs/trunk/src/window.c /home/monnier/src/emacs/work/src/window.c --- /home/monnier/src/emacs/trunk/src/window.c 2007-09-21 03:55:52.000000000 -0400 +++ /home/monnier/src/emacs/work/src/window.c 2007-09-21 04:03:11.000000000 -0400 @@ -1794,7 +1798,8 @@ else if (EQ (all_frames, Qvisible)) { FRAME_SAMPLE_VISIBILITY (f); - candidate_p = FRAME_VISIBLE_P (f); + candidate_p = FRAME_VISIBLE_P (f) + && (FRAME_TERMINAL (f) == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (INTEGERP (all_frames) && XINT (all_frames) == 0) { @@ -1810,7 +1815,8 @@ || (FRAME_X_P (f) && f->output_data.x->asked_for_visible && !f->output_data.x->has_been_visible) #endif - ); + ) + && (FRAME_TERMINAL (f) == FRAME_TERMINAL (XFRAME (selected_frame))); } else if (WINDOWP (all_frames)) candidate_p = (EQ (FRAME_MINIBUF_WINDOW (f), all_frames)