GNU bug report logs -
#25521
26.0.50; After (make-frame '((name . "foo"))) (select-frame-by-name "foo") doesn't see the frame
Previous Next
Reported by: Alex 'QWxleA' Poslavsky <qwxlea <at> gmail.com>
Date: Tue, 24 Jan 2017 21:11:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 26.0.50
Done: Noam Postavsky <npostavs <at> users.sourceforge.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
martin rudalics <rudalics <at> gmx.at> writes:
> I'm not very convinced. First, the present bug should not motivate this
> change. ‘select-frame-by-name’ is a pretty obscure function. 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)
[v2-0001-Let-select-frame-by-name-choose-any-frame-when-ca.patch (text/x-diff, inline)]
From c31a39c300e32af1f9b810e92065208eb1b5c2f3 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
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
This bug report was last modified 7 years and 273 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.