aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2013-07-26 19:49:52 +0200
committerJuanma Barranquero2013-07-26 19:49:52 +0200
commitd58d31fbe7f1ee045f2040ac65c3b7f8797b30fc (patch)
treeb85542051fc11953833f94abb9e35782202c1303
parenta04689de43f58c4120e8780628bc9439efaf6393 (diff)
downloademacs-d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc.tar.gz
emacs-d58d31fbe7f1ee045f2040ac65c3b7f8797b30fc.zip
lisp/desktop.el (desktop--select-frame): Try harder to reuse the initial frame.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/desktop.el18
2 files changed, 19 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 28a9dde666c..d2f03c15301 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-07-26 Juanma Barranquero <lekktu@gmail.com>
2
3 * desktop.el (desktop--select-frame):
4 Try harder to reuse the initial frame.
5
12013-07-26 Stefan Monnier <monnier@iro.umontreal.ca> 62013-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * emacs-lisp/edebug.el: Use backtrace-eval to handle lexical variables. 8 * emacs-lisp/edebug.el: Use backtrace-eval to handle lexical variables.
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."
1235 ;; If the frame has its own minibuffer, let's see whether 1235 ;; If the frame has its own minibuffer, let's see whether
1236 ;; that frame has already been loaded (which can happen after 1236 ;; that frame has already been loaded (which can happen after
1237 ;; M-x desktop-read). 1237 ;; M-x desktop-read).
1238 (setq frame (or (desktop--find-frame 1238 (setq frame (desktop--find-frame
1239 (lambda (f m) 1239 (lambda (f m)
1240 (equal (frame-parameter f 'desktop--mini) m)) 1240 (equal (frame-parameter f 'desktop--mini) m))
1241 display mini)))) 1241 display mini))
1242 ;; If it has not been loaded, and it is not a minibuffer-only frame,
1243 ;; let's look for an existing non-minibuffer-only frame to reuse.
1244 (unless (or frame (eq (cdr (assq 'minibuffer frame-cfg)) 'only))
1245 (setq frame (desktop--find-frame
1246 (lambda (f)
1247 (let ((w (frame-parameter f 'minibuffer)))
1248 (and (window-live-p w)
1249 (window-minibuffer-p w)
1250 (eq (window-frame w) f))))
1251 display))))
1242 (mini 1252 (mini
1243 ;; For minibufferless frames, check whether they already exist, 1253 ;; For minibufferless frames, check whether they already exist,
1244 ;; and that they are linked to the right minibuffer frame. 1254 ;; and that they are linked to the right minibuffer frame.