From d27a1a7b394fbcb28aef87e1aa865407237d5939 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 12 Mar 2014 19:36:26 +0100 Subject: [PATCH] lisp/frameset.el: Optimize check for visible frame. (frameset-restore): When checking for a visible frame, use the action map instead of calling visible-frame-list. --- lisp/ChangeLog | 5 +++++ lisp/frameset.el | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5198f1f55ba..23da480f6b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-12 Juanma Barranquero + + * frameset.el (frameset-restore): When checking for a visible frame, + use the action map instead of calling visible-frame-list. + 2014-03-12 Jonas Bernoulli * emacs-lisp/eieio.el (with-slots): Use cl-symbol-macrolet (bug#16998). diff --git a/lisp/frameset.el b/lisp/frameset.el index 6470833d825..05fae1b4fa2 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -1230,7 +1230,12 @@ All keyword parameters default to nil." (delay-warning 'frameset (error-message-string err) :warning)))))) ;; Make sure there's at least one visible frame. - (unless (or (daemonp) (visible-frame-list)) + (unless (or (daemonp) + (catch 'visible + (maphash (lambda (frame _) + (and (frame-live-p frame) (frame-visible-p frame) + (throw 'visible t))) + frameset--action-map))) (make-frame-visible (selected-frame))))) -- 2.39.2