From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#25521: 26.0.50; After (make-frame '((name . "foo"))) (select-frame-by-name "foo") doesn't see the frame Date: Thu, 29 Jun 2017 23:08:46 -0400 Message-ID: <87wp7ukw8x.fsf@users.sourceforge.net> References: <87a8agrwwx.fsf@gmail.com> <83lgtz3jdf.fsf@gnu.org> <87mvefk54q.fsf@gmail.com> <87inp2u2nn.fsf@users.sourceforge.net> <87r33qm4lh.fsf@gmail.com> <87a8adubtz.fsf@users.sourceforge.net> <877f5hq0tl.fsf@gmail.com> <87ziids1j2.fsf@users.sourceforge.net> <83vat10wdp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1498792094 20077 195.159.176.226 (30 Jun 2017 03:08:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Jun 2017 03:08:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 25521@debbugs.gnu.org, qwxlea@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 30 05:08:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQmHw-0004xE-NV for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Jun 2017 05:08:08 +0200 Original-Received: from localhost ([::1]:42293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQmI1-00062H-TD for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Jun 2017 23:08:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dQmHv-00062C-1I for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 23:08:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dQmHq-0002xt-1i for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 23:08:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42608) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dQmHp-0002xm-Tv for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 23:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dQmHp-0005g4-Lk for bug-gnu-emacs@gnu.org; Thu, 29 Jun 2017 23:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Jun 2017 03:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25521 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25521-submit@debbugs.gnu.org id=B25521.149879203921775 (code B ref 25521); Fri, 30 Jun 2017 03:08:01 +0000 Original-Received: (at 25521) by debbugs.gnu.org; 30 Jun 2017 03:07:19 +0000 Original-Received: from localhost ([127.0.0.1]:45285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQmH9-0005f9-7j for submit@debbugs.gnu.org; Thu, 29 Jun 2017 23:07:19 -0400 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:34612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dQmH6-0005eu-Gn for 25521@debbugs.gnu.org; Thu, 29 Jun 2017 23:07:16 -0400 Original-Received: by mail-io0-f195.google.com with SMTP id m19so2514643ioe.1 for <25521@debbugs.gnu.org>; Thu, 29 Jun 2017 20:07:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Ow5Don/ktGAXkt0rnKNMIoFPvMXE8KPYCkScaTchmXA=; b=ganbivLWf00EOq8Zk/Aek76IZsqQxtsZ64wM7/Zl1xaK+peqj/lxHxOLDNk6ejg0JB h1HDDkkRG/LJsCCQcwM4SUEpu/4XJcHcxrdtVuTsJLgVtPi2nYU9VwvfkeSP1SSP4+01 D/yvQcj9mECF7lHob0XWSsAQJTYSaPYK/ESx+7OEXVqNIOerER68kkFouCQBTWMjy/Vs X74QQVTKYBInI6P88upMjeZPTJUD4fcRyts6RfBxNnzik9ndHJ2nlK5XC9oyMDeEQQCu 2Au9XM2VMsWvu62oZPOTM6F24UWnDb7vURtwmgTSJ/E2EFTb3uQx3oe1aK3+GrWlnRmL fx1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Ow5Don/ktGAXkt0rnKNMIoFPvMXE8KPYCkScaTchmXA=; b=sA90eL3xCQTP9pKaAof5TwMz4FtagiBDYtFx/+Ium7fF8/FdKY9516UO2vv6VPTGGb fQX14SuKAPBW6fhxaGQ1b3tLE5ipsuQiF3GAT0ResLinJR9ulrRA2/HtgZ4Hitb+VMkH w0M/rtiEOZ+nADXwaGHnmZZjPZBFiXsr0Dt/pensnUGe+0D8Wme/DcVVcHAc80Ym/0E4 qDWjFJvCXj21T0LB0Cp3+8mFAIxu20bUPWztPDTjeUUvoCHt5xKgwM9GIekTiL/fQ7A+ +9bh4WZEJ7hor7uGWqBnUptg4ocYv+4cwcNZ8kJoXuNKf6Wob+qjmuHuCECaBQiqiToj 1Y2w== X-Gm-Message-State: AKS2vOznDcaWXoif7aj7Em2UjuM+KZuWPOd6K7Si4+DVUP81yIsdPzFG AoAs4RXb7MPsVw== X-Received: by 10.107.137.224 with SMTP id t93mr19229349ioi.215.1498792030826; Thu, 29 Jun 2017 20:07:10 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 95sm3740051ios.36.2017.06.29.20.07.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jun 2017 20:07:09 -0700 (PDT) In-Reply-To: <83vat10wdp.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 27 Jan 2017 09:56:02 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:134046 Archived-At: Eli Zaretskii writes: > Issues with rare use cases usually take many moons to emerge, but in > this case the complaints started right away. So it seems like the > elimination of the loop interferes with non-rare use cases, which > means we will probably be seeing much more of similar complaints in > the future, including for stuff people do in their init files without > too detailed understanding of the underlying machinery. On the other hand, I haven't seen any additional cases since the first two... > I'd expect at least some of these case not easily solved, and in any > case it's a nuisance to users and Lisp package developers. > > What's more, a similar loop still exists on w32, so we will have > subtly different behavior on different platforms. > > Reinstating the loop, but without the danger of inflooping, could have > taken care of these issues in advance. Thus my proposal. How about removing the delay from w32 as well, and implementing it in lisp, then it will be easier to play with (by the way, x_make_frame_visible in nsterm.m does not have any delay so we already had different behaviour on different platforms). --- c/lisp/frame.el +++ i/lisp/frame.el @@ -610,6 +610,15 @@ (defvar after-make-frame-functions nil "Functions to run after a frame is created. The functions are run with one arg, the newly created frame.") +(defun wait-until-frame-is-visible (frame) + "Busy wait until FRAME is visible." + (let ((start-time (current-time))) + (while (and (not (frame-visible-p frame)) + (< (float-time (subtract-time (current-time) start-time)) 1.0)) + (sit-for 0.05)))) + +(add-hook 'after-make-frame-functions #'wait-until-frame-is-visible) + (defvar after-setting-font-hook nil "Functions to run after a frame's font has been changed.")