]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/frameset.el (frameset--minibufferless-last-p): Add comments (bug#36894)
authorJuri Linkov <juri@linkov.net>
Fri, 9 Aug 2019 18:08:54 +0000 (21:08 +0300)
committerJuri Linkov <juri@linkov.net>
Fri, 9 Aug 2019 18:08:54 +0000 (21:08 +0300)
lisp/frameset.el

index a8b16706c2d42c2191bbaddafbccbaab093349ad..60b6fe38ad947acb746ac409aadfe2938dafd35f 100644 (file)
@@ -1104,9 +1104,18 @@ It sorts minibuffer-owning frames before minibufferless ones.
 Internal use only."
   (pcase-let ((`(,hasmini1 . ,id-def1) (cdr (assq 'frameset--mini (car state1))))
              (`(,hasmini2 . ,id-def2) (cdr (assq 'frameset--mini (car state2)))))
-    (cond ((eq id-def1 t) t)
+    ;; hasmini1 is t when 1st frame has its own minibuffer
+    ;; hasmini2 is t when 2nd frame has its own minibuffer
+    ;; id-def1 is t when 1st minibuffer-owning frame is the default-minibuffer-frame
+    ;;         or frame-id of 1st frame if it's minibufferless
+    ;; id-def2 is t when 2nd minibuffer-owning frame is the default-minibuffer-frame
+    ;;         or frame-id of 2nd frame if it's minibufferless
+    (cond ;; Sort the minibuffer-owning default-minibuffer-frame first
+         ((eq id-def1 t) t)
          ((eq id-def2 t) nil)
-         ((not (eq hasmini1 hasmini2)) (eq hasmini1 t))
+         ;; Sort non-default minibuffer-owning frames before minibufferless
+         ((not (eq hasmini1 hasmini2)) (eq hasmini1 t)) ;; boolean xor
+         ;; Sort minibufferless frames with frame-id before some remaining
          ((eq hasmini1 nil) (or id-def1 id-def2))
          (t t))))