unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Michael Sperber <sperber@deinprogramm.de>
Cc: mike@xemacs.org, emacs-devel@gnu.org
Subject: Re: read syntax for window configs
Date: Fri, 19 Mar 2010 14:07:32 +0100	[thread overview]
Message-ID: <4BA37714.4030207@gmx.at> (raw)
In-Reply-To: <y9l634stvnd.fsf@deinprogramm.de>

 >> Thank you for posting this.  It won't work out of the box for Emacs
 >> because Emacs lacks `make-window-configuration' and `make-saved-window'.
 >> Can you post their definitions here or tell us a page on the net where
 >> we can look at them?
 >
 > http://hg.debian.org/hg/xemacs/xemacs/file/45753d9a0dc4/lisp/window-xemacs.el

Sorry but this has only a call to `make-window-configuration' in
`current-window-configuration'.  I've been looking into window.c but
didn't find it there either :-( I suppose it simply builds a vector from
its arguments.

 >> Do they check a configuration for integrity (e.g., whether the
 >> combined window sizes match those of their parents, that of the root
 >> window the size of the frame, ...) before mapping the frame?
 >
 > Yes: Since all restoration happens from Lisp, there's no way to get
 > anything inconsistent.

Well, if something happens in Elisp there's always a chance that things
get messed up on the fly.  I'd very much prefer to do the elementary
checks (those that prevent Emacs from crashing or showing distorted
frames) only in C.

 >> Can you restore on machine A a configuration saved on machine B when A
 >> and B have different toolkits?
 >
 > I don't see why not.  You're not always going to get an
 > identical-looking configurations because the original frame will be
 > gone, but as close an approximation as the code knows how to recreate.

OK.  So I presume your code handles the case where window sizes don't
fit because, for example, toolbars or scrollbars have different widths.

 >> Also, am I right that the `next-child' field denotes the right sibling
 >> of the window?
 >
 > If I recall correctly, it depends on whether windows are going right or
 > down.  It's just whatever `window-next-child' returns on XEmacs.

I've checked that.  It _is_ the right sibling and it doesn't depend on
whether windows go right or down (obviously, when windows go down the
right sibling denotes the window below).

 >> And, how do you translate back from pixel values (like `pixel-left'
 >> ... ) to normal line/column values?  Do you?
 >
 > No, we don't.

That's good (but momentarily not suitable for Emacs).  You apparently do
all these calculations via window_pixel_height_to_char_height /
window_char_height_to_pixel_height and friends.  And it will allow to
fix any of the scroll- or toolbar problems I mentioned above by giving
the remaining pixels to one of the involved windows.

Emacs should eventually do something similar ;-)

 > I don't know anything about ECB, so I don't really know.  However, I
 > would think that it needs to remember the name of the buffer to find the
 > window, or remember the window's place in the layout.  (That's a general
 > issue with window configurations, but it becomes very clear here -
 > there's no way to preserve window identity across sessions.)

Funnily, nothing would prevent us from keeping window identities across
sessions.  If and only if a saved configuration is restored _before_ the
first user interaction.  Well we could check whether a window with such
an identity exists already but I wouldn't like that ...

Thanks again, martin




  reply	other threads:[~2010-03-19 13:07 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 18:53 Fwd: CEDET sync Lluís
2010-03-01 18:59 ` Chong Yidong
2010-03-01 19:36   ` Lennart Borgman
2010-03-01 21:27   ` Stefan Monnier
2010-03-01 22:07     ` Fabian Ezequiel Gallina
2010-03-01 22:42     ` Eric M. Ludlam
2010-03-02  7:58       ` AW: " Berndl, Klaus
2010-03-02  8:51         ` Stephen J. Turnbull
2010-03-02  9:35           ` David Kastrup
2010-03-02  9:43             ` Lennart Borgman
2010-03-02 10:36               ` AW: " Berndl, Klaus
2010-03-02 10:43                 ` Lennart Borgman
2010-03-02 11:08                   ` AW: " Berndl, Klaus
2010-03-02 21:03                     ` Juri Linkov
2010-03-03  3:20                       ` Stephen J. Turnbull
2010-03-05 13:45                         ` Michael Sperber
2010-03-05 17:07                           ` read syntax for window configs (was: CEDET sync) Drew Adams
2010-03-05 17:48                             ` Lennart Borgman
2010-03-06 17:44                               ` read syntax for window configs Juri Linkov
2010-03-06 17:48                             ` Juri Linkov
2010-03-06 19:32                               ` Drew Adams
2010-03-18 16:07                             ` Michael Sperber
2010-03-18 16:41                               ` Drew Adams
2010-03-19 10:48                               ` martin rudalics
2010-03-19 11:09                                 ` Michael Sperber
2010-03-19 13:07                                   ` martin rudalics [this message]
2010-03-19 15:31                                     ` Michael Sperber
2010-03-02 11:13                   ` AW: Fwd: CEDET sync Richard Riley
2010-03-02 11:42                     ` David Kastrup
2010-03-02 15:23             ` Stephen J. Turnbull
2010-03-02 16:06               ` David Kastrup
2010-03-02 17:20                 ` Stephen J. Turnbull
2010-03-02 17:58                   ` David Kastrup
2010-03-03  3:51                     ` Stephen J. Turnbull
2010-03-02 18:40                   ` OT: threats to Free Software (was: AW: Fwd: CEDET sync) Stefan Monnier
2010-03-02 19:33                     ` Lennart Borgman
2010-03-02 22:07                     ` David Reitter
2010-03-03 22:48                       ` Richard Stallman
2010-03-03  4:00                     ` Stephen J. Turnbull
2010-03-03 22:48                       ` Richard Stallman
2010-03-03 10:37                     ` Richard Stallman
2010-03-03 10:37                   ` AW: Fwd: CEDET sync Richard Stallman
2010-03-03 18:37                     ` Stephen J. Turnbull
2010-03-03 19:00                       ` Chong Yidong
2010-03-05 20:05                       ` Richard Stallman
2010-03-06  4:29                         ` Stephen J. Turnbull
2010-03-06  7:45                           ` David Kastrup
2010-03-03  7:07               ` joakim
2010-03-02 15:25         ` Stefan Monnier
2010-03-02 15:59           ` AW: " Berndl, Klaus
2010-03-02 16:08             ` Chong Yidong
2010-03-02 16:44               ` Stephen J. Turnbull
2010-03-02 20:28                 ` Chong Yidong
2010-03-03  4:06                   ` Stephen J. Turnbull
2010-03-03  4:47                     ` Miles Bader
2010-03-03  7:21                       ` Stephen J. Turnbull
2010-03-03 15:45                         ` Chong Yidong
2010-03-03  7:41                     ` David Kastrup
2010-03-03  8:51                       ` Stephen J. Turnbull
2010-03-03  9:10                       ` tomas
2010-03-03 10:02                         ` David Kastrup
2010-03-03 16:51                           ` Stephen J. Turnbull
2010-03-02 18:45             ` Stefan Monnier
2010-03-03 10:38           ` Richard Stallman

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=4BA37714.4030207@gmx.at \
    --to=rudalics@gmx.at \
    --cc=emacs-devel@gnu.org \
    --cc=mike@xemacs.org \
    --cc=sperber@deinprogramm.de \
    /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).