From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: test for a (really) visible frame? test if a frame is the only (really visible) one? Date: Tue, 2 Mar 2010 10:29:48 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1267554619 3599 80.91.229.12 (2 Mar 2010 18:30:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 2 Mar 2010 18:30:19 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 02 19:30:14 2010 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.69) (envelope-from ) id 1NmWr9-0000bO-7u for ged-emacs-devel@m.gmane.org; Tue, 02 Mar 2010 19:30:07 +0100 Original-Received: from localhost ([127.0.0.1]:42813 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmWr8-0006fJ-CE for ged-emacs-devel@m.gmane.org; Tue, 02 Mar 2010 13:30:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NmWr2-0006f7-6X for emacs-devel@gnu.org; Tue, 02 Mar 2010 13:30:00 -0500 Original-Received: from [140.186.70.92] (port=57979 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NmWr1-0006ez-Al for emacs-devel@gnu.org; Tue, 02 Mar 2010 13:29:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NmWr0-0007HT-DF for emacs-devel@gnu.org; Tue, 02 Mar 2010 13:29:59 -0500 Original-Received: from acsinet12.oracle.com ([141.146.126.234]:27177) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NmWr0-0007HH-5a for emacs-devel@gnu.org; Tue, 02 Mar 2010 13:29:58 -0500 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o22ITsmC029473 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 2 Mar 2010 18:29:56 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o22D9beb006084 for ; Tue, 2 Mar 2010 18:29:53 GMT Original-Received: from abhmt014.oracle.com by acsmt355.oracle.com with ESMTP id 59386441267554591; Tue, 02 Mar 2010 10:29:51 -0800 Original-Received: from dradamslap1 (/10.175.218.42) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Mar 2010 10:29:49 -0800 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acq6NlcZQp1bGTG4Temqp3g7yxXtLQ== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Message-Flag: Follow up X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090208.4B8D5921.01A6:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:121560 Archived-At: IIUC (please correct any misconceptions - consider these as questions): 1. Every terminal frame is considered visible, always, whether or not you can see it currently. 2. `visible-frame-list' (and `frame-visible-p') can include not only frames that you actually see but also (terminal) frames that you cannot see. 3. `emacs --daemon' adds an extra terminal frame named (usually? always?) `F1' that is not (necessarily? ever?) visible to the eye, but is considered visible by Emacs (since it is a terminal frame). It seems that it is _never_ visible to the eye: If you delete (only) the other visible frames, then you can no longer see any frames at all. 4. It is impossible to test whether a given frame is a terminal frame. There is no predicate for this and no frame parameter that indicates this. 5. It is impossible to test whether a given frame is a/the hidden-to-the-eye (but "visible") frame that is used only to implement `--daemon'. 6. It is impossible to test whether a given frame is the sole frame visible to the eye. One could try to test #6 using (cdr (visible-frame-list)), but that will apparently never be nil if `--daemon' is used, because of the extra, under-the-covers frame, F1. One could try to test whether, if `visible-frame-list' is a doubleton, the second (or is it sometimes the first?) frame has the name "F1", to try to handle the `--daemon' case. But that's fragile. Anyone could name any frame "F1" - the name is not a reliable indication of the kind of frame it is. [Caveat: I haven't tested any of the `--daemon' stuff myself, since I'm using Windows, and AFAIK `--daemon' isn't supported on Windows. This is my understanding based on hearing from others and reading the doc.] --- Request: If the above are correct, could we please have some way to effect the tests #4, #5, and #6? Simple use case: Define a function to delete the selected window or, if only one window, the selected frame - but never delete the last frame visible to the eye (including when `--daemon' is used). It seems like the following choices together have resulted in a fragile situation that doesn't make it easy (or even possible?) to know what's going on: a. Considering all terminal frames as "visible". (Why?) b. Naming the terminal frames with mundane names like "F1". (Why?) c. Not having any frame parameter or predicate that distinguishes a terminal frame. (Why not?) d. Adding an invisible "visible" frame, F1, as part of the way to implement `--daemon'. (Why?) I can understand (a) and (b), I guess. In some sense, terminal frames _are_ always visible. And it's useful to refer to them using simple names. But things seem very different for the extra frame that is used to implement `--daemon': (a) It is not there to take over and be shown if you delete all other visible frames. If you do that, you lose all frames visible to the eye - you lose any way to interact with Emacs other than by the external command line. (b) A user will never, I think, refer to that special `--daemon' frame by name, switching to it as `F1' (is that even possible?). But unlike hidden buffers (e.g. ` *foo*'), this frame's name is a normal one.