From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36894: Stability issues in frameset sorting Date: Tue, 06 Aug 2019 00:17:32 +0300 Organization: LINKOV.NET Message-ID: <877e7rwbv7.fsf@mail.linkov.net> References: <878sscwovy.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="185034"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) To: 36894@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 05 23:19:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hukNw-000m0f-RP for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Aug 2019 23:19:16 +0200 Original-Received: from localhost ([::1]:57026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hukNv-0001HO-Sa for geb-bug-gnu-emacs@m.gmane.org; Mon, 05 Aug 2019 17:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38260) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hukNm-0001Eg-QA for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2019 17:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hukNl-0000gp-4w for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2019 17:19:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55389) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hukNk-0000gX-IL for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2019 17:19:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hukNk-0004vb-D3 for bug-gnu-emacs@gnu.org; Mon, 05 Aug 2019 17:19:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 05 Aug 2019 21:19:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36894 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 36894-submit@debbugs.gnu.org id=B36894.156503994318930 (code B ref 36894); Mon, 05 Aug 2019 21:19:04 +0000 Original-Received: (at 36894) by debbugs.gnu.org; 5 Aug 2019 21:19:03 +0000 Original-Received: from localhost ([127.0.0.1]:35973 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hukNg-0004v3-VX for submit@debbugs.gnu.org; Mon, 05 Aug 2019 17:19:03 -0400 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:24729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hukNe-0004ut-M6 for 36894@debbugs.gnu.org; Mon, 05 Aug 2019 17:18:59 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 352061A2884 for <36894@debbugs.gnu.org>; Mon, 5 Aug 2019 21:18:57 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a2.g.dreamhost.com (100-96-38-55.trex.outbound.svc.cluster.local [100.96.38.55]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 945731A298C for <36894@debbugs.gnu.org>; Mon, 5 Aug 2019 21:18:56 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a2.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Mon, 05 Aug 2019 21:18:57 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Versed-Shrill: 3c5e0144484d4f11_1565039936867_3359135018 X-MC-Loop-Signature: 1565039936866:251685448 X-MC-Ingress-Time: 1565039936866 Original-Received: from pdx1-sub0-mail-a2.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a2.g.dreamhost.com (Postfix) with ESMTP id 9093A837D8 for <36894@debbugs.gnu.org>; Mon, 5 Aug 2019 14:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=2FKPk5nTDb7hWcZz/FHHwVZZgfc=; b= LrjTew3SpC1U6w/BShr5+0lrtwuF+x4RQGPq+FdW1WJa2DxLrjP0o1sDeIcL3ckg wy29a5CM2GjyNHrtaxoznDWNr6khrk5TU5E6l3H7ENOq12ptjaGZcR9YWpdXIUue n5dCCxY0it/6tA9YtIQ24tmfYqGp9Mr7RGU+v4S+Ee0= Original-Received: from mail.jurta.org (m91-129-103-91.cust.tele2.ee [91.129.103.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a2.g.dreamhost.com (Postfix) with ESMTPSA id D0D80837D3 for <36894@debbugs.gnu.org>; Mon, 5 Aug 2019 14:18:48 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a2 In-Reply-To: <878sscwovy.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 02 Aug 2019 00:34:57 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduvddruddtkedgudekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtfedrledunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtfedrledupdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfeeikeelgeesuggvsggsuhhgshdrghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:164654 Archived-At: --=-=-= Content-Type: text/plain > 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=frameset--minibufferless-last-p.last-focus-update.patch 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)) --=-=-=--