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: Fri, 01 Sep 2017 09:41:12 -0400 Message-ID: <87bmmu7czr.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> <87wp7ukw8x.fsf@users.sourceforge.net> <5955F510.5040101@gmx.at> <87efrr6rgx.fsf@users.sourceforge.net> <59A95A75.8040100@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1504273451 12956 195.159.176.226 (1 Sep 2017 13:44:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Sep 2017 13:44:11 +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: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 01 15:44:00 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 1dnmEZ-0001m7-1e for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Sep 2017 15:43:43 +0200 Original-Received: from localhost ([::1]:41028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnmEe-0002Qw-6I for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Sep 2017 09:43:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dnmBA-0007kh-8l for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2017 09:40:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dnmB0-0005PQ-Pb for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2017 09:40:12 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dnmB0-0005P0-Jm for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2017 09:40:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dnmB0-0004og-7j for bug-gnu-emacs@gnu.org; Fri, 01 Sep 2017 09:40:02 -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, 01 Sep 2017 13:40:02 +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: patch Original-Received: via spool by 25521-submit@debbugs.gnu.org id=B25521.150427318018482 (code B ref 25521); Fri, 01 Sep 2017 13:40:02 +0000 Original-Received: (at 25521) by debbugs.gnu.org; 1 Sep 2017 13:39:40 +0000 Original-Received: from localhost ([127.0.0.1]:39456 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnmAe-0004o0-7U for submit@debbugs.gnu.org; Fri, 01 Sep 2017 09:39:40 -0400 Original-Received: from mail-io0-f174.google.com ([209.85.223.174]:34493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnmAc-0004nm-QY for 25521@debbugs.gnu.org; Fri, 01 Sep 2017 09:39:39 -0400 Original-Received: by mail-io0-f174.google.com with SMTP id i200so1533573ioa.1 for <25521@debbugs.gnu.org>; Fri, 01 Sep 2017 06:39:38 -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=HqvT10k6u14LCcHFQhVeqspvBFUQWGoMEgir4tcu5xQ=; b=iMSczSXSE9lJ0gGtveeP1dMuFpHn8y+jKYO3OgutoSkozmpjPOfXw23JWvDdpCdWCR 130y79NtQE3Eqzk+cVsu+FZljRfBsx5xCrqe+G/k7U9Ndq79WhO29WIsK9R2ZRwunGmO WClMZzkqV8i7imkHQ3TjeRgodpghriMEdu7N39e6V1AhAh9zd05GdcL0alvFb50Y/32H 9Eqd2xLdK/i55w0RqfDyqO9+VDNARDH3vLs8CFfxrDslKE122SXU4I/AICmguUn9ictE tzzMcThSk4B/yZqKHPtGuwWXl99/sJ7Pbmigs6LNCq1djLehhdMt6ST/ebemgGURJmZq NL/A== 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=HqvT10k6u14LCcHFQhVeqspvBFUQWGoMEgir4tcu5xQ=; b=aBJn4FcYrDx/D/cWLr577Kn305c3dunjDWkqrAr9KzsAoMBsOOvN6lUO3PwM/1dri7 amlcJMFKqCQD7Rhp8I6smCxmWQiMyRh1sgtY6WgvE6FXw//ygLtgP8ZJd7nnE55XrYs6 kSV3qFOdeWbIWrUN+7bwd34jaYAFAKSxFv3uuZjm6P26ExQKUVPux79KKxxftH4YbPJk PyxtQIGos8rM9HQapn4PCUmphIHOcETRvxuqrtMciN58yXLqyNMXWX7FxZy6tp52rMbf XfPWv58gH8Yp+dANdoKZY7im7QdrZayc+VxlsWAk+n/nQVNKooi9a5eTOgaV0keq9M0N l/1w== X-Gm-Message-State: AHPjjUij/vS/BttUwwO3vOMXrUptiGEgD4fGBkWcmvuypRA3RXVIph/p TeK8BWNmC2a6vA== X-Google-Smtp-Source: ADKCNb7PKXCSO3R4PQIe3AmF6gJfMM9C+I5AiNjBuCD+rJk1J9h4L1e5yQ0AafdhGVjfQr3AGpLtvw== X-Received: by 10.36.163.199 with SMTP id p190mr675026ite.67.1504273173166; Fri, 01 Sep 2017 06:39:33 -0700 (PDT) Original-Received: from zony ([45.2.119.49]) by smtp.googlemail.com with ESMTPSA id s66sm57595itd.21.2017.09.01.06.39.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Sep 2017 06:39:32 -0700 (PDT) In-Reply-To: <59A95A75.8040100@gmx.at> (martin rudalics's message of "Fri, 01 Sep 2017 15:02:45 +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:136442 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable martin rudalics writes: > I'm not very convinced. First, the present bug should not motivate this > change. =E2=80=98select-frame-by-name=E2=80=99 is a pretty obscure funct= ion. It fails > in the OP's case because the display info for the new frame has not been > yet set up. In the interactive call, suggesting a default frame on the > current terminal makes sense; so consulting that info is useful. But > the info is useless in a non-interactive call: Nothing should prevent > that function from selecting a frame with a given name on any display. Ah, so we could just do something like this? (untested) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Let-select-frame-by-name-choose-any-frame-when-ca.patch Content-Description: patch >From c31a39c300e32af1f9b810e92065208eb1b5c2f3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 1 Sep 2017 09:38:55 -0400 Subject: [PATCH v2] Let select-frame-by-name choose any frame when called from lisp (Bug#25521) * lisp/frame.el (select-frame-by-name): Choose from the whole list of frames in the non-interactive part. --- lisp/frame.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index 2a14302e9f..e8b7c82cbb 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -905,11 +905,12 @@ select-frame-by-name (if (= (length input) 0) (list default) (list input)))) - (let* ((frame-names-alist (make-frame-names-alist)) - (frame (cdr (assoc name frame-names-alist)))) - (if frame - (select-frame-set-input-focus frame) - (error "There is no frame named `%s'" name)))) + (catch 'done + (dolist (frame (frame-list)) + (when (equal (frame-parameter frame 'name) name) + (select-frame-set-input-focus frame) + (throw 'done t))) + (error "There is no frame named `%s'" name))) ;;;; Background mode. -- 2.14.1 --=-=-=--