GNU bug report logs - #36894
Restore frameset focus and selectedness

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 1 Aug 2019 21:47:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: 36894 <at> debbugs.gnu.org
Subject: bug#36894: Stability issues in frameset sorting
Date: Tue, 06 Aug 2019 00:17:32 +0300
[Message part 1 (text/plain, inline)]
> Currently frameset sorting is not stable.  It changes the sorting order of equal
> minibuffer-owning frames.  On closer inspection it becomes clear that
> frameset--mini parameters are messed up in 'frameset--minibufferless-last-p'.
> This patch should fix it:

Pushed to master.

Now one problem still remains: the desktop file doesn't restore the
selected frame, i.e. after restoring frames from the desktop file,
the selected frame is not the same as was before saving the desktop.
This patch ensures that the previously selected frame is restored last,
thus becoming selected again:

[frameset--minibufferless-last-p.last-focus-update.patch (text/x-diff, inline)]
diff --git a/lisp/frameset.el b/lisp/frameset.el
index a8b16706c2..8e69bfb499 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -1104,7 +1106,9 @@ frameset--minibufferless-last-p
 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)
+    (cond ((and (eq hasmini1 t) (eq hasmini2 t) (eq (cdr (assq 'last-focus-update (car state1))) t)) nil)
+          ((and (eq hasmini1 t) (eq hasmini2 t) (eq (cdr (assq 'last-focus-update (car state2))) t)) t)
+          ((eq id-def1 t) t)
 	  ((eq id-def2 t) nil)
 	  ((not (eq hasmini1 hasmini2)) (eq hasmini1 t))
 	  ((eq hasmini1 nil) (or id-def1 id-def2))

This bug report was last modified 5 years and 361 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.