GNU bug report logs - #55070
28.1; desktop-load doesn't work in -nw (non-gui) emacs

Previous Next

Package: emacs;

Reported by: Eric Swenson <eric <at> swenson.org>

Date: Sat, 23 Apr 2022 00:00:02 UTC

Severity: normal

Tags: moreinfo, patch

Found in version 28.1

Fixed in version 29.0.50

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

Bug is archived. No further changes may be made.

Full log


Message #63 received at 55070 <at> debbugs.gnu.org (full text, mbox):

From: Eric Swenson <eric <at> swenson.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 55070 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, larsi <at> gnus.org
Subject: Re: bug#55070: 28.1; desktop-load doesn't work in -nw (non-gui) emacs
Date: Thu, 28 Apr 2022 09:18:59 -0700
The patch worked great for me.  I can restore saved sessions in both GUI and -nw mode.  Thanks much. -- Eric

On 4/28/22, 12:09 AM, "Juri Linkov" <juri <at> linkov.net> 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-onscreen'."
    -  :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-attributes frame)))
     	       (right (+ left width -1))
     	       (bottom (+ top height -1))
    -	       (fr-left (frameset-compute-pos (frame-parameter frame 'left) left right))
    -	       (fr-top (frameset-compute-pos (frame-parameter frame 'top) top bottom))
    +	       (fr-left (frameset-compute-pos (or (frame-parameter frame 'left) 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-width frame))))






This bug report was last modified 3 years and 19 days ago.

Previous Next


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