diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2013-07-26 19:49:52 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2013-07-26 19:49:52 +0200 |
commit | d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc (patch) | |
tree | b85542051fc11953833f94abb9e35782202c1303 /lisp/desktop.el | |
parent | a04689de43f58c4120e8780628bc9439efaf6393 (diff) | |
download | emacs-d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc.tar.gz emacs-d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc.tar.bz2 emacs-d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc.zip |
lisp/desktop.el (desktop--select-frame): Try harder to reuse the initial frame.
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r-- | lisp/desktop.el | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el index a29a30971aa..d5895a8de57 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1235,10 +1235,20 @@ is the parameter list of the frame being restored. Internal use only." ;; If the frame has its own minibuffer, let's see whether ;; that frame has already been loaded (which can happen after ;; M-x desktop-read). - (setq frame (or (desktop--find-frame - (lambda (f m) - (equal (frame-parameter f 'desktop--mini) m)) - display mini)))) + (setq frame (desktop--find-frame + (lambda (f m) + (equal (frame-parameter f 'desktop--mini) m)) + display mini)) + ;; If it has not been loaded, and it is not a minibuffer-only frame, + ;; let's look for an existing non-minibuffer-only frame to reuse. + (unless (or frame (eq (cdr (assq 'minibuffer frame-cfg)) 'only)) + (setq frame (desktop--find-frame + (lambda (f) + (let ((w (frame-parameter f 'minibuffer))) + (and (window-live-p w) + (window-minibuffer-p w) + (eq (window-frame w) f)))) + display)))) (mini ;; For minibufferless frames, check whether they already exist, ;; and that they are linked to the right minibuffer frame. |