From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#14841: Frames created invisible have their visibility parameter set to t Date: Thu, 25 Jul 2013 22:35:28 +0300 Message-ID: <83li4uv3en.fsf@gnu.org> References: <83a9ltun54.fsf@gnu.org> <837ggxukjt.fsf@gnu.org> <83hafx3wzz.fsf@gnu.org> <83vc45xuht.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1374786878 9455 80.91.229.3 (25 Jul 2013 21:14:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Jul 2013 21:14:38 +0000 (UTC) Cc: 14841@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 25 23:14:38 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V2Srt-0006A8-2p for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2013 23:14:37 +0200 Original-Received: from localhost ([::1]:57061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Srs-0007DW-Kn for geb-bug-gnu-emacs@m.gmane.org; Thu, 25 Jul 2013 17:14:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Srn-00078W-K5 for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2013 17:14:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2Srk-0002yS-QS for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2013 17:14:31 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:55418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2RKU-0002Br-Gw for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2013 15:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V2RKU-0008C4-0x for bug-gnu-emacs@gnu.org; Thu, 25 Jul 2013 15:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jul 2013 19:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14841 X-GNU-PR-Package: emacs,w32 X-GNU-PR-Keywords: Original-Received: via spool by 14841-submit@debbugs.gnu.org id=B14841.137478094431405 (code B ref 14841); Thu, 25 Jul 2013 19:36:01 +0000 Original-Received: (at 14841) by debbugs.gnu.org; 25 Jul 2013 19:35:44 +0000 Original-Received: from localhost ([127.0.0.1]:49734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V2RKB-0008AO-Ll for submit@debbugs.gnu.org; Thu, 25 Jul 2013 15:35:44 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:58847) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V2RK6-00089R-5e for 14841@debbugs.gnu.org; Thu, 25 Jul 2013 15:35:41 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MQI00500BBQLW00@a-mtaout21.012.net.il> for 14841@debbugs.gnu.org; Thu, 25 Jul 2013 22:35:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MQI0050LBR7M420@a-mtaout21.012.net.il>; Thu, 25 Jul 2013 22:35:31 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76658 Archived-At: > From: Juanma Barranquero > Date: Wed, 24 Jul 2013 18:50:03 +0200 > Cc: 14841@debbugs.gnu.org > > ;;; .emacs > (let ((f (selected-frame))) > (make-frame) > (delete-frame f)) > ;;; .emacs ends here > > emacs > > => > > Warning (initialization): An error occurred while loading > `c:/Devel/emacs/test/.emacs': > > error: Attempt to delete the sole visible or iconified frame Btw, this trivial modification will avoid the problem: (let ((f (selected-frame)) (f1 (make-frame))) (make-frame-visible f1) (delete-frame f)) as will this: (let ((f (selected-frame)) (f1 (make-frame))) (sit-for 0) (delete-frame f)) The problem here is that x-create-frame-with-faces does this: (setq parameters (x-handle-named-frame-geometry parameters)) (let* ((params (copy-tree parameters)) (visibility-spec (assq 'visibility parameters)) (delayed-params '(foreground-color background-color font border-color cursor-color mouse-color visibility scroll-bar-foreground scroll-bar-background)) frame success) (dolist (param delayed-params) (setq params (assq-delete-all param params))) (setq frame (x-create-frame `((visibility . nil) . ,params))) <<<<<<<<< (unwind-protect (progn (x-setup-function-keys frame) (x-handle-reverse-video frame parameters) (frame-set-background-mode frame t) (face-set-after-frame-default frame parameters) (if (null visibility-spec) (make-frame-visible frame) <<<<<<< (modify-frame-parameters frame (list visibility-spec))) <<<<<<< IOW, it first creates a frame that is invisible, and only then applies the visibility spec. So you must wait for the frame to come up before you can delete the initial frame.