From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#55070: 28.1; desktop-load doesn't work in -nw (non-gui) emacs Date: Tue, 03 May 2022 19:31:01 +0300 Message-ID: <83levi4lyy.fsf@gnu.org> References: <83fsm4pbs4.fsf@gnu.org> <6961B895-263C-4632-AA4E-8DE29D6160BC@swenson.org> <83sfq3op15.fsf@gnu.org> <86wnfcxnvf.fsf@mail.linkov.net> <87mtg8i1za.fsf@gnus.org> <86h76fu9q5.fsf@mail.linkov.net> <83r15jltce.fsf@gnu.org> <86sfpzspz4.fsf@mail.linkov.net> <83o80nlnjm.fsf@gnu.org> <86fslysc14.fsf@mail.linkov.net> <19755688-1BC3-45A0-854D-031469E50DB9@swenson.org> <861qxhy9cz.fsf@mail.linkov.net> <5DA5751F-DC2F-4C40-AE30-DAF65BCF0572@swenson.org> <86a6c56ra5.fsf@mail.linkov.net> <83wnf77yii.fsf@gnu.org> <86wnf5f8of.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6018"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eric@swenson.org, 55070@debbugs.gnu.org, larsi@gnus.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 03 18:32:33 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nlvRw-0001Mt-QO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 18:32:32 +0200 Original-Received: from localhost ([::1]:59340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlvRv-0003rD-PW for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 12:32:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlvRT-0003pi-Fd for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 12:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlvRS-0000ia-Va for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 12:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlvRS-00058d-TA for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2022 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55070 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo patch Original-Received: via spool by 55070-submit@debbugs.gnu.org id=B55070.165159546316349 (code B ref 55070); Tue, 03 May 2022 16:32:02 +0000 Original-Received: (at 55070) by debbugs.gnu.org; 3 May 2022 16:31:03 +0000 Original-Received: from localhost ([127.0.0.1]:40827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlvQU-0004F7-Rh for submit@debbugs.gnu.org; Tue, 03 May 2022 12:31:03 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlvQS-00047A-Nm for 55070@debbugs.gnu.org; Tue, 03 May 2022 12:31:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:60926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlvQM-0000Y3-6I; Tue, 03 May 2022 12:30:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YdNMpBVLaynnVHAwnF/JOIrh6BhoVS85jC6ap2kTvH4=; b=semBG1t/sd2E KnQHl2nJHVPnhYuNAa3I9IYQ02MPl9fT1bj0WfLBsjM5GdDw+73guFn46JQXLPtEWUMogLexUr9om IbyedQzbCC8m8BupEP+hFX2lfQlVYXVwz9iRNULYQF4HarIJhjm3WystAKVIwIEMtYqZHD6FCSSBf /0oVQcqnzxFnRcTQzLFqeTcHipj+udKlxtmKgTWtYZWY5uCvh7O50TnP03ZGGKsldcw0TyhCvBAh0 JTwAzLwRyl2I68cwmX71awwyhoG77AeLRtTy9MeKm2/3Bcwo6I3CHgbJGzy62UFnTvaynoo4/dH3w LnZ466vBwwKs4Rb6i/6ZiQ==; Original-Received: from [87.69.77.57] (port=4795 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlvQI-0006Eb-Lm; Tue, 03 May 2022 12:30:52 -0400 In-Reply-To: <86wnf5f8of.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 01 May 2022 20:25:52 +0300) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:231337 Archived-At: > From: Juri Linkov > Cc: eric@swenson.org, larsi@gnus.org, 55070@debbugs.gnu.org > Date: Sun, 01 May 2022 20:25:52 +0300 > > > Please try the patch below. Its main idea is that calling > > frameset-move-onscreen makes no sense on a text-mode display, so I > > made desktop.el force frameset.el avoid calling that function in this > > case. The rest is basically a simple cleanup. > > The patch works without problems (I didn't notice > the argument :force-onscreen before). > > > In addition to testing the use case of both saving and restoring the > > desktop in a -nw session, I'd appreciate testing when the desktop was > > saved in a GUI session and is restored in a TTY session, and vice > > versa. > > Saving the desktop in a GUI session and restoring in a TTY session > adds an empty line between the top buffer and the tab bar when > tab-bar-mode was enabled before saving. This is a subtle bug in how we compute the tab-bar-lines frame parameter. Observe: emacs -Q M-x tab-bar-mode RET M-: (frame-parameter nil 'tab-bar-lines) => 2 Surprise! The problem is that the tab-bar line is slightly higher than the canonical line height of the frame, so when we compute the height in lines, we get 1 more. I think this means we cannot save and restore tab-bar-mode by relying on the tab-bar-lines frame parameter; the solution should be in a special support for desktop.el in tab-bar.el. For example, remove the tab-bar-line frame parameter when saving the desktop, and instead save the tab-bar-mode state; then restoring the desktop would turn on tab-bar-mode in the restored session, and recreate the tab bar of the desired height. I hope you can develop such a solution, so that tab bars could be meaningfully restored on TTY frames. Btw, what about tab-bar-show -- should it be saved as well? at least if its value is not the default? > Saving the desktop in a TTY session and restoring in a GUI session > restores only the first frame, but the message says 2 frames were restored. It did restore 2 frames (try evaluating '(frame-list)' and you will see). It's just that all the frames but the first one are invisible, because the frames restored from TTY-originated desktop have no 'visibility' parameter, so when they are restored on GUI display, that is interpreted as invisible frames. I think I fixed that now. > > Likewise for when the session in which the desktop is restored > > is a daemon session -- the main concern there is that a daemon session > > shouldn't restore frames at all. > > I don't use a daemon session, maybe someone could help to test it. OK, maybe Eric or someone else will. Anyway, I installed the changes on the master branch. I think we should leave this bug open until the tab-bar issue (and any other issues that might be left) are resolved. Thanks.