help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: desktop.el and frame parameters when -nw


From: Jay Kamat
Subject: Re: desktop.el and frame parameters when -nw
Date: Wed, 25 Jul 2018 20:02:57 -0700
User-agent: mu4e 0.9.18; emacs 26.1.50

Hi Eli, Martin,

Eli Zaretskii writes:

> Why do you need such frame parameters restored when you start Emacs
> with -nw?  IOW, what is your real-life use case, and why cannot you
> start Emacs without -nw, and then create a TTY frame in that session?

I use a package called 'eyebrowse' which stores information about workspaces
in the frame parameters. Because this data is not saved and restored, my
eyebrowse workspaces get lost in tty frames after an Emacs quit. I'm trying to
run Emacs on a remote server with no graphical interface at all, so I don't
think I'll be able to run the gui version and open a frame (without installing
all of X).

I'm not sure why eyebrowse stores it's information in the frame parameters...

> I suppose this is due to desktop.el's
>
> (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))
>
> Try removing the (display-graphic-p). But I'm quite confident that this will
> get you into lots of other troubles.

Thanks for the pointer! I was able to come up with this:

(unless (display-graphic-p)
  (setq desktop-restore-forces-onscreen nil)
  (defun desktop-restoring-frameset-p ()
    "True if calling `desktop-restore-frameset' will actually restore it.

Removes graphical from the list of required parameters."
    (and desktop-restore-frames desktop-saved-frameset t)))

I'm not sure why I needed to set `desktop-restore-forces-onscreen' to nil, but
I was getting errors without it. With this though, I'm getting the expected
behavior. I'll remember to disable this if I run into any odd issues or
breakages though. Hopefully the gui frame parameters that I shouldn't be
restoring isn't a problem since the desktop sessions I'm loading from are
terminal-only (for now at least).

-Jay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]