+2013-07-26 Juanma Barranquero <lekktu@gmail.com>
+
+ * desktop.el (desktop--select-frame):
+ Try harder to reuse the initial frame.
+
2013-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/edebug.el: Use backtrace-eval to handle lexical variables.
;; 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.