all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: desktop-restore-frames
Date: Mon, 29 Jul 2013 09:54:19 +0200	[thread overview]
Message-ID: <51F61FAB.1000401@gmx.at> (raw)
In-Reply-To: <CAAeL0STThO68MagsYMu2bqYx7Ca0WjgjePbAvT_fQBQo11PTpQ@mail.gmail.com>

 >> - 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.
 >
 > I think the answer is yes, `desktop-clear' should delete frames too.
 > The biggest issue to implement this is deciding about exclusions. For
 > buffers there's `desktop-clear-preserve-buffers', which selects based
 > on the buffer name; a sensible choice. But what is a good way to
 > differentiate between frames?

I'd kill all frames but one.  `desktop-clear' means to start from a
pristine state and one minibuffer-equipped frame showing *scratch* is
the best approximation we have.

 > Personally, I like doing this with frame
 > parameters (over filter functions) for a few reasons:
[...]
 > Is anyone opposed to doing things that way?

I agree with you.

 > - Making sure that the selected frame at saving time is still selected
 > at restore time (assuming the frame was saved, of course).

I suppose we want to make sure the window selected when saving should be
selected after restoring (unless it's a minibuffer window).

 > - On insight, I think I could have done all this in a new
 > desktop-frames.el package, loaded by default from desktop.el. The
 > advantage is that the current code works or could be easily made to
 > work on Emacs 24.{1,2,3}, which has window-state-(get|put), so it
 > could be added to ELPA as a back-compatible package.

IIUC we'd have to fix a couple of errors in the Emacs sources to make it
work so I would advise against trying to make it backward compatible.

 > - With really little effort, it is possible to create a mini-package
 > to save & restore a stack or queue of frame configurations
 > dynamically, so you could do
 >
 >   M-x save-frame-state   ; pushes state
 >   M-x restore-frame-state   ; pops state
 >   C-{N} M-x restore-frame-state  ; restores state {N}, does not pop
 >   M-x next-frame-state
 >
 > etc. so you could, on one session, push, pop and cycle between frame
 > states (it could even be made persistent). This does not offer too
 > much of an advantage over the current frame-configuration-to-register
 > stuff, but offers more flexibility: for example, with a bit of coding
 > there could be commands to bring all frames in all displays to the
 > current display, or to delete all frames in other displays.

It has the advantage that we can save "something like" registered frame
configurations to disk and read them back.

martin



  reply	other threads:[~2013-07-29  7:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` martin rudalics [this message]
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

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=51F61FAB.1000401@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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.