From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Swenson Newsgroups: gmane.emacs.bugs Subject: bug#55070: 28.1; desktop-load doesn't work in -nw (non-gui) emacs Date: Thu, 28 Apr 2022 09:18:59 -0700 Message-ID: <5DA5751F-DC2F-4C40-AE30-DAF65BCF0572@swenson.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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40009"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Microsoft-MacOutlook/16.60.22041000 Cc: 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 Thu Apr 28 18:20:30 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 1nk6sX-000ABi-Ct for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 18:20:30 +0200 Original-Received: from localhost ([::1]:51324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk6sV-0001g5-Oe for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 12:20:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk6s7-0001ej-3r for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 12:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nk6s6-0008By-RD for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 12:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nk6s6-0008TZ-I7 for bug-gnu-emacs@gnu.org; Thu, 28 Apr 2022 12:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Swenson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Apr 2022 16:20: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.165116274932510 (code B ref 55070); Thu, 28 Apr 2022 16:20:02 +0000 Original-Received: (at 55070) by debbugs.gnu.org; 28 Apr 2022 16:19:09 +0000 Original-Received: from localhost ([127.0.0.1]:49754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk6rF-0008SI-BW for submit@debbugs.gnu.org; Thu, 28 Apr 2022 12:19:09 -0400 Original-Received: from mail-pf1-f174.google.com ([209.85.210.174]:38833) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nk6rD-0008Ru-Gu for 55070@debbugs.gnu.org; Thu, 28 Apr 2022 12:19:07 -0400 Original-Received: by mail-pf1-f174.google.com with SMTP id g8so2257900pfh.5 for <55070@debbugs.gnu.org>; Thu, 28 Apr 2022 09:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=swenson.org; s=google; h=user-agent:date:subject:from:to:cc:message-id:thread-topic :references:in-reply-to:mime-version:content-transfer-encoding; bh=NGWcemsqzqKu7mXKLr038tp8AP2f+nqJBfUxlxb4Tw4=; b=e8r6Fjb058Gf7qJYGrDU/cZUfkJhrtKDl76isVGGK89+vLrKfSyKuTt9mmmjVmVIxu dgtLGtkSd3ct6RP7mhrYlp3AEslXHKMcy0ppYYSqGRKlD+a1pgKe7wd1l6FztKalnoX/ jeKVOqMIo0rZ6BrTuTpOzXLPFnhka6b8tRgmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:user-agent:date:subject:from:to:cc:message-id :thread-topic:references:in-reply-to:mime-version :content-transfer-encoding; bh=NGWcemsqzqKu7mXKLr038tp8AP2f+nqJBfUxlxb4Tw4=; b=q/S8CMNIPkRRbagkeyzM+rQrpBon03Ahh+eziCzeUBXr4MSlkCqOYI/KYiUmzDSsR6 TfZhnr3lfcsvBuE8Cz1BnhtuXYIMUAW+woAO/CVFVByQCOJv2HiR4uu62TQdRLuRLGgc 435EIhJpMuiPIst3tJIGIOnDnXN/JcSzb+c+yEul/eteiNb/qUE1pbp+GA6xS4XEwwkC vtwbFkwEjKKgQucYD5Ls+gqcZ5w+TkifdszeYuztLWZcv4rPKK53GifHHuosy5/5m9Dk hT+AoCdYfBaHbB+ozk+gu4D+H0ZCMH5EV40QEPhQzZKGiQPc9ms5T5JVz8wkvT2WVSAd ge1Q== X-Gm-Message-State: AOAM5322SRho1xKW7LZ11vmuSgp1wh8HXbQrMunkHdCU36/OTyvbR8En yvY2+zLfR4T5HfYbINFdbfyokQ== X-Google-Smtp-Source: ABdhPJz/fJ00qRtS17ZevvdOOsjdoaXush/fQNSn9VKg3esydy05U8SGIuc2lmJaX6kAYE+Bn5kWKg== X-Received: by 2002:a63:df18:0:b0:3ab:938b:e6c5 with SMTP id u24-20020a63df18000000b003ab938be6c5mr11234261pgg.165.1651162740658; Thu, 28 Apr 2022 09:19:00 -0700 (PDT) Original-Received: from [192.168.0.111] (c-73-189-24-121.hsd1.ca.comcast.net. [73.189.24.121]) by smtp.gmail.com with ESMTPSA id 16-20020a621410000000b0050aca5f79f5sm307509pfu.97.2022.04.28.09.18.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Apr 2022 09:19:00 -0700 (PDT) Thread-Topic: bug#55070: 28.1; desktop-load doesn't work in -nw (non-gui) emacs In-Reply-To: <861qxhy9cz.fsf@mail.linkov.net> 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:230894 Archived-At: The patch worked great for me. I can restore saved sessions in both GUI an= d -nw mode. Thanks much. -- Eric =EF=BB=BFOn 4/28/22, 12:09 AM, "Juri Linkov" wrote: > Did you provide another patch, Juri? > Or is it the same one you provided yesterday in this thread? It's the same patch. Please try it. Here it's again: diff --git a/lisp/desktop.el b/lisp/desktop.el index f41a41c3c3..15cd0bae89 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -412,7 +412,10 @@ desktop-restore-frames "When non-nil, save and restore the frame and window configuration. See related options `desktop-restore-reuses-frames', `desktop-restore-in-current-display', and `desktop-restore-forces-onsc= reen'." - :type 'boolean + :type '(choice (const :tag "Don't restore frames" nil) + (const :tag "Restore frames" t) + (const :tag "Restore only graphical frames" x) + (const :tag "Restore only -nw frames" tty)) :group 'desktop :version "24.4") @@ -1251,7 +1254,13 @@ desktop-lazy-timer ;; -------------------------------------------------------------------= --------- (defun desktop-restoring-frameset-p () "True if calling `desktop-restore-frameset' will actually restore it= ." - (and desktop-restore-frames desktop-saved-frameset (display-graphic-= p) t)) + (and (pcase desktop-restore-frames + ('x (display-graphic-p)) + ('tty (not (display-graphic-p))) + ('nil nil) + (_ t)) + desktop-saved-frameset + t)) (defun desktop-restore-frameset () "Restore the state of a set of frames. diff --git a/lisp/frameset.el b/lisp/frameset.el index 05884eed3a..32966376d8 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -883,8 +883,8 @@ frameset-move-onscreen (pcase-let* ((`(,left ,top ,width ,height) (cdadr (frame-monitor-att= ributes frame))) (right (+ left width -1)) (bottom (+ top height -1)) - (fr-left (frameset-compute-pos (frame-parameter frame 'left) l= eft right)) - (fr-top (frameset-compute-pos (frame-parameter frame 'top) top= bottom)) + (fr-left (frameset-compute-pos (or (frame-parameter frame 'lef= t) 0) left right)) + (fr-top (frameset-compute-pos (or (frame-parameter frame 'top)= 0) top bottom)) (ch-width (frame-char-width frame)) (ch-height (frame-char-height frame)) (fr-width (max (frame-pixel-width frame) (* ch-width (frame-wi= dth frame))))