all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jay Kamat <jaygkamat@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: desktop.el and frame parameters when -nw
Date: Wed, 25 Jul 2018 20:02:57 -0700	[thread overview]
Message-ID: <878t5yy9zy.fsf@gmail.com> (raw)
In-Reply-To: <838t5zv13w.fsf@gnu.org>


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	other threads:[~2018-07-26  3:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25  2:03 desktop.el and frame parameters when -nw Jay Kamat
2018-07-25 14:30 ` Eli Zaretskii
2018-07-26  3:02   ` Jay Kamat [this message]
2018-07-27  9:11     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2018-07-25  6:33 martin rudalics
2018-07-25 14:29 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878t5yy9zy.fsf@gmail.com \
    --to=jaygkamat@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.