unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* window groups
@ 2008-05-28 12:22 martin rudalics
  2008-05-29  1:39 ` Richard M Stallman
                   ` (2 more replies)
  0 siblings, 3 replies; 46+ messages in thread
From: martin rudalics @ 2008-05-28 12:22 UTC (permalink / raw)
  To: emacs-devel

Here is my proposal:

(1) A window group is a collection of windows displayed within the root
     window of a frame.  For any window group there exists one designated
     window - the root window of that group.  A group root window is
     either the frame's root window or is a window whose parent window
     does not belong to any group (hence groups don't nest).  Every other
     window of a group is a subwindow of the group root window.  Internal
     windows of a group have at least two children (so a group contains
     at least two leaf windows).

(2) Window groups can be created by `split-window' which gets three
     additional parameters:

     Optional argument SAFE non-nil means ignore actual settings for
     `window-min-height' and `window-min-weight' but use safe defaults
     for minimum sizes instead.

     Optional argument INVERT non-nil means create the new window above
     or left of WINDOW, leave SIZE lines or columns in the original
     window, and return the newly created window.  The lower or rightmost
     window is the original window and remains selected if it was
     selected before.

     Optional argument GROUP non-nil means if the original window does
     not belong to a window group yet, create a new window group with the
     original and the new window as its only members.  If GROUP is
     non-nil and the original window already belongs to a group, the new
     window is obtained by splitting the original window and becomes a
     member of the original window's group.

     If GROUP is nil and the original window belongs to a group, the new
     window is obtained by splitting the root window of that group.  In
     this case the new window does not become a member of the original
     window's group.  The original window remains selected if it was
     selected before.  When INVERT is nil the new window is created below
     or to the right of the root window.  INVERT non-nil means the new
     window is created above or to the left of the root window.

     If GROUP is nil and the original window does not belong to a group,
     split the original window as usual.

     As a special case, GROUP `root' means assume the root window of the
     current frame forms a window group and proceed as with GROUP set to
     nil.  Thus with HORIZONTAL and INVERT non-nil and GROUP `root' the
     new window is created above all other windows of WINDOW's frame, the
     group status of the new window is set to nil, and the group status
     of all other windows remains unchanged.

(3) A group automatically ceases to exist when the number of its leaf
     windows becomes less than two.  The function `dissolve-window-group'
     dissolves the group an arbitrary window belongs to.

(4) All windows of a group share the same group number.  Windows
     belonging to different groups have different group numbers (unless
     you create more groups than an integer can hold).  For any window
     the function `window-group' returns the number of the group the
     window belongs to or nil if the window does not belong to any group.

(5) The function `clone-window-configuration' puts a window group or the
     root window of a frame into an arbitrary target frame's root window,
     window group, or window.  `clone-window-configuration' takes three
     arguments - CONFIGURATION, OLD and NEW.  CONFIGURATION must be a
     value previously returned by `current-window-configuration'.
     Optional argument OLD nil or omitted means clone the root window of
     that configuration.  If OLD is a window group (a value previously
     returned by `window-group') only windows belonging to that group are
     cloned.  An error is signalled if that group is empty.  Optional
     argument NEW nil or omitted means display the clone in the selected
     frame's root window.  NEW non-nil means display the clone in the
     selected window, or, if that window is part of a window group, in
     the root window of that group.

     Note that cloning does not reuse any windows or groups.  Rather, all
     windows and groups are created anew.

(6) The function `frame-root-window-tree' returns a list structure
     representing the layout of the root window of a frame including the
     group status of all subwindows and the buffer names of leaf windows.
     The function `clone-frame-root-window-tree' restores that layout
     from such a list structure in the root window of an arbitrary frame.

Conceptually, (2) should be sufficient to satisfy the requirements of
most IDE layouts like those of ECB or Eclipse "perspectives".

- IDEs would typically specify one window group ("edit-area" in ECB,
   "editor" in Eclipse) for each frame.  Splitting any window of that
   group would be done by setting the GROUP argument for `split-window'
   to t.  Other applications would not interfere with the layout of that
   group since, by default, their GROUP argument would not be t.

- IDE windows around that group (Eclipse "views") would be created as
   follows: For the first such window either (i) call `split-window' with
   GROUP set to `root' to obtain a full-height|width view, or (ii) call
   `split-window' with GROUP set to nil to obtain a window just as
   high|wide as the window group.  Further windows would be created by
   splitting an existing window with GROUP set to nil (or t for the more
   complex layout-outlines of ECB ).

   Approach (i) appears best for displaying views on the left or right of
   the edit area (file or tag views like the speedbar).  Approach (ii)
   might be given preference for displaying windows above or below the
   edit area (compile, shell, or grep views).

`current-window-configuration', `set-window-configuration', and
`save-window-excursion' retain their traditional semantics modulo saving
and restoring any window groups present in the configuration.

Cloning window configuration (5) is useful to restore a layout earlier
used in the same Emacs session or to switch between a layout where only
the edit area is seen and a layout displaying all sorts of views around
it.

Cloning the root window of a frame (6) is needed only to store a layout
in a desktop (or IDE specific) file to restore that root window in
another Emacs session.  Ideally, an IDE would come with preconfigured
layouts created via `frame-root-window-tree'.





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

end of thread, other threads:[~2008-08-18 15:37 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-28 12:22 window groups martin rudalics
2008-05-29  1:39 ` Richard M Stallman
2008-05-29  9:26   ` martin rudalics
2008-05-29 16:30     ` Stefan Monnier
2008-05-30  7:05       ` martin rudalics
2008-05-30 13:58         ` Stefan Monnier
2008-05-30 19:27           ` martin rudalics
2008-05-31  4:52             ` Stefan Monnier
2008-05-31  9:10               ` martin rudalics
2008-05-30  0:59     ` Richard M Stallman
2008-05-30  7:08       ` martin rudalics
2008-05-31  2:07         ` Richard M Stallman
2008-05-31  6:17           ` Daniel Colascione
2008-05-31  7:09             ` Miles Bader
2008-05-31  9:10           ` martin rudalics
2008-05-30  0:59     ` Richard M Stallman
2008-05-30  7:08       ` martin rudalics
2008-05-29 15:18 ` Chong Yidong
2008-05-30  7:06   ` martin rudalics
2008-05-29 16:10 ` Chong Yidong
2008-05-29 19:11   ` Miles Bader
2008-05-29 21:40     ` Chong Yidong
2008-05-29 22:33       ` Miles Bader
2008-05-29 23:53         ` Thomas Lord
2008-05-30  7:07           ` martin rudalics
2008-05-30 16:42             ` Thomas Lord
2008-05-30 16:08               ` Stefan Monnier
2008-05-31  9:10               ` martin rudalics
2008-05-31 11:52                 ` Juanma Barranquero
2008-05-31 13:36                   ` martin rudalics
2008-05-31 17:22                     ` Thomas Lord
2008-05-31 22:37                       ` martin rudalics
2008-06-02  3:49                         ` Thomas Lord
2008-06-02  9:34                           ` martin rudalics
2008-06-02 21:32                             ` Thomas Lord
2008-06-03  5:52                             ` Miles Bader
2008-06-03  9:02                               ` martin rudalics
2008-06-03  9:51                                 ` René Kyllingstad
2008-06-03 11:26                                   ` martin rudalics
2008-06-03 11:54                                     ` Stephen Berman
2008-06-03 13:21                                       ` René Kyllingstad
2008-06-08  2:39                                         ` Stefan Monnier
2008-08-18 15:37                                           ` René Kyllingstad
2008-05-30  7:07         ` martin rudalics
2008-05-30  7:07     ` martin rudalics
2008-05-30  7:07   ` martin rudalics

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).