From: Juanma Barranquero Date: Wed, 12 Mar 2014 18:36:26 +0000 (+0100) Subject: lisp/frameset.el: Optimize check for visible frame. X-Git-Tag: emacs-24.3.90~206 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d27a1a7b394fbcb28aef87e1aa865407237d5939;p=emacs.git 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. --- 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)))))