unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: 14964@debbugs.gnu.org
Subject: bug#14964: 24.3.50; doc of `compare-window-configurations'
Date: Sun, 28 Jul 2013 18:57:48 +0200	[thread overview]
Message-ID: <CAAeL0SR81YkdMMAA7Sz7CZyEVJXU21RdtKgJRynzt5y1nxpmzw@mail.gmail.com> (raw)
In-Reply-To: <25701584-34ff-4754-8d10-7f2d223205ac@default>

On Sun, Jul 28, 2013 at 4:49 PM, Drew Adams <drew.adams@oracle.com> wrote:

> Yes, I am hoping exactly that.  His work with desktop.el will apparently use
> Lisp-readable representations of sets of frames.  I hope this will be
> applied/extended to the frame-configuration functions, so we can optionally
> get Lisp-readable frame configurations (with the same properties and
> interfaces as we have now).

I think frame configurations are a bit underdocumented. Also, I'm not
sure what do they record and how that differs of what I've had to
implement for desktop.el (other than the fact that with frame
configurations you cannot restore a deleted frame, and you can with
desktop frame-states).

In particular, according to current-frame-configuration's docstring:

  Its car is `frame-configuration'.
  Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
  where
    FRAME is a frame object,
    ALIST is an association list specifying some of FRAME's parameters, and
    WINDOW-CONFIG is a window configuration object for FRAME."

- FRAME, as a frame object, can not be serialized to disk. Serializing
it means serializing its contents and attributes, as I try to do in
desktop.el.
- ALIST specifies "some of FRAME's parameters", but it doesn't say
which ones, or the criteria used to select them, or why these
parameters are important and not others.
- WINDOW-CONFIG is also not serializable, but Martin's
window-state-(get|put) does something similar.

So, what do you expect of "Lisp-readable frame configurations"? A Lisp
readable frame configuration is not very different of a desktop
frame-state, and any function that serializes it will necessarily do
something similar to desktop-save-frames (details of output format can
vary, of course). Which differences are you're interested in? (Other
than the currrent API of desktop-save-frames being currently not very
reuse-friendly, I mean.)

IIUC, what you would do is, either add parameters to the current
frame-configuration functions to obtain a serializable config, or add
a serialize-frame-config function. Isn't that more or less what I've
been doing? If there is information that frame-configuration saves and
desktop-save-frames does not, and is information that can be
meaningfully restored in another Emacs session, we can discuss adding
it.

> E.g., a frame config would continue to look like this, even when
> Lisp-readable:
>
> (frame-configuration FRAME+WINDOW-CONFIG...)
>
> where FRAME+WINDOW-CONFIG would be a Lisp-readable representation of a frame
> (a set of frame parameters, preferably at least the same ones recorded now)
> plus the frame's window configuration.

I see your little trick here ;-) A frame configuration is not the
configuration of a frame, but of all existing frames. So a serialized
frame configuration would be

(frame-configuration (FRAME+WINDOW-CONFIG)...)

and that's just syntactic sugar over what a desktop frame-state
currently is: ((FRAME-PARAMS . WINDOW-STATE)...)

> Let me know if you (e.g. Juanma) prefer that I file this as a separate
> bug (enhancement request).  If so, I will, repeating what I've said here.

No, I just want to understand what is being requested. In other words,
the API that does not exist currently and you'd like to see.

> a. these structures documented, i.e., the structure advertised as such, or
> b. access functions defined for their parts.

I'd like to see that, too.

> IOW, either an open, advertised structure or a black box but providing
> advertised ways to get at the various components.

As previously discussed, in private and in my last emacs-devel
message, I'm open to that but I don't think that providing an API to
serialize individual frames makes much sense. But ways to make
desktop-save-frames more open and accesible? Definitely I'm in.

    J





  reply	other threads:[~2013-07-28 16:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27  3:14 bug#14964: 24.3.50; doc of `compare-window-configurations' Drew Adams
2013-07-27  8:18 ` martin rudalics
2013-07-27 19:39   ` Drew Adams
2013-07-28  8:40     ` martin rudalics
2013-07-28 14:49       ` Drew Adams
2013-07-28 16:57         ` Juanma Barranquero [this message]
2013-07-28 18:56           ` Drew Adams
2013-07-29  2:14             ` Juanma Barranquero
2013-07-29 23:56               ` Drew Adams
2013-07-30  1:05                 ` Juanma Barranquero
2013-07-30  9:13                 ` martin rudalics
2013-07-29  7:55             ` martin rudalics
2013-07-29 23:53               ` Drew Adams
2013-07-30  0:18                 ` Juanma Barranquero
2013-07-30  9:13                 ` martin rudalics
2013-07-30 14:17                   ` Stefan Monnier
2013-07-28 19:53           ` Josh
2013-07-28 20:33             ` Drew Adams
2013-07-29  7:54         ` martin rudalics
2022-04-21 13:42   ` Lars Ingebrigtsen
2022-05-20  2:23     ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAAeL0SR81YkdMMAA7Sz7CZyEVJXU21RdtKgJRynzt5y1nxpmzw@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=14964@debbugs.gnu.org \
    --cc=drew.adams@oracle.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 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).