unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* desktop-restore-frames
@ 2013-07-15  0:08 Juanma Barranquero
  2013-07-28 11:34 ` desktop-restore-frames Juanma Barranquero
  0 siblings, 1 reply; 14+ messages in thread
From: Juanma Barranquero @ 2013-07-15  0:08 UTC (permalink / raw)
  To: Emacs developers

OK, I've just committed a change to desktop.el which enables
desktop-restore-frames by default.

At this point, the code is working well enough in my setup, which alas
is wholly Windows-specific. So it's time to let the little bird fly
and start receiving suggestions, feedback, bug reports and possibly
blunt force trauma.

* ADDED:

- Option restore-in-current-display now offers three possibilities: t,
which forces frames to the current display; nil, which allows each
frame to go to their display, and delete, which restores frames in the
current display and deletes others.

- New option desktop-restoring-reuses frames, with three possible
values: reuse existing frames (if possible, else delete them), delete
existing frames (and create new ones for saved frames), and keep the
existing ones (and restore saved frames in new ones).  A problem with
`keep' is that is more useful for M-x desktop-read than for the
initial read, because it does keep the initial frame, which is likely
not what the user wants. Workarounds include adding code in your
.emacs to delete that frame:

(setq *initial* (selected-frame))
(add-hook 'desktop-after-read-hook
          (lambda ()
            (when *initial*
              (ignore-errors (delete-frame *initial*))
              (setq *initial* nil))))

or adding a new option, if necessary.

- Support for minibuffer-only and minibufferless frames. In many
normal setups, saving & restoring these kind of frames should work as
expected.  I haven't added an option to skip restoring minibuffer-only
frames, as Drew suggested. Let's try this first and I can add it
afterwards if required.

- Workaround for bug/feature/infelicity#14795. Now frames should be
restored with the right height, regardless of their tool-bar-mode
setting.

- Vastly improved parameter filtering. It now allows setting filtering
functions to precisely determine when and how parameters are passed
untouched, removed or modified. As a corollary, fullscreen,
size/position and font parameters survive the tty roundtrip intact.


* NOT ADDED / FOR DISCUSSION:

- I have not made any attempt to detect off-screen frames and move
them back on-screen. As there are legitimate uses of off-screen
frames, we should discuss what is the expected UI before throwing code
at it.
- Currently, desktop-restore-frames is enabled by customize. In some
cases, it seems it would be useful to be able to easily enable/disable
it, either as an argument to desktop-save-mode or as a new
pseudo-minor-mode.
- M-x desktop-clear "cleans up" the desktop by removing buffers, etc.
Should that command also (directly or via an argument) remove windows
and/or frames? IMO both possibilities seem reasonable.
- All names are up for discussion, of course. I'm really bad at naming
functions and options. Also, suggestions to make docstrings clearer
are very welcome.
- Other than desktop-filter-parameters-alist, I have not added any
low-level hook to allow tinkerers to piggyback into the save&restore
mechanics. I suppose the existing hooks and advice-add should suffice,
but if someone has anything specific in mind that would require other
entry points, I'm all ears.
- Some of this stuff, once polished, should be documented in the elisp
or emacs manual. Not by me, though, sorry.


* THINGS KNOWN NOT TO WORK:

- Minibuffer(less|-only) frames do not survive the roundtrip to tty
and back. It could be made to work, but it is a bit complex and I'm
not sure how useful / necessary it really is.
- On Windows, invisible frames turn visible the second time they are
restored, as an interesting consequence of bug#14841.


* BADLY NEEDED TESTING:

- Non-Windows environments.
- Anything "multi": multiple displays, multiple monitors, complex
multi-frame setups, multiple terminals, etc.
- daemon mode.
- GUI and tty frames in the same session.

I think that's all.

Enjoy,

    Juanma



^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: desktop-restore-frames
@ 2013-07-28 22:21 Angelo Graziosi
  2013-07-28 22:37 ` desktop-restore-frames Juanma Barranquero
  0 siblings, 1 reply; 14+ messages in thread
From: Angelo Graziosi @ 2013-07-28 22:21 UTC (permalink / raw)
  To: emacs

Juanma Barranquero wrote:
> Still needing testing. I refuse to believe that lack of bug reports
> means everything's working flawlessly.

I am still here... :-)

For desktop, I use only "(desktop-save-mode t)"  in the init file, and 
the restoration seems good. Usually I use one frame with 3 windows (and 
many buffers) and don't notice big issues if not those regarding the 
maximize/fullscreen problems described here:

   http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00142.html

This seems to affect only the GTK build on Cygwin...

I can add only this: once the maximizing button has been selected, in 
the subsequent sessions, the frame is restored almost maximized but with 
the maximizing button unselected so that one can no longer reset the 
frame dimensions to the default values (a frame that looks like a square).

Other than that, it looks like you did a good work. Thanks!


Ciao,
  Angelo.




^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-08-14 11:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-15  0:08 desktop-restore-frames Juanma Barranquero
2013-07-28 11:34 ` desktop-restore-frames Juanma Barranquero
2013-07-29  7:54   ` desktop-restore-frames martin rudalics
2013-07-29  9:20     ` desktop-restore-frames Juanma Barranquero
2013-07-29 12:11       ` desktop-restore-frames martin rudalics
2013-07-29 11:47   ` desktop-restore-frames chad
2013-07-29 11:50     ` desktop-restore-frames Juanma Barranquero
2013-07-29 11:58       ` desktop-restore-frames joakim
2013-07-29 12:05         ` desktop-restore-frames Juanma Barranquero
  -- strict thread matches above, loose matches on Subject: below --
2013-07-28 22:21 desktop-restore-frames Angelo Graziosi
2013-07-28 22:37 ` desktop-restore-frames Juanma Barranquero
2013-08-14  8:45   ` desktop-restore-frames Angelo Graziosi
2013-08-14 10:19     ` desktop-restore-frames Angelo Graziosi
2013-08-14 11:32       ` desktop-restore-frames Juanma Barranquero

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).